Re: copy a text type. - Mailing list pgsql-novice

From Tom Lane
Subject Re: copy a text type.
Date
Msg-id 12230.1342931499@sss.pgh.pa.us
Whole thread Raw
In response to Re: copy a text type.  (David Raznick <kindly@gmail.com>)
List 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 by date:

Previous
From: David Raznick
Date:
Subject: Re: copy a text type.
Next
From: Jan Niederhumer
Date:
Subject: pg_upgradecluster hook-scripts