Re: tab_to_sting - Mailing list pgsql-general

From Adrian Klaver
Subject Re: tab_to_sting
Date
Msg-id 53D122E8.7010307@aklaver.com
Whole thread Raw
In response to tab_to_sting  (Ramesh T <rameshparnanditech@gmail.com>)
List pgsql-general
On 07/24/2014 07:46 AM, Ramesh T wrote:
> i ran the \df string_agg is their
>
> but retuns like
> ERROR:  function string_agg(character varying) does not exist
> LINE 2: qa.tab_to_largestringcheck(cast(string_agg(part_num)as t_var...

I should have explained what is going on here.

If you do:

production=# \df string_agg
                             List of functions
    Schema   |    Name    | Result data type | Argument data types | Type
------------+------------+------------------+---------------------+------
  pg_catalog | string_agg | bytea            | bytea, bytea        | agg
  pg_catalog | string_agg | text             | text, text          | agg
(2 rows)

you see that there are two variations of string_agg, one that accepts
text, text and the other that accepts bytea, bytea as input. When you
ran your function it was passing in a single character varying input to
string_agg. This is not a supported string_agg variation, so Postgres
reports it does not exist in that form. See the HINT below.

>                                          ^
> HINT:  No function matches the given name and argument types. You might
> need to add explicit type casts.
>
>
>

--
Adrian Klaver
adrian.klaver@aklaver.com


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: tab_to_sting
Next
From: Ramesh T
Date:
Subject: Re: tab_to_sting