From: | Richard Huxton <dev(at)archonet(dot)com> |
---|---|
To: | Jason Tesser <jtesser(at)nbbc(dot)edu> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: 2 questions about types |
Date: | 2005-03-16 16:36:14 |
Message-ID: | 4238607E.8010704@archonet.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Jason Tesser wrote:
> <snip>
>
>>There's an example in the manuals - chapter "7.2.1.4. Table Functions"
>>
>>SELECT *
>> FROM dblink('dbname=mydb', 'select proname, prosrc from pg_proc')
>> AS t1(proname name, prosrc text)
>> WHERE proname LIKE 'bytea%';
>>
>>So basically, you need to supply the type definitions in your SELECT if
>>you aren't going to supply it in the function definition.
>
>
> ok I tried to rewrite as follows but I get an error that says "a column
> definition list is required fro functions returning record
Because you didn't supply the type definitions in your SELECT...
> here is my function and call for it now
> CREATE OR REPLACE FUNCTION "public"."loginbyindidgettest" (integer)
> RETURNS SETOF "pg_catalog"."record" AS'
...
> select * from loginbyindidgettest(43650);
This needs to be something like:
SELECT * FROM loginbyindidgettest(43650) AS myres(a int, b text, c
date, ...)
Obviously, the types need to match the results of your function.
--
Richard Huxton
Archonet Ltd
From | Date | Subject | |
---|---|---|---|
Next Message | Marco Colombo | 2005-03-16 16:52:02 | Re: New user: Windows, Postgresql, Python |
Previous Message | Jason Tesser | 2005-03-16 16:05:15 | Re: 2 questions about types |