From: | Mario Splivalo <mario(dot)splivalo(at)mobart(dot)hr> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | RETURNS SETOF table; language 'sql' |
Date: | 2005-11-09 15:10:50 |
Message-ID: | 1131549050.7758.11.camel@ekim |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(dot)splivalo(at)mobart(dot)hr
"I can do it quick, I can do it cheap, I can do it well. Pick any two."
From | Date | Subject | |
---|---|---|---|
Next Message | Zack Chandler | 2005-11-09 16:14:36 | Re: Design question: Scalability and tens of thousands of |
Previous Message | Fernando Garcia | 2005-11-09 14:22:27 | Como ejecutar una funcion insert en plpgsql.... |