Connecting to PostgreSQL
Prerequisites
- The PostgreSQL instance is accessible over the network from the PuppyGraph instance.
Configuration
| Configuration | Explanation |
|---|---|
| Catalog name | A customized name assigned to the PostgreSQL connection. It is used internally by PuppyGraph and will be referenced later when building the graph schema. |
| Username | The username used to connect to the PostgreSQL database. |
| Password | The password associated with the database user account. |
| JDBC Connection String | A JDBC-compliant URI used to connect to the PostgreSQL database. See the JDBC documentation for syntax and examples. |
| Driver Class | The fully qualified class name of the PostgreSQL JDBC driver. Default: org.postgresql.Driver |
| Caching JDBC Metadata | Whether to cache JDBC metadata (e.g., table schemas) to improve performance. |
| JDBC Metadata Cache TTL (seconds) | The time-to-live (TTL) for cached JDBC metadata, in seconds. After this period, the metadata will be refreshed. |
Data Type Mapping
| PostgreSQL Type | PuppyGraph Type | Description |
|---|---|---|
boolean, bit(1) |
Boolean |
True or false |
smallint, smallserial |
Short |
16-bit signed integer |
integer, serial |
Int |
32-bit signed integer |
bigint, bigserial |
Long |
64-bit signed integer |
real |
Float |
32-bit IEEE 754 floating point |
double precision |
Double |
64-bit IEEE 754 floating point |
numeric(P, S), decimal(P, S) |
Decimal(P, S) |
Fixed-point decimal; precision P, scale S |
char(n), varchar(n), text |
String |
Character strings |
uuid |
String |
UUID in its text form |
json, jsonb |
String |
JSON document as text |
inet, cidr |
String |
IPv4 or IPv6 address or network |
macaddr, macaddr8 |
String |
MAC address |
bytea |
Binary |
Byte sequence |
date |
Date |
Calendar date without time or timezone |
timestamp, timestamptz |
DateTime |
Date and time with microsecond precision |
text[], varchar[], uuid[], json[], jsonb[] |
Array<String> |
Array of strings. Also applies to arrays of inet, cidr, macaddr and macaddr8 |
- A
numericordecimalcolumn declared without a precision is read asString, because its precision and scale cannot be determined. - A
bit(n)column wider than one bit, such asbit(8), is listed asBoolean, but queries that read it fail. Do not add it to a node or edge as an attribute.bit varyingis not supported. - Arrays of other element types, such as
integer[]ordate[], are not supported. - Columns of any other type, such as
timeorinterval, are not supported. They are listed in Schema Builder, but you cannot add them to a node or edge as attributes.
If you need a data type that is not supported, or one that is not listed here, contact us.
Tutorials
See Querying PostgreSQL Data as a Graph for a complete demo for PostgreSQL. The demo includes setting up the connection to a PostgreSQL database instance.