Skip to main content
Version: 0.3.1

PostgreSQL catalog

Introduction

Gravitino provides the ability to manage PostgreSQL metadata.

Catalog

Catalog capabilities

  • Gravitino catalog corresponds to the PostgreSQL database.
  • Supports metadata management of PostgreSQL (9.2, 12.0, 13.0).
  • Supports DDL operation for PostgreSQL schemas and tables.
  • Doesn't support table index operations.
  • Doesn't support setting certain column properties, such as default value and check constraints

Catalog properties

Any property that isn't defined by Gravitino can pass to MySQL data source by adding gravitino.bypass prefix as a catalog property. For example, catalog property gravitino.bypass.maxWaitMillis will pass maxWaitMillis to the data source property. You can check the relevant data source configuration in data source properties

If you use JDBC catalog, you must provide jdbc-url, jdbc-driver, jdbc-database, jdbc-user and jdbc-password to catalog properties.

Configuration itemDescriptionDefault valueRequiredSince Version
jdbc-urlJDBC URL for connecting to the database. You need to specify the database in the URL. For example jdbc:postgresql://localhost:3306/pg_database?sslmode=require.(none)Yes0.3.0
jdbc-driverThe driver of the JDBC connection. For example org.postgresql.Driver.(none)Yes0.3.0
jdbc-databaseThe database of the JDBC connection. Configure it with the same value as the database in the jdbc-url. For example pg_database.(none)Yes0.3.0
jdbc-userThe JDBC user name.(none)Yes0.3.0
jdbc-passwordThe JDBC password.(none)Yes0.3.0
jdbc.pool.min-sizeThe minimum number of connections in the pool. 2 by default.2No0.3.0
jdbc.pool.max-sizeThe maximum number of connections in the pool. 10 by default.10No0.3.0
caution

You must download the corresponding JDBC driver to the catalogs/jdbc-postgresql/libs directory. You must explicitly specify the database in both jdbc-url and jdbc-database. An error may occur if the values in both aren't consistent.

info

In PostgreSQL, the database corresponds to the Gravitino catalog, and the schema corresponds to the Gravitino schema.

Catalog operations

Please refer to Manage Metadata Using Gravitino for more details.

Schema

Schema capabilities

  • Gravitino schema corresponds to the PostgreSQL schema.
  • Supports create schema with comments.
  • Supports drop schema.
  • Supports cascade drop schema.

Schema properties

  • Doesn't support any schema property settings.

Schema operations

Please refer to Manage Metadata Using Gravitino for more details.

Table

Table capabilities

  • The Gravitino table corresponds to the PostgreSQL table.
  • Supports DDL operation for PostgreSQL tables.
  • Doesn't support setting certain column properties, such as default value and check constraints.
  • Doesn't support index definition.
  • Doesn't support table property settings.

Table column types

Gravitino TypePostgreSQL Type
Booleanboolean
ByteTinyint
ShortSmallint
IntegerInteger
LongBigint
FloatReal
DoubleDouble precision
StringText
DateDate
TimeTime without time zone
TimestampTimestamp without time zone
Timestamp_tzTimestamp with time zone
DecimalNumeric
VarCharCharacter varying
FixedCharFixedChar
BinaryBytea
info

PostgreSQL doesn't support Gravitino Fixed Struct List Map IntervalDay IntervalYear Union UUID type.

Table properties

  • Doesn't support table properties.

Table operations

Please refer to Manage Metadata Using Gravitino for more details.

Alter table operations

Supports operations:

  • RenameTable
  • UpdateComment
  • AddColumn
  • DeleteColumn
  • RenameColumn
  • UpdateColumnType
  • UpdateColumnNullability
  • UpdateColumnComment
info

You can't submit the RenameTable operation at the same time as other operations.

caution

PostgreSQL doesn't support the UpdateColumnPosition operation, so you can only use ColumnPosition.defaultPosition() when AddColumn. If you update a nullability column to non nullability, there may be compatibility issues.