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

From: Ken Tanzer <ken(dot)tanzer(at)gmail(dot)com>
To: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to assemble all fields of (any) view into a string?
Date: 2016-09-07 23:07:00
Message-ID: CAD3a31Wm_3pFvKCKixiU7r0jCBkb+9i3_G7JFrAj6RW+zfH6Wg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Sep 7, 2016 at 3:38 PM, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)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
*http://agency-software.org/ <http://agency-software.org/>*
*https://agency-software.org/demo/client
<https://agency-software.org/demo/client>*
ken(dot)tanzer(at)agency-software(dot)org
(253) 245-3801

Subscribe to the mailing list
<agency-general-request(at)lists(dot)sourceforge(dot)net?body=subscribe> to
learn more about AGENCY or
follow the discussion.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2016-09-07 23:08:41 Re: How to assemble all fields of (any) view into a string?
Previous Message Ken Tanzer 2016-09-07 23:03:26 Re: How to assemble all fields of (any) view into a string?