Search code examples
sqlpostgresqlpsqlenterprisedb

PostgreSQL - getting an error when listing databases with message "ERROR: column d.daticu does not exist"


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


Solution

  • 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.