RETURNS SETOF table; language 'sql' - Mailing list pgsql-sql

From Mario Splivalo
Subject RETURNS SETOF table; language 'sql'
Date
Msg-id 1131549050.7758.11.camel@ekim
Whole thread Raw
Responses Re: RETURNS SETOF table; language 'sql'
List pgsql-sql
When I issue something like this:

SELECT * FROM ads WHERE id=1004;

i get:
id  | vpn_id | service_id | ignore_length |       start_time       |
end_time        |          ad_text

------+--------+------------+---------------+------------------------+------------------------+----------------------------1004
|     1 |        106 | f             | 2005-01-01 00:00:00+01 |
 
2005-12-31 00:00:00+01 | Probna reklama numera una!


Now, I create a function that does that:

CREATE FUNCTION get_ads(int4)
RETURNS SETOF ads
AS
'SELECT * FROM ads WHERE id=$1'
LANGUAGE 'sql'

When I do:

SELECT * FROM get_ads(1004);

i get:

ERROR:  query-specified return row and actual function return row do not
match

Why is that?
Mike

P.S. That's run on Postgres 7.4.
-- 
Mario Splivalo
Mob-Art
mario.splivalo@mobart.hr

"I can do it quick, I can do it cheap, I can do it well. Pick any two."




pgsql-sql by date:

Previous
From: "Mauricio Fernandez A."
Date:
Subject: Re: Como ejecutar una funcion insert en plpgsql....
Next
From: Tom Lane
Date:
Subject: Re: RETURNS SETOF table; language 'sql'