Re: tab_to_sting

From: Ramesh T <rameshparnanditech(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: tab_to_sting
Date: 2014-07-25 05:52:19
Message-ID: CAK8Zd=u6s-HGW1qEFSXTs0Up2+1e+uFkzCKeu=NNRnV0h8spWQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
when i ran below statement its working fine..
select string_agg(part_id::text,':') from part;
But,
SELECT tab_to_largeStringcheck(cast(string_agg(part_id::text,':')as
t_varchar2_tab)) FROM part

[image: Inline image 1]

when i ran like

SELECT
qa.tab_to_largeStringcheck(string_agg(part_id::text,':'))
FROM qa.part
its returnfunction( text)does'nt exist
let me know how solve issue..
thanks,

On Thu, Jul 24, 2014 at 10:42 PM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:

> On 07/24/2014 08:03 AM, Ramesh T wrote:
>
>> I have try
>> select string_agg(partname,':') from part_tab; its return same,
>>
>> ERROR: function string_agg(bigint, unknown) does not exist
>> LINE 1: select string_agg(part_id,':') from part;
>>
>
> Try:
>
> select string_agg(part_id::text,':') from part;
>
>
> ^
>> HINT: No function matches the given name and argument types. You might
>> need to add explicit type casts.
>>
>> i thought string_agg and array_agg same, is it right..?
>>
>
> No:
>
> http://www.postgresql.org/docs/9.3/static/functions-aggregate.html
>
> array_agg(expression) any array of the argument type input
> values, including nulls, concatenated into an array
>
> string_agg(expression, delimiter) (text, text) or (bytea, bytea)
> same as argument types input values concatenated into a string, separated
> by delimiter
>
>
>>
>>
>>
>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message hubert depesz lubaczewski 2014-07-25 14:43:22 Re: event triggers in 9.3.4
Previous Message Mike Christensen 2014-07-24 21:05:12 Re: Regular expression question with Postgres