Unquoted SQL identifiers in `spec.streams` publication sync and connection pooler lookup
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
調査の方向性
Start with the publication sync in pkg/cluster/streams.go and SQL templates and pooler lookup in pkg/cluster/database.go; compare their identifier handling with role quoting in pkg/util/users/users.go. Check how pg_publication_tables represents identifiers and review existing tests around publication sync and pooler lookup. Done means mixed-case, hyphenated, and reserved-word names work correctly and unchanged publications are not altered on every sync.
索引モデルが issue の本文から書いたものです。
説明
When syncing publications for spec.streams, pkg/cluster/streams.go#L116-L124 formats schemaName and tableName without double quotes (fmt.Sprintf("%s.%s", schemaName, tableName)) and interpolates that list directly into CREATE PUBLICATION and ALTER PUBLICATION at pkg/cluster/database.go#L54-L55:
createPublicationSQL = `CREATE PUBLICATION "%s" FOR TABLE %s WITH (publish = 'insert, update');`
alterPublicationSQL = `ALTER PUBLICATION "%s" SET TABLE %s;`
Even though the CRD schema (pkg/apis/acid.zalan.do/v1/crds.go#L533) allows uppercase letters and hyphens in spec.streams[].tables keys, PostgreSQL folds unquoted mixed-case identifiers (such as public.Orders) to lowercase public.orders (ERROR: relation "public.orders" does not exist) and rejects hyphenated or reserved-word table names (such as public.order-events or public.user) with SQLSTATE 42601. Putting literal quotes in the manifest key does not work either because pkg/cluster/database.go#L49-L53 reads unquoted pt.schemaname || '.' || pt.tablename from pg_publication_tables, so currentTables != tableList never matches and re-runs ALTER PUBLICATION on every sync.
Similarly, in the same file at pkg/cluster/database.go#L76-L95, connectionPoolerLookup substitutes {{.pooler_schema}} and {{.pooler_user}} without double quotes (whereas pkg/util/users/users.go#L148 and pkg/cluster/database.go#L70-L74 quote role names), causing PostgreSQL to fold mixed-case pooler role/schema names to lowercase (ERROR: role "..." does not exist) or fail with a syntax error on hyphenated names.
- 主要言語
- Go
- スター
- 5.3k
- フォーク
- 1.1k
- 平均マージ
- 3日 17時間
- マージ済み PR(30日)
- 11
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
zalando/postgres-operator のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
zalando/postgres-operator#3257 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
zalando/postgres-operator#3254 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
zalando/postgres-operator#3253 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
zalando/postgres-operator#3252 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
zalando/postgres-operator#3182 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
zalando/postgres-operator の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
[inputs.internal] README lists go_version tag on internal_gather instead of internal_agent対応中かも @cvas22 が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
influxdata/telegraf#20264 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] Standalone migration breaks existing Ingress routes using the envoy-http Service port nameオープンaccepted bug wg/enterprise-environment
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
vllm-project/semantic-router#7483 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
stacklok/toolhive-catalog#2076 ·
メンテナーはふだん 1 日以内に返信
-
vulncheck or vulndb
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信