Support domain-typed and generated columns in the catalog and change feed

オープン
#49 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
postgresql, rust, sql

調査の方向性

Start with the catalog startup code that reads column types from information_schema and the DDL trigger snapshot in the schema-change path, and compare how each resolves a domain. Tests for the domain cases and generated columns on PostgreSQL 17 and 18 are the place to confirm behaviour. Done when a schema change on a domain column no longer stops the server and stored generated columns flow on PostgreSQL 18.

索引モデルが issue の本文から書いたものです。

説明

Problem

Two kinds of column are not handled correctly today.

  1. Domain-typed columns. A table with a domain column loads at startup, but any later schema change on that table stops the server, even one unrelated to the column. Startup reads the column's type from information_schema, which reports the domain's base type (integer, carried as Int). The DDL trigger reports the domain's own name (positive_int), which the schema-change path doesn't recognise, so the column looks like it changed type.
CREATE DOMAIN positive_int AS integer CHECK (VALUE > 0);
CREATE TABLE orders (id int8 PRIMARY KEY, amount positive_int);
ALTER TABLE orders ADD COLUMN note text;  -- server stops: `amount` "changed type"

Startup also gets some domain types wrong on its own:

  • a domain over another domain is carried as String instead of its base type;
  • an array of a domain is carried as List(String) instead of a list of the base type;
  • a domain over an array type stops the server on the next schema change.
  1. Generated columns. Generated columns are left out of the catalog with a startup warning, because PostgreSQL before 18 does not send them in the change feed. Clients can't read, filter or sort on them. PostgreSQL 18 can stream stored generated columns when the publication sets publish_generated_columns = stored; virtual generated columns are never streamed.

Expected behavior

A domain-typed column should be treated as its base type everywhere: at startup, in the DDL trigger's snapshot, and in schema-change handling, including nested domains and arrays. Generated columns should be served wherever PostgreSQL streams them, and left out with a clear warning where it does not.

Acceptance criteria

  • A schema change on a table with a domain-typed column doesn't stop the server.
  • Startup and the DDL trigger resolve domains to the same type, including a domain over a domain, an array of a domain, and a domain over an array.
  • On PostgreSQL 18 with publish_generated_columns = stored, stored generated columns are served, and their values follow updates.
  • Virtual generated columns, and generated columns before PostgreSQL 18, are left out with a warning naming the reason.
  • Tests cover each domain case and generated columns on PostgreSQL 17 and 18.
主要言語
Rust
スター
129
フォーク
7
平均マージ
1日 19時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

juspay/streamgres のほかの issue

juspay/streamgres の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。