read_postgres

Read a Postgres table. The table does not have to be a known data source to GlareDB.

Syntax

read_postgres(<connection_str>, <schema>, <table>)
Field Description
connection_str A Postgres connection string.
schema The name of the schema where the table resides.
table The name of the table to query.

Examples

In the following example, a ‘users’ table located in a Postgres database is queryed.

select * from read_postgres(
  'host=your.host port=5432 user=postgres password=postgres database=postgres',
  'public',
  'users'
);

Refer to the documentation on Postgres data sources for more information.