> -----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
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
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.


- 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.


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to