Re: tab_to_sting - Mailing list pgsql-general

From Ramesh T
Subject Re: tab_to_sting
Date
Msg-id CAK8Zd=u6s-HGW1qEFSXTs0Up2+1e+uFkzCKeu=NNRnV0h8spWQ@mail.gmail.com
Whole thread Raw
In response to Re: tab_to_sting  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: tab_to_sting  (David G Johnston <david.g.johnston@gmail.com>)
List 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


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.klaver@aklaver.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.klaver@aklaver.com

Attachment

pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: Checkpoint_segments optimal value
Next
From: Sergiy Zuban
Date:
Subject: Re: postgres_fdw - push down conditionals for ENUMs