Re: possible DOMAIN implementation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Horák Daniel <horak(at)sit(dot)plzen-city(dot)cz>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: possible DOMAIN implementation
Date: 2001-05-17 17:58:45
Message-ID: 12167.990122325@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

=?iso-8859-2?Q?Hor=E1k_Daniel?= <horak(at)sit(dot)plzen-city(dot)cz> writes:
> When a new domain is created it will:
> - put a record into pg_type with typnam = domain name, new code for
> typtype = 'd' and typrelid = oid of a new record in pg_class (next line)
> - put a record into pg_class to create a fictional table with a new
> relkind ('d'?), relnatts = 1, relname can be system generated
> (pg_d_<domainname>)

Ugh. Don't overload pg_class with things that are not tables. I see no
reason that either pg_class or pg_attribute should be involved in the
definition of a domain. Make new system tables if you need to, but
don't confuse the semantics of critical tables.

> - put a records into pg_attribute and pg_attrdef with "column
> (attribute) definition" - real type, size, default value etc., owner
> will the fictional table from the previous step

> Then it will be required to modify functions that works with types. When
> typtype of a retrieved type is 'd' then it will perform lookups into
> pg_class, pg_attribute and pg_attrdef to find the real definition of the
> domain. These additional lookups will also create a performace penalty
> of using domains.

Why shouldn't this info be directly available from the pg_type row?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-05-17 18:54:00 Re: [COMMITTERS] pgsql/ oc/src/sgml/runtime.sgml rc/backend/uti ...
Previous Message Peter Eisentraut - PostgreSQL 2001-05-17 17:44:19 pgsql/ oc/src/sgml/runtime.sgml rc/backend/uti ...