Re: PL/PGSQL: Dynamic Record Introspection

From: "Titus von Boxberg" <ut(at)bhi-hamburg(dot)de>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Neil Conway" <neilc(at)samurai(dot)com>
Cc: <pgsql-patches(at)postgresql(dot)org>
Subject: Re: PL/PGSQL: Dynamic Record Introspection
Date: 2005-07-18 22:11:13
Message-ID: FGEHIMPCMPIPCBNNFENLAEMHCDAA.ut@bhi-hamburg.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

> -----Ursprüngliche Nachricht-----
> Von: Tom Lane
> An: Neil Conway
> Cc: Titus von Boxberg
> Betreff: Re: [PATCHES] PL/PGSQL: Dynamic Record Introspection
>
-------------------

> There's a worse objection, which is that % is a perfectly valid operator
OK. I did not recognize that.

> Another small problem with the patch is the untenable assumption that
> neither FIELDNAMES nor NFIELDS is ever used by anyone as an actual field
> name.
No. You cannot name a variable "NFIELDS" or "FIELDNAMES" that you want to
use
in this expression. The record field names themselves are unaffected.

> As for NFIELDS, I don't think we need it -- you can always measure the
> length of the FIELDNAMES array.
I would like to leave it there. As far as I can see it's much faster
than other builtins for evaluating array dimensions and I think it does
not hurt.
What about
recordvalue.(#)
staying with your syntax?

>
> But the real $64 question for plpgsql stuff is "what does Oracle do?"
I don't have much experience with Oracle. From what I know, Oracle PL/SQL
lacks the concept of records with dynamically assigned structure.
This would make this construct meaningless.
Same for MS SQL. Don't know anything about DB2.

-------------------------

Questions:
- could anyone who knows Oracle better than me confirm
that with Oracle there are no RECORD variables of varying
dynamically assigned type? And thus there is no
construct dyamically acessing the fields of a RECORD type?
- is the syntax RECORD.(identifier), RECORD.(*), RECORD.(#)
still acceptable? I don't have any objections, but
as I already overlooked the modulo stuff
I'd assume my jugdement will not be authoritative :-)
- do you agree with my approach that "identifier"
is restricted to be a variable and cannot be an arbitrary
expression evaluating to a string?
- do you accept the NFIELDS construct, whatever it's
syntax finally would look like? Or do you want it
finally to be removed.

I'd then modify the code to the new syntax.

Regards
Titus

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Mark Wong 2005-07-18 23:01:25 Re: A couple of patches for PostgreSQL 64bit support
Previous Message Bruce Momjian 2005-07-18 20:57:47 Re: thousands comma numeric formatting in psql