Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group