Re: PL/PGSQL: Dynamic Record Introspection

Поиск
Список
Период
Сортировка
От Titus von Boxberg
Тема Re: PL/PGSQL: Dynamic Record Introspection
Дата
Msg-id 42D67C8F.6060502@bhi-hamburg.de
обсуждение исходный текст
Ответ на Re: PL/PGSQL: Dynamic Record Introspection  (Neil Conway <neilc@samurai.com>)
Ответы Re: PL/PGSQL: Dynamic Record Introspection
Список 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

В списке pgsql-patches по дате отправления:

Предыдущее
От: Titus von Boxberg
Дата:
Сообщение: Re: PL/PGSQL: Dynamic Record Introspection
Следующее
От: Eugen Nedelcu
Дата:
Сообщение: Re: thousands comma numeric formatting in psql