You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
after spending some time looking into the problem, I tested it using sql.database.managed set to true, and it's working. turns out that the pg config Analyzer is doing the job of getting pg system columns, and with default config of sql.database.managed set to false, then the pg config Analyzer is not initialized since there is no db to look for system columns. the solution (maybe) is to set list of hardcoded system columns if pg config Analyzer is not set, what do you think?
Activity
test: Add a test case for #1745
feat(postgresql): Support system columns on tables (#2871)
kyleconroy commentedon Oct 25, 2023
v1.23.0 is out now, which includes this fix
smonv commentedon Jun 7, 2024
@kyleconroy I tried this feature with 1.25 but still got column does not exist error.
https://play.sqlc.dev/p/8761c174f69f3c2e47a581c049c662eb60cf481160c46b491a5ed80b2f3dd043
swallowstalker commentedon Dec 23, 2024
after spending some time looking into the problem, I tested it using
sql.database.managedset totrue, and it's working. turns out that the pg config Analyzer is doing the job of getting pg system columns, and with default config ofsql.database.managedset tofalse, then the pg config Analyzer is not initialized since there is no db to look for system columns. the solution (maybe) is to set list of hardcoded system columns if pg config Analyzer is not set, what do you think?related docs
example config file
feat(postgresql): Support system columns on tables (sqlc-dev#2871)