Skip to content

Postgres system columns not working #3742

Open
@werjo-gridfuse

Description

@werjo-gridfuse

Version

1.27.0

What happened?

sqlc currently errors out with column "…" does not exist when referencing a PostgreSQL system column (tableoid, xmin, cmin, xmax, cmax or ctid) in an SQL query.

There was already a pull request that should fix this. And there are tests to make sure this is working. See here 1745

In this thread, there was a comment, that its not working with 1.25. Sadly its also not working with 1.27. And if you change the version to 1.23 in the playground, its also not working.

Relevant log output

query.sql:2:8: column "xmin" does not exist

Database schema

CREATE TABLE authors (
  id   BIGSERIAL PRIMARY KEY,
  name text      NOT NULL,
  bio  text
);

SQL queries

SELECT xmin, cmin, xmax, cmax, ctid FROM authors;

Configuration

{
  "version": "2",
  "sql": [{
    "schema": "schema.sql",
    "queries": "query.sql",
    "engine": "postgresql",
    "gen": {
      "go": {
        "out": "db"
      }
    }
  }]
}

Playground URL

https://play.sqlc.dev/p/db9040344439ff1fcf601ba3e93486fca3e1b2c0644fb46e4563bbf81c675116

What operating system are you using?

No response

What database engines are you using?

No response

What type of code are you generating?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions