Re: Postgres / plpgsql equivalent to python's getattr() ?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Postgres / plpgsql equivalent to python's getattr() ?
Дата
Msg-id 25186.1312411718@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Postgres / plpgsql equivalent to python's getattr() ?  (James Robinson <jlrobins@socialserve.com>)
Ответы Re: Postgres / plpgsql equivalent to python's getattr() ?  (Florian Pflug <fgp@phlo.org>)
Re: Postgres / plpgsql equivalent to python's getattr() ?  (Hannu Krosing <hannu@2ndQuadrant.com>)
Список pgsql-hackers
James Robinson <jlrobins@socialserve.com> writes:
> Python's getattr() allows for dynamic lookup of attributes on an  
> object, as in:

>     inst = MyClass(x=12, y=24)
>     v = getattr(inst, 'x')
>     assert v == 12

> Oftentimes in writing data validating trigger functions, it'd be real  
> handy to be able to do a similar thing in plpgsql

> Is there something in the internals which inherently prevent this? 

plpgsql is strongly typed (much more so than python, anyway).
        regards, tom lane


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

Предыдущее
От: daveg
Дата:
Сообщение: Re: Further news on Clang - spurious warnings
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: Further news on Clang - spurious warnings