COMMENT ON CONSTRAINT <name> ON DOMAIN <domain>?

Started by Elvis Pranskevichusabout 12 years ago2 messages
#1Elvis Pranskevichus
elprans@gmail.com

Hello,

I may be totally missing something, but there seems to be no way
to create a COMMENT on a domain constraint. There is

COMMENT ON CONSTRAINT constraint_name ON table_name

but no such thing for domain constraints, which seems like a
weird omission.

I couldn't find any relevant discussions on the list; is there a
technical reason this is not implemented?

Looking at the source, get_object_address() always assumes a
constraint is a table constraint. It seems to me that there is
a relatively easy fix:

COMMENT ON CONSTRAINT constraint_name ON DOMAIN domain_name,

then store constraint subject type (relation vs. domain) in
objname list, and handle that in get_object_address().

Thoughts?

Elvis

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Elvis Pranskevichus (#1)
Re: COMMENT ON CONSTRAINT <name> ON DOMAIN <domain>?

On 11/21/13, 3:29 PM, Elvis Pranskevichus wrote:

I may be totally missing something, but there seems to be no way
to create a COMMENT on a domain constraint. There is

COMMENT ON CONSTRAINT constraint_name ON table_name

but no such thing for domain constraints, which seems like a
weird omission.

Yeah. Feel free to implement it. It shouldn't be hard.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers