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

From Marco Craveiro
Subject Re: Problems with stored procedure (function)
Date
Msg-id d23da9a0912190619n30e845c0w1a6968f56ad221c4@mail.gmail.com
Whole thread Raw
In response to Re: Problems with stored procedure (function)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
Tom,

This is indeed the answer to my problem, thanks very much. Any newbie
googling for an answer to this question may also be interested in the
following series of articles:

QUICK GUIDE TO WRITING PLPGSQL FUNCTIONS:

Part 1:
http://www.postgresonline.com/journal/index.php?/archives/58-Quick-Guide-to-writing-PLPGSQL-Functions-Part-1.html
Part 2:
http://www.postgresonline.com/journal/index.php?/archives/76-Quick-Guide-to-writing-PLPGSQL-Functions-Part-2.html
Part 3:
http://www.postgresonline.com/journal/index.php?/archives/83-Quick-Guide-to-writing-PLPGSQL-Functions-Part-3-NOTICES,-RECURSION,-and-more.html

Thanks

Marco

On 18/12/2009, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 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
>


--
It's the golden rule: those who have the gold, rule. -- Gerald Celente

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Problems with stored procedure (function)
Next
From: lists@kambanaria.org
Date:
Subject: How to use a db in UTF-8 encoding under Windows