Repository navigation
Conversation
Metabase schema sync reads pg_namespace/pg_class, which were static catalog dumps, so user schemas such as app never appeared. SQLAlchemy connects with select pg_catalog.version(), which DuckDB treated as a column. Expose live namespaces and relations and return a PostgreSQL version banner for the qualified call.
Community MinIO client downloads on dl.min.io now return 410 Gone, so backup-restore-test never starts. Pin the last public linux-amd64 GitHub release instead of the unversioned URL. Co-authored-by: Cursor <cursoragent@cursor.com>
DuckDB rejects read-only transactions and SHOW timezone can be Local, so Metabase aborted field sync. Start a normal tx instead of a RO DuckDB tx, default Local to UTC, and make _pg_expandarray KEY_SEQ a scalar. Co-authored-by: Cursor <cursoragent@cursor.com>
leon-ape
left a comment
There was a problem hiding this comment.
Independent review of head c1b7a49 (not an approval). Do not merge or release. Official image 85ce0d0d stays fail. Application originals already reviewed on other identities remain as recorded.
Code vs stated goal
The change set matches Metabase schema listing and SQLAlchemy select pg_catalog.version():
__sys__.pg_namespace/pg_classbecome live views over renamed*_catalogtables plusinformation_schema/duckdb_tables()/duckdb_views().pg_catalog.version()is rewritten to a PostgreSQL banner; bareselect version()is left as DuckDB.- Quoted
"pg_catalog"."pg_namespace"rewrite now quotes identifiers and matches longer names first. - DuckDB-unsupported
BEGIN READ ONLYis stripped atBeginTx. - Empty/
Localtimezone defaults toUTC. _pg_expandarrayKEY_SEQ is unnested to a scalar;my_list_containscasts both sides to VARCHAR.
Tests
Covered: namespace app, pg_class⋈pg_namespace, version rewrite vs bare version(), BEGIN READ ONLY, SHOW timezone, quoted ConvertToSys.
Gap: TestPGCatalogMetabaseAndSupersetCompat runs the JDBC PK / _pg_expandarray query but never requires a row. An empty result still passes. Please assert at least KEY_SEQ/COLUMN_NAME for app.pk_t.id.
TestDuckBeginTxOptionsStripsReadOnly only checks the helper; the protocol path is covered by the integration BEGIN READ ONLY.
CI on this SHA
- Go:
backend.TestImplicitCleanupRegistrationAndDetachAreAtomicexpected 1 actual 0. File is not in this diff. - MySQL Binlog:
TestAutoRestartReplicafailed; other groups cancelled. Not in this diff. - Docker replica (dolt):
schema "test" does not existonSELECT COUNT(*) FROM test.items. - backup-restore, BATS, client compat, and non-dolt replica jobs succeeded.
Parent 754a74ce already had Go, MySQL Binlog, and Docker Replica Mode Test red. I am not classifying those as PG-compat regressions here, and I am not treating this SHA's CI as green.
Other notes
- Read-only begins become ordinary DuckDB transactions; the engine will not reject writes.
- Fallback banner
PostgreSQL 16.1 (Homebrew)is Darwin-flavored ifserver_versionlookup fails. SELECT * FROM pg_class_catalog UNION ALL <explicit live columns>depends on dump column order.
Conclusion: source matches the PG catalog/Metabase/Superset work. Not approved. Do not merge.
Empty getPrimaryKeys results were passing because pg_index.indexrelid did not join pg_class and pg_attribute had no live user columns. Use a stable index oid, expose index relations and attributes, and assert KEY_SEQ and COLUMN_NAME. Co-authored-by: Cursor <cursoragent@cursor.com>
leon-ape
left a comment
There was a problem hiding this comment.
Follow-up on head 3246583 (parent c1b7a49). Not an approval. Do not merge or release. 85ce0d0d stays fail.
Previous test gap
Closed in pgserver/pg_catalog_compat_test.go: the JDBC PK / _pg_expandarray query now requires found == 1 with COLUMN_NAME=id and KEY_SEQ=1 for app.pk_t. Empty results fail.
Supporting catalog
catalog/internal_views.go:
pg_index.indexrelidis a stable hash of schema.table.constraint instead ofROW_NUMBER().- Live
pg_classaddsrelkind='i'rows with the same hash sopg_class ci ON ci.oid = i.indexrelidcan match. - New live
pg_attributeview for user-table columns soattrelid = pg_class.oidcan matchapp.pk_t.
No new go-test log was attached for this SHA. The assertion is in source; I did not re-run the test here.
Notes
- Live
pg_attributestampsatttypid=25(text) on every user column. Fine for this PK join; it is not real type metadata. - Index
relnattsis hardcoded1; composite keys would be wrong. - Hash OIDs can collide; same caveat as live namespaces.
Application originals on earlier identities are unchanged. Parent CI red (Go / Binlog / Dolt replica) remains classified outside this diff. Still not approved.
|
go test originals for head
Includes the JDBC PK / Not merging. Parent-baseline Go / Binlog / Dolt replica failures unchanged. |
leon-ape
left a comment
There was a problem hiding this comment.
Follow-up on head 3246583 go-test originals (task94-gotest-20260913T202218Z, SHA256 ba10a973436e5623fe7f10964456282c6ff95c96ae3648ddecf6d0dd0004fb97). Not an approval. Do not merge or release. 85ce0d0d stays fail.
Logs bind HEAD 324658347bdebfa445b0c9a6f876ee9e24d57665 tree 173a9855:
go test ./pgserver -run 'TestPGCatalogMetabaseAndSupersetCompat|TestFuncReplacement|TestConvertToSysRewritesQuotedPgCatalog'→ok5.118s, exit=0. Subset, not-v, not the whole package.TestPGCatalogMetabaseAndSupersetCompatis in the-runlist; a failingfound==1assertion would have failed the package.go test ./catalog→ok7.302s, exit=0, no FAIL.
Source assertion from the previous Comment still stands. Parent-baseline Go / Binlog / Dolt replica red is unchanged. Still not approved.
|
Full
Full logs: raft pack Not merging. Parent-baseline Go / Binlog / Dolt replica failures unchanged. |
leon-ape
left a comment
There was a problem hiding this comment.
Follow-up on head 3246583 full go test ./pgserver -v originals (task94-gotest-full-v-20260913T202536Z, SHA256 690c290fc2cf3a383d0476958ce8475c8173684ba007c1b2fb1d61840acc7e2d). Not an approval. Do not merge or release. 85ce0d0d stays fail.
Log header HEAD=324658347bdebfa445b0c9a6f876ee9e24d57665 tree=173a9855, command go test ./pgserver -v -count=1 -timeout 30m:
- 102
--- PASS:, 0--- FAIL:, 0--- SKIP: TestPGCatalogMetabaseAndSupersetCompatPASS 1.40s (cache_statement+simple_protocol)- package
ok27.479s,exit=0 - log contains no
FAILsubstring
Previous subset + ./catalog logs are included and still PASS. The -run gap is closed.
Parent-baseline Go / Binlog / Dolt replica red is unchanged. Still not approved.
leon-ape
left a comment
There was a problem hiding this comment.
Decision on Approve vs Comment for 3246583:
There is no remaining code gap that blocks the stated Metabase/Superset PG-compat goal. Application originals, JDBC PK assertion, and go test ./pgserver -v (102 PASS / 0 FAIL) are already reviewed.
I am not switching to GitHub Approve. Approve would be read as merge-ready. Holds that stay process, not new patches:
- Do not merge while parent-baseline Go / Binlog / Dolt replica workflows are still red.
- Official image
85ce0d0dstays fail until a new image exists; do not retag. - Known limitations (BEGIN READ ONLY becomes a normal tx, live
pg_attribute.atttypid=25, hash OIDs) are accepted for this goal, not merge blockers.
Code+tests LGTM for the PG-compat work. Still Comment, not Approve. Do not merge or release.
leon-ape
left a comment
There was a problem hiding this comment.
Code review of head 324658347bdebfa445b0c9a6f876ee9e24d57665 (tree 173a9855).
This is a code Approve only. It is not merge, not release, and not a retag of v0.3.0 / latest. Official image 85ce0d0d PostgreSQL Metabase /schemas=[] and Superset pg_catalog.version() failures stay fail until a new image identity is independently proven.
Code vs stated goal
Re-checked source on this SHA. The change set still matches Metabase schema listing and SQLAlchemy select pg_catalog.version():
- Live
__sys__.pg_namespace/pg_class/pg_attributeviews;pg_classincludesrelkind='i'so JDBC PK joins can match. pg_index.indexrelidis a stable hash; JDBC_pg_expandarrayquery inTestPGCatalogMetabaseAndSupersetCompatrequiresfound == 1withCOLUMN_NAME=idandKEY_SEQ=1forapp.pk_t.pg_catalog.version()rewritten to a PostgreSQL banner; bareversion()unchanged.- Quoted
"pg_catalog"rewrite;BEGIN READ ONLYstripped atBeginTx; empty/Localtimezone → UTC.
No remaining code gap for that goal. Parent-baseline Go / Binlog / Dolt replica red is not in this file list and is not a GitHub required check on main.
Accepted limitations (not blockers for this review)
BEGIN READ ONLYbecomes a normal DuckDB transaction; the engine will not reject writes.- Live
pg_attribute.atttypid=25; indexrelnattshardcoded1; hash OIDs can collide. - Fallback banner
PostgreSQL 16.1 (Homebrew)ifserver_versionlookup fails. migrateLegacyPGCatalogTableno-ops when both old and new catalog tables exist.
Out of this review
Merge, auto-merge, stable-tag promotion, and new-image Metabase/Superset GUI originals are separate. Do not execute those from this Approve.
Summary
pg_catalog.pg_namespace/pg_classnow include live user schemas and tables (for exampleapp), so Metabase GUI schema/table discovery is no longer empty.select pg_catalog.version()returns a PostgreSQL banner fromserver_version(SQLAlchemy/Superset connect). Bareselect version()is unchanged (DuckDB).main(754a74ce). Does not retag, release, or mark official image85ce0d0das passing.Test plan
go test ./pgserverfocused catalog/compat casesgo test ./catalogappand fourapp.*tables listed. Database 3 on85ce0d0dstill returns an empty schema list.postgresql+psycopg2connects;select pg_catalog.version()returnsPostgreSQL 16.1 (Homebrew); COUNT/WHERE/GROUP onapp.pg_local.Identities
754a74cee899b8cccd858120287aef021a410eec9ab75b2c2f1d27606d606a03ed109cc9c82ecf68f57789205753ca5e4f68dbb8909c44752c465967