Skip to content

SQL Introspection issue for postgres version < 17 #8502

@thebuck25

Description

@thebuck25

When starting a geldata 6.4 container with a PostGresSQL backend version < 17 the initialization of the backend fails consistently due to (I think) an issue with SQL Introspection. While #7886 seems to indicate that there is version checking to exclude irrelevant columns per version on versions != 17, this does not seem to be the case.

Column dathasloginevt is marked for v17, however when running any version below 17 the backend bootstrap fails because dathasloginevt is not part of the schema yet is included in the query:

2025-03-24T18:50:10.959Z | INFO 53 - 2025-03-24T18:50:10.959 edb.server: Finalizing database setup...
-- | --
  | 2025-03-24T18:50:17.954Z | ---- Exception occurred: column "dathasloginevt" does not exist ----
  | 2025-03-24T18:50:17.954Z | 1. edb.server.pgcon.errors.BackendError: column "dathasloginevt" does not exist
  | 2025-03-24T18:50:17.954Z | ---- Exception Context ----
  | 2025-03-24T18:50:17.954Z | query, line 13, in query
  | 2025-03-24T18:50:17.954Z | \| CREATE VIEW edgedbsql_v6_2f20b3fed0.pg_database AS
  | 2025-03-24T18:50:17.954Z | \|
  | 2025-03-24T18:50:17.954Z | \| SELECT
  | 2025-03-24T18:50:17.954Z | \| oid,
  | 2025-03-24T18:50:17.954Z | \| frontend_name.n as datname,
  | 2025-03-24T18:50:17.954Z | \| datdba,
  | 2025-03-24T18:50:17.954Z | \| encoding,
  | 2025-03-24T18:50:17.954Z | \| datlocprovider,
  | 2025-03-24T18:50:17.954Z | \| datcollate,
  | 2025-03-24T18:50:17.954Z | \| datctype,
  | 2025-03-24T18:50:17.954Z | \| datistemplate,
  | 2025-03-24T18:50:17.954Z | \| datallowconn,
  | 2025-03-24T18:50:17.954Z | > dathasloginevt,
  • EdgeDB Version: 6.4
  • EdgeDB CLI Version: n/a
  • OS Version: Debian Bookwork (docker)

Steps to Reproduce:

  1. Pull geldata:gel/latest
  2. Start with backend DSN pointed to a clean postgres install < v.17 (e.g. 15.xx, 16.x)

Tested against 15.10, 16.2 & 16.3 AWS RDS aurora-postgresql backends & local docker postgres@15.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions