public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: jian he <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: make \d table Collation field showing domains collation if that attribute is type of domain.
Date: Thu, 03 Oct 2024 10:46:46 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CACJufxG-Ww0Hezx=AxMxsM_Wkdp+VbWwXQQKPD7uC7pzym+-+Q@mail.gmail.com>
References: <CACJufxG-Ww0Hezx=AxMxsM_Wkdp+VbWwXQQKPD7uC7pzym+-+Q@mail.gmail.com>
jian he <[email protected]> writes:
> main changes:
> @@ -1866,7 +1866,7 @@ describeOneTableDetails(const char *schemaname,
> attrdef_col = cols++;
> attnotnull_col = cols++;
> appendPQExpBufferStr(&buf, ",\n (SELECT c.collname
> FROM pg_catalog.pg_collation c, pg_catalog.pg_type t\n"
> - " WHERE
> c.oid = a.attcollation AND t.oid = a.atttypid AND a.attcollation <>
> t.typcollation) AS attcollation");
> + " WHERE
> c.oid = a.attcollation AND t.oid = a.atttypid and c.collname <>
> 'default' ) AS attcollation");
I doubt that this is an improvement. It will create as many
weird cases as it removes. (To cite just one, there is nothing
preventing somebody from creating a collation named "default".)
The existing definition seems fine to me, anyway. What's so
wrong with treating the domain's collation as being an implicit
property of the domain type? What you want to do hopelessly confuses
this display between attributes of the table and attributes of the
column type.
A nearby comparable case is that the "Default" column only tells
about default values applied in the table definition, not any
that might have come from the domain. Nor does the "Check
constraints" footer tell about constraints coming from a
domain column.
regards, tom lane
view thread (3+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: make \d table Collation field showing domains collation if that attribute is type of domain.
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox