Re: pg_type

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_type
Date: 2007-05-08 00:05:15
Message-ID: 463FBEBB.4030004@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Yeah, adding a column to one of the core "bootstrap" tables is a real
> PITA. But I guess we don't do it often enough to justify having more
> infrastructure for that.
>

Maybe we should beef up the comments in those few stratgegic headers
files a bit though.

>> Now to use the field ....
>>
> If it hasn't occurred to you already: please add a test or two in
> typ_sanity.sql to check that the column is sane, eg the type it points
> to is a varlena type that points back to the element type.
>
>

Yeah, I have the test below so far - will fix more when I have the name
generation bit done.

cheers

andrew

-- Make sure typarray points to a varlena array type of our own base
SELECT p1.oid, p1.typname as basetype, p2.typname as arraytype,
p2.typelem, p2.typlen
FROM pg_type p1 left join pg_type p2 on (p1.typarray = p2.oid)
WHERE p1.typarray <> 0 AND
(p2.oid IS NULL OR p2.typelem <> p1.oid OR p2.typlen <> -1);

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hiroshi Inoue 2007-05-08 00:06:34 Re: Re: [COMMITTERS] psqlodbc - psqlodbc: Put Autotools-generated files into subdirectory
Previous Message Hiroshi Inoue 2007-05-07 23:45:04 Re: psqlodbc - psqlodbc: Put Autotools-generated files into subdirectory