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