Re: pg_type
От | Andrew Dunstan |
---|---|
Тема | Re: pg_type |
Дата | |
Msg-id | 463FBEBB.4030004@dunslane.net обсуждение исходный текст |
Ответ на | Re: pg_type (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | 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);
В списке pgsql-hackers по дате отправления: