pg_dump misses comments on NOT NULL constraints - Mailing list pgsql-hackers

From Fujii Masao
Subject pg_dump misses comments on NOT NULL constraints
Date
Msg-id d50ff977-c728-4e9e-8488-fc2688e08754@oss.nttdata.com
Whole thread Raw
Responses Re: pg_dump misses comments on NOT NULL constraints
List pgsql-hackers
Hi,

In v18, we can now add comments on NOT NULL constraints. However, I noticed
that pg_dump doesn't include those comments in its output. For example:

--------------------------
$ psql <<EOF
CREATE TABLE t (i int);
ALTER TABLE t ADD CONSTRAINT my_not_null NOT NULL i;
ALTER TABLE t ADD CONSTRAINT my_check CHECK (i > 0);
COMMENT ON CONSTRAINT my_not_null ON t IS 'my not null';
COMMENT ON CONSTRAINT my_check ON t IS 'my check';
EOF

$ pg_dump | grep COMMENT
-- Name: CONSTRAINT my_check ON t; Type: COMMENT; Schema: public; Owner: postgres
COMMENT ON CONSTRAINT my_check ON public.t IS 'my check';
--------------------------

As shown above, the comment on my_not_null is missing from the dump output.

Is this an oversight in commit 14e87ffa5c5? If so, I'll add it as
a v18 open item.

I'm aware of a related open item [1] affecting both v17 and v18,
but this seems like a separate issue, since it relates to a new v18 feature...
Or we should treat them the same?

Regards,

[1] https://www.postgresql.org/message-id/CACJufxF-0bqVR%3Dj4jonS6N2Ka6hHUpFyu3_3TWKNhOW_4yFSSg%40mail.gmail.com

-- 
Fujii Masao
NTT DATA Japan Corporation




pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Proposal: Global Index for PostgreSQL
Next
From: Masahiko Sawada
Date:
Subject: Re: POC: enable logical decoding when wal_level = 'replica' without a server restart