Unquoted SQL identifiers in `spec.streams` publication sync and connection pooler lookup
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 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 小时
- 30 天内合并 PR
- 11
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 天内回复