Re: copy a text type.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: copy a text type.
Дата
Msg-id 12230.1342931499@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: copy a text type.  (David Raznick <kindly@gmail.com>)
Список pgsql-novice
David Raznick <kindly@gmail.com> writes:
> On Sun, Jul 22, 2012 at 1:18 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Perhaps a domain will do what you want?

> Yes it absolutely should be.  Thanks.

> The issue I have now is that psycopg2 the python library does not
> extract the oid of the domain (only the oid of the original type) when
> it describes the columns in returned query.  I am not sure if that is
> an issue with libpq generally or this library.

Oh, you're looking at PQftype?  Yeah, it will report the base type's OID
not the domain's OID; and this is a server-side behavior not something
the client can easily change.  It didn't use to be like that, but we
changed it back in (checks logs...) 2003.  IIRC, the winning argument
was that most clients wouldn't care and would be more likely to be
broken by seeing an OID they didn't recognize.

So yeah, it looks like you'd need a custom type.  Sorry about that.

            regards, tom lane

В списке pgsql-novice по дате отправления:

Предыдущее
От: David Raznick
Дата:
Сообщение: Re: copy a text type.
Следующее
От: Jan Niederhumer
Дата:
Сообщение: pg_upgradecluster hook-scripts