sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

Handle PostgreSQL system columns

Open ndrpnt opened this issue 3 years ago • 0 comments

Version

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

Example db-fiddle

Not sure if this should be a bug report or a feature request.

Relevant log output

column "ctid" does not exist

Database schema

CREATE TABLE test (
  id INT
);

SQL queries

SELECT ctid FROM test;

Configuration

version: 2
sql:
- schema: sql/schema.sql
  queries: sql/queries.sql
  engine: postgresql
  gen:
    go:
      out: internal/sql

Playground URL

https://play.sqlc.dev/p/0a3172295b4a8b1a7dd1f78f56a864425724d1d5118c73a45f2fd313733c6910

What operating system are you using?

No response

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

ndrpnt avatar Jul 14 '22 23:07 ndrpnt