<@U04S8PLJWMT> can I obtain from internal airbyte ...
# ask-ai
f
@kapa.ai can I obtain from internal airbyte postgres the list of source and target tables?
k
Based on the provided knowledge sources, you can obtain the list of tables that Airbyte has created in your Postgres destination by connecting to the destination database and running the following command in the Postgres shell:
Copy code
\dt;
This will display all tables in the current schema, including both raw and normalized tables created by Airbyte for each stream you sync. For example, you might see tables like
_airbyte_raw_table_one
,
table_one
,
table_two
, and
table_two_scd
in the
public
schema, which correspond to your source streams and their normalized forms. The raw tables typically start with
_airbyte_raw_
and the normalized tables use the stream name directly or with suffixes like
_scd
for history tables [Explore Airbyte’s incremental data synchronization](https://airbyte.com/tutorials/incremental-data-synchronization#step-7). However, the knowledge sources do not mention a built-in Airbyte "internal" Postgres database or schema that directly lists all source and target tables in a metadata format. The standard approach is to inspect the destination database itself as described above. If you are looking for a metadata table or a special Airbyte-internal schema that tracks all source and target tables, the knowledge sources do not provide information about such a feature. You will need to rely on inspecting the destination database schemas and tables directly.
f
@kapa.ai I mean: from a connection that exists on airbyte can I obtain source and target names?
k
A message from kapa.ai
Yes, you can obtain the source and target (destination) names for a connection that exists in Airbyte. Each Airbyte connection links a configured source (based on a source connector) to a configured destination (based on a destination connector). The connection object contains information about which source and destination it uses, and you can view or manage this information from the Airbyte UI or via the Airbyte API [Core Concepts](https://docs.airbyte.com/platform/using-airbyte/core-concepts). To view this information in the Airbyte UI: - Go to the Connections page. - Click on the specific connection you are interested in. - The connection details will show the source and destination associated with that connection [Manage existing connections](https://docs.airbyte.com/platform/cloud/managing-airbyte-cloud/configuring-connections). Alternatively, you can use the Airbyte API to list connections and retrieve their associated source and destination IDs. However, the knowledge sources do not provide a direct example of querying the internal Airbyte Postgres database for this metadata. In summary: You can obtain the source and destination names for a connection via the Airbyte UI or API, but the knowledge sources do not describe a method to extract this information directly from the internal Airbyte Postgres database.
f
@kapa.ai I want to get it from internal postgres db
k
A message from kapa.ai
Yes, you can obtain the source and destination (target) names for a connection from the internal Airbyte Postgres database. According to the Airbyte database schema documentation, the 
connection
 table in the internal config database contains the following relevant columns: - `source_id`: Foreign key referencing the 
actor(id)
 for the source. - `destination_id`: Foreign key referencing the 
actor(id)
 for the destination. - `name`: Name of the connection. To get the human-readable names of the source and destination, you need to join the 
connection
 table with the 
actor
 table (which stores the names and types of all sources and destinations):
Copy code
sql SELECT   c.id AS connection_id,   c.name AS connection_name,   src.name AS source_name,   dest.name AS destination_name FROM   connection c JOIN   actor src ON c.source_id = src.id JOIN   actor dest ON c.destination_id = dest.id;
This query will give you a list of connections with their associated source and destination names, as stored in the internal Airbyte Postgres database [Understanding-airbyte > Airbyte Databases Data Catalog > Config Database](https://docs.airbyte.com/platform/understanding-airbyte/database-data-catalog#connection).
f
@kapa.ai I want to see table name for source and destination also
k
A message from kapa.ai
I'm sorry, but the knowledge sources do not provide enough information to answer your question about how to obtain the specific table names for both the source and destination from the internal Airbyte Postgres database. The available documentation describes how to get connection, source, and destination names from the internal database (via the
connection
and
actor
tables), but it does not detail how to directly retrieve the actual table names (e.g., the names of tables in the source or destination databases) from Airbyte's internal metadata tables. The internal schema focuses on streams, connections, and actors, but does not map these directly to physical table names in the source or destination systems. If you need to know which tables are being synced, you can: - View the streams configured for a connection in the Airbyte UI under the "Schema" tab, where each stream typically corresponds to a table or endpoint in the source and a table in the destination [Configuring schemas](https://docs.airbyte.com/platform/next/using-airbyte/configuring-schema). - Query the destination database directly to see which tables have been created by Airbyte. But, as for extracting this mapping (source table name to destination table name) directly from the internal Airbyte Postgres database, the knowledge sources do not provide a method or schema for this.