The data catalog provides a unified interface to manage metadata for AnalyticDB for PostgreSQL instances. This topic describes how to create and manage tables in the data catalog.
Access the AnalyticDB for PostgreSQL data catalog
Go to the Workspaces page in the DataWorks console. In the top navigation bar, select a desired region. Find the desired workspace and choose in the Actions column.
Click the
icon in the navigation pane on the left. In the Data Directory directory tree, click AnalyticDB PostgreSQL to go to the AnalyticDB for PostgreSQL data catalog management page.
Create an AnalyticDB for PostgreSQL data catalog
You can add an existing AnalyticDB for PostgreSQL data source to the data catalog.
Click the
icon to the right of the AnalyticDB for PostgreSQL data catalog to open the Add Instance page.On the DataWorks Data Source tab, add the AnalyticDB for PostgreSQL data source to the data catalog.
To manage an existing AnalyticDB for PostgreSQL data source in the current workspace, find the data source on the DataWorks Data Source tab and click Add in the Operation column.
You can also select multiple AnalyticDB for PostgreSQL data sources on the DataWorks Data Source tab and click Batch Add at the bottom of the list.
Manage the AnalyticDB for PostgreSQL data catalog
You can add and manage tables in the AnalyticDB for PostgreSQL data catalog.
Create a table
Click the
icon to the left of the AnalyticDB for PostgreSQL instance and locate Table in the database.Click the
icon to the right of Table to open the Create Table page.You can generate the table's basic and column information in one of two ways:
Copilot Create Table:
Click Copilot table creation in the toolbar at the top of the page to open the Copilot Chat interface.
Enter a table creation instruction in natural language, such as
Create a daily user purchase details table.Click Generate and Replace. The system generates a default table name and column information based on your instruction.
If the table name and columns meet your expectations, click Accept.
NoteIf you need to modify some table information, click Accept first and then manually edit the system-generated table information.
Manual table creation:
Create a table based on the parameter descriptions.
Parameter
Description
Basic information
Specify the Table Name, Table Description, and other information.
Column information
Edit the columns and column comments.
Manual editing: Click the Insert button above the column information list, specify the number of rows to insert, and then edit the column names, column types, and other information.
Copilot smart editing: Click Generate Field or Generate field descriptions above the column information list. The system generates relevant columns and descriptions based on the table name and table description you specified.
After configuration is complete, click Publish in the toolbar at the top to create the table.
Manage tables
View tables.
After you create a table in the AnalyticDB for PostgreSQL instance, click the
icon to the left of the AnalyticDB for PostgreSQL data catalog, and then click Table to view basic table information on the Table list page. You can also click a specific table name to go to the table details page and view detailed information such as columns and DDL.Manage tables.
On the table details page, click the edit button in the upper-right corner. On the table editing page, modify the Field, Description, and other information as needed. Click Publish for the changes to take effect.
Delete a table.
On the Table list page, find the table you want to delete and click Delete in the Operation column. In the dialog that appears, click Confirm to delete the table.
ImportantDeleted tables cannot be recovered. Proceed with caution.
View and disassociate AnalyticDB for PostgreSQL data catalogs
If you no longer need an AnalyticDB for PostgreSQL data catalog, you can view and disassociate it.
View data catalogs.
After you add an instance to the AnalyticDB for PostgreSQL data catalog, click the
icon to the left of the AnalyticDB for PostgreSQL data catalog to view the added AnalyticDB for PostgreSQL instances.Hover over the corresponding AnalyticDB for PostgreSQL instance to view the Cluster ID and Cluster Type information.
Disassociate a data catalog.
If you no longer need to manage a specific AnalyticDB for PostgreSQL data catalog, right-click the corresponding AnalyticDB for PostgreSQL data catalog and select Disassociate Data Catalog from the context menu.