Re: PL/PGSQL: Dynamic Record Introspection

From: Titus von Boxberg <ut(at)bhi-hamburg(dot)de>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: PL/PGSQL: Dynamic Record Introspection
Date: 2005-07-14 14:54:07
Message-ID: 42D67C8F.6060502@bhi-hamburg.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Neil Conway schrieb:
> I wonder if this is the right syntax. record%identifier is doing
> something fundamentally different from record.identifier, but the syntax
> doesn't make that clear. I don't have any concrete suggestions for
> improvement, mind you... :)
What do you mean by "right syntax". There are hundreds of examples
in programming languages where a "small" syntactic difference leads to totally
different semantics.
I chose % because
- it's already used in the var%TYPE notation. Here %xxx stands for
a kind of extracting operator, too. In this sense, %TYPE's operation is similar
to variables what %NFIELDS, %FIELDNAMES and %variable do to records.
- I could not think of any other operator that would not be harmful
for the parser (or cause much work) and also would not lead to
other ambiguities in the sense not being "right".
- % strongly differs optically from .

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

>
> Can you supply some proper regression tests, please? i.e. patch
> sql/plpgsql.sql and expected/plpgsql.out in src/test/regress
I'll do that.
>
> A few minor comments from skimming the patch:
I'll implement your suggestions.

I'll also remove the changes to the RECFIELD value evaluation semantics
completely that I introduced.

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

Are there any general objections to implement this feature?
Personally, I would very much like to see it implemented because
I do want to use plpgsql and without this feature (trigger)
procedures cannot be held general if dealing with structural
similarities between tables they are invoked upon.

I'd send the patched patch when I'm done.

Regards
Titus

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Matthew T. O'Connor 2005-07-14 16:57:39 Re: Autovacuum loose ends
Previous Message Tom Lane 2005-07-14 14:52:56 Autovacuum loose ends