From: | Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Mike Mascari <mascarm(at)mascari(dot)com>, Neil Conway <neilc(at)samurai(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, darcy(at)wavefire(dot)com |
Subject: | Re: help with PL/PgSQL bug |
Date: | 2003-01-12 13:35:14 |
Message-ID: | Pine.LNX.4.21.0301130033030.28281-100000@linuxworld.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Sat, 11 Jan 2003, Tom Lane wrote:
> "Mike Mascari" <mascarm(at)mascari(dot)com> writes:
> > From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> >> That's a rowtype variable, though, not a record variable. I believe our
> >> code will work the same as Oracle for that case.
>
> > 4 TYPE EmpRec IS RECORD (
> > 5 id NUMBER,
> > 6 name VARCHAR(20)
> > 7 );
> > 8 emp_rec EmpRec;
>
> > behaves similarly by returning a NULL value for an unmatched row.
>
> Hm, that's interesting --- does Oracle not think that "record" means
> what our plpgsql think it means? I thought we'd stolen all those
> semantics straight from Oracle.
>
> In plpgsql, you can declare a variable like so:
> foo RECORD;
> and that means that it's an unspecified rowtype, whose fields will be
> determined on-the-fly to match the query that assigns to it. It's this
> case that I'm concerned about, because right now it behaves differently
> from the case where the variable's rowtype is predetermined.
My Oracle 8.1.7 documentation tells me that the record type is more or
less like the C struct keyword. Oracle also has a concept of collections
(objects). The type of these is not, however, determined on the fly.
This brings up a small question: does PL/PgSQL need on the fly type
casting?
Gavin
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2003-01-12 14:54:39 | Re: A modest proposal for a FAQ addition |
Previous Message | Mike Mascari | 2003-01-12 13:11:16 | Re: help with PL/PgSQL bug |