Re: Isolating a record column from a PL-Pgsql function call ?
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Isolating a record column from a PL-Pgsql function call ? |
| Дата | |
| Msg-id | 18061.1229473684@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Isolating a record column from a PL-Pgsql function call ? ("Gauthier, Dave" <dave.gauthier@intel.com>) |
| Список | pgsql-general |
"Gauthier, Dave" <dave.gauthier@intel.com> writes: > I have a PL-Pgsql function that returns a record of a type that have 4 elements (columns). Let's say the first element/columnis called "id_num". Is there a way I can specify the id_num element of the record returned from iside a query? > For example, select col1 from thetable where my_plpgsql_fn(col2).id_num = 123; You're just missing some parentheses: select col1 from thetable where (my_plpgsql_fn(col2)).id_num = 123; as indeed is documented here: http://www.postgresql.org/docs/8.3/static/sql-expressions.html#AEN1679 There are messy syntactic reasons for requiring these parens, which I don't recall the details of at the moment ... regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера