0

what could be causing the error below when listing databases in PostgreSQL.

I have 2 clusters running on the same machine under different ports and different data directories. The command works fine when I connect to one of them but fails when I connect to the other.

One cluster is using the PostgreSQL database community version while the other is using the EnterpriseDB Advanced Server 12.1.2 postgres platform but seated on the same machine though different directories.

My psql client version is psql (EnterpriseDB) 12.1.2 and the database version is PostgreSQL 12.1, compiled by Visual C++ build 1914, 64-bit

Error being experienced is:

postgres=# \l
ERROR:  column d.daticu does not exist
LINE 6:        d.daticu as "ICU",
               ^
HINT:  Perhaps you meant to reference the column "d.datacl".

enter image description here

Kalema Edgar
  • 369
  • 5
  • 17
  • 1
    What part of the error message do you not understand? It seems really clear. – Gordon Linoff Feb 04 '20 at 15:36
  • Are you sure you are connecting a Postgres 12 server? What does `select version();` give you? –  Feb 04 '20 at 15:38
  • Challenge is I am just listing databases and not running a select statement. Where is that column "daticu" supposed to be created. It seems to be something within the query the command is running. – Kalema Edgar Feb 04 '20 at 15:39
  • I have added the screenshot with the 2 versions of psql and database version – Kalema Edgar Feb 04 '20 at 15:41
  • If you run `psql -E` you will see the query that `\l` uses. But "vanilla" Postgres does indeed not have a column `pg_database.daticu` - I guess that's some kind of bug in the Enterprise DB version of `psql`. You can either contact them, or use `psql` from a "community" Postgres –  Feb 04 '20 at 15:46
  • Probably @a_horse_with_no_name, thanks and let me try that – Kalema Edgar Feb 04 '20 at 15:53

1 Answers1

2

Your server is open source PostgreSQL, while psql is EnterpriseDB's fork.

EnterpriseDB must have hacked up their pg_database to include an additional column, and the query run for \l references that column. Now open source PostgreSQL doesn't have that column, so the query fails.

Use psql from the same distribution as the server for best results.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263