Re: Problems with stored procedure (function) - Mailing list pgsql-novice

From Tom Lane
Subject Re: Problems with stored procedure (function)
Date
Msg-id 9952.1261164800@sss.pgh.pa.us
Whole thread Raw
In response to Problems with stored procedure (function)  (Marco Craveiro <marco.craveiro@gmail.com>)
Responses Re: Problems with stored procedure (function)  (Marco Craveiro <marco.craveiro@gmail.com>)
List pgsql-novice
Marco Craveiro <marco.craveiro@gmail.com> writes:
> The problem I have is my function keeps on returning a single column
> with the name of the function, rather than something akin to the table
> I've defined:

> sanzala=# select load_country();
>     load_country
> --------------------
>  (a,"b ","c  ",123)
> (1 row)

Yes, because that's what that syntax says to do: return one
composite-type column.  The easiest way to expand it is

    select * from load_country();

            regards, tom lane

pgsql-novice by date:

Previous
From: Marco Craveiro
Date:
Subject: Problems with stored procedure (function)
Next
From: Marco Craveiro
Date:
Subject: Re: Problems with stored procedure (function)