Re: PL/PGSQL: Dynamic Record Introspection

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PL/PGSQL: Dynamic Record Introspection
Дата
Msg-id 25146.1121664758@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: PL/PGSQL: Dynamic Record Introspection  (Neil Conway <neilc@samurai.com>)
Ответы Re: PL/PGSQL: Dynamic Record Introspection
Список pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> Titus von Boxberg wrote:
>> 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.

> Well, I'm just not happy that "foo.bar" means something completely
> different than "foo%bar" -- foo%bar isn't even fetching something called
> "bar" from "foo".

There's a worse objection, which is that % is a perfectly valid operator
name (typically defined as modulo).  The patch is therefore usurping
syntax of an existing feature, which is surely Right Out.

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.

Assuming that we're inventing in a green field, I'd suggest a syntax
along this line:

    recordvalue.(stringexpression)

which is not confusable with any currently-valid syntax.  I'm not sure
what to do about FIELDNAMES --- perhaps this would work:

    recordvalue.(*)

As for NFIELDS, I don't think we need it -- you can always measure the
length of the FIELDNAMES array.

But the real $64 question for plpgsql stuff is "what does Oracle do?"
Is there any remotely comparable functionality in PL/SQL, and if so
what does it look like?

            regards, tom lane

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Interval->day patch
Следующее
От: Eugen Nedelcu
Дата:
Сообщение: Re: thousands comma numeric formatting in psql