Re: How to assemble all fields of (any) view into a string?

Поиск
Список
Период
Сортировка
От Ken Tanzer
Тема Re: How to assemble all fields of (any) view into a string?
Дата
Msg-id CAD3a31Wm_3pFvKCKixiU7r0jCBkb+9i3_G7JFrAj6RW+zfH6Wg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to assemble all fields of (any) view into a string?  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Ответы Re: How to assemble all fields of (any) view into a string?  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Список pgsql-general

On Wed, Sep 7, 2016 at 3:38 PM, Jim Nasby <Jim.Nasby@bluetreble.com> wrote:
On 9/7/16 5:32 PM, Ken Tanzer wrote:
SELECT my_cat(ebh_gain,'ebh_gain') FROM ebh_gain;

I know TCL and probably Python and others can work with a record as a
trigger function.  But TCL doesn't seem to accept a record as an
argument.  Can any of the other languages that could also accomplish
this function? Or some other way? Thanks.

A PL that can accept composite types (such as plpythonu) should be able to do this.

OK, python is new to me, so I'm trying to dig into it.  I installed it, and tried declaring a function:

CREATE OR REPLACE FUNCTION ebh_transaction_assemble( varchar, record ) RETURNS varchar AS $$...

but got the same error:

ERROR:  PL/Python functions cannot accept type record

Is there some other way I should be specifying this?  Or do I need a more recent version of Postgres (I'm on 9.2) to do this?  Thanks.

 

--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)   mobile: 512-569-9461



--
AGENCY Software  
A Free Software data system
By and for non-profits
(253) 245-3801

learn more about AGENCY or
follow the discussion.

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

Предыдущее
От: Ken Tanzer
Дата:
Сообщение: Re: How to assemble all fields of (any) view into a string?
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: How to assemble all fields of (any) view into a string?