Re: patch: plpgsql - access records with rec.(expr)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: patch: plpgsql - access records with rec.(expr)
Дата
Msg-id 15979.1101140392@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: patch: plpgsql - access records with rec.(expr)  (Matt <matt@kynx.org>)
Ответы Re: patch: plpgsql - access records with rec.(expr)  (Matt <matt@kynx.org>)
Список pgsql-hackers
Matt <matt@kynx.org> writes:
> Does that make any sense? Is it worth the work? Or should we just tell
> anyone who actually needs it (I don't, at present) 'use another PL'?

I don't really see this going anywhere --- it's contorting the semantics
of plpgsql too much for too little gain.  The typical use-case I've
heard of for this sort of thing is "I want to write a generic trigger,
so I need to iterate over the columns of NEW.* without knowing their
names or data types in advance".  Your proposal doesn't address the
issue of how the function would find out the column names in order to
make use of the proposed notation; and as you noted there's still a
serious problem with varying datatypes.

Either plperl or pltcl (probably also plpython but I'm not familiar
with that language) is a better choice for writing such triggers,
because those languages already have answers for all these issues.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: patch: plpgsql - access records with rec.(expr)
Следующее
От: Andreas Pflug
Дата:
Сообщение: Re: Test database for new installs?