pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mario Splivalo <mario.splivalo@mobart.hr>
To: pgsql-sql@postgresql.org
Subject: RETURNS SETOF table; language 'sql'
Date: Wed, 09 Nov 2005 16:10:50 +0100
Message-ID: <1131549050.7758.11.camel@ekim> (raw)

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."





view thread (6+ messages)  latest in thread

Message-ID: <1131549050.7758.11.camel@ekim>
Permalink:  ../1131549050.7758.11.camel@ekim/
Also on:    postgresql.org/message-id/1131549050.7758.11.camel@ekim

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mario.splivalo@mobart.hr
  Subject: Re: RETURNS SETOF table; language 'sql'
  In-Reply-To: <1131549050.7758.11.camel@ekim>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox