# Create a Database Table

Launch stage: Public Preview

`POST /api/2.0/database/tables`

Create a Database Table. This registers a table that already exists in a Postgres database of a
 database instance as a table in Unity Catalog. The Postgres database, schema and table must
 already exist; the request does not create them. Repeating the request for the same table
 succeeds, and a request for a name that is already registered from a different database or
 instance fails. To create a Postgres table from a Unity Catalog source table instead, use
 [Create a Synced Database Table](https://docs.databricks.com/api/workspace/database/createsynceddatabasetable).

API scopes: postgres

Clouds: AWS, Azure

## Request body

- `name` (string, required)
  Full three-part (catalog, schema, table) name of the table in Unity Catalog. The catalog must be a
   standard or default storage catalog; database tables cannot be registered in a database catalog.
   The schema and table parts must match the schema and table names of the Postgres table that is
   registered.
- `database_instance_name` (string, optional)
  The name of the database instance that hosts the Postgres table. It must be set when creating a
   database table.
- `logical_database_name` (string, optional)
  The name of the Postgres database in the instance that contains the table. It must be set when
   creating a database table. Tables in the system databases postgres, databricks_system, template0
   and template1, and tables in the schemas pg_catalog and information_schema, cannot be registered.

## Returns

Returns the DatabaseTable object.

## Request

### Register an existing Postgres table

```json
{
  "name": "main.sales.orders",
  "database_instance_name": "sales-orders-db",
  "logical_database_name": "sales_orders"
}
```

## Response

### Registered table

```json
{
  "name": "main.sales.orders",
  "database_instance_name": "sales-orders-db",
  "logical_database_name": "sales_orders"
}
```

