Re: PL/PGSQL: Dynamic Record Introspection - Mailing list pgsql-patches

From Titus von Boxberg
Subject Re: PL/PGSQL: Dynamic Record Introspection
Date
Msg-id FGEHIMPCMPIPCBNNFENLAEMHCDAA.ut@bhi-hamburg.de
Whole thread Raw
In response to Re: PL/PGSQL: Dynamic Record Introspection  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: PL/PGSQL: Dynamic Record Introspection  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: PL/PGSQL: Dynamic Record Introspection  (Neil Conway <neilc@samurai.com>)
List 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


pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: thousands comma numeric formatting in psql
Next
From: Mark Wong
Date:
Subject: Re: A couple of patches for PostgreSQL 64bit support