Thread: oids vs composite types, in cvs head

oids vs composite types, in cvs head

From
Andrew - Supernews
Date:
This works on 7.4 and 8.0 but not in cvs head:

create function foo(pg_type) returns oid as 'select $1.oid' language sql;
ERROR:  column "oid" not found in data type pg_type
CONTEXT:  SQL function "foo"

Is this intentional, or did the no-oids-by-default changes cut too deep?

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services


Re: oids vs composite types, in cvs head

From
Tom Lane
Date:
Andrew - Supernews <andrew+nonews@supernews.com> writes:
> This works on 7.4 and 8.0 but not in cvs head:
> create function foo(pg_type) returns oid as 'select $1.oid' language sql;
> ERROR:  column "oid" not found in data type pg_type
> CONTEXT:  SQL function "foo"

> Is this intentional, or did the no-oids-by-default changes cut too deep?

Hmm ... offhand, I'd say that if it worked in 8.0 it was only by chance.
In general a tuple that matches the signature of a pg_type row need not
contain an OID.  Still it does seem that we have broken some specific
cases that used to work.  Anyone want to dig into the details?
        regards, tom lane


Re: oids vs composite types, in cvs head

From
Michael Fuhr
Date:
On Tue, Jul 05, 2005 at 10:55:38PM -0400, Tom Lane wrote:
> Andrew - Supernews <andrew+nonews@supernews.com> writes:
> > This works on 7.4 and 8.0 but not in cvs head:
> > create function foo(pg_type) returns oid as 'select $1.oid' language sql;
> > ERROR:  column "oid" not found in data type pg_type
> > CONTEXT:  SQL function "foo"
> 
> > Is this intentional, or did the no-oids-by-default changes cut too deep?
> 
> Hmm ... offhand, I'd say that if it worked in 8.0 it was only by chance.
> In general a tuple that matches the signature of a pg_type row need not
> contain an OID.  Still it does seem that we have broken some specific
> cases that used to work.  Anyone want to dig into the details?

It fails for any system column -- weren't there some changes recently
in how system columns are handled?

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


Re: oids vs composite types, in cvs head

From
Michael Fuhr
Date:
On Tue, Jul 05, 2005 at 09:22:37PM -0600, Michael Fuhr wrote:
> 
> It fails for any system column -- weren't there some changes recently
> in how system columns are handled?

...or was that just discussion that never resulted in any changes?
I'm still digging through the archives trying to find what I'm
remembering.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


Re: oids vs composite types, in cvs head

From
Andrew - Supernews
Date:
On 2005-07-06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Andrew - Supernews <andrew+nonews@supernews.com> writes:
>> This works on 7.4 and 8.0 but not in cvs head:
>> create function foo(pg_type) returns oid as 'select $1.oid' language sql;
>> ERROR:  column "oid" not found in data type pg_type
>> CONTEXT:  SQL function "foo"
>
>> Is this intentional, or did the no-oids-by-default changes cut too deep?
>
> Hmm ... offhand, I'd say that if it worked in 8.0 it was only by chance.
> In general a tuple that matches the signature of a pg_type row need not
> contain an OID.  Still it does seem that we have broken some specific
> cases that used to work.  Anyone want to dig into the details?

I think this is what changed it:

http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parse_func.c.diff?r1=1.176;r2=1.177

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services