X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 592F4D9D20 for ; Wed, 9 Nov 2005 14:21:48 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 21278-07 for ; Wed, 9 Nov 2005 18:21:46 +0000 (GMT) X-Greylist: delayed 03:10:53.248046 by SQLgrey- Received: from svr2.postgresql.org (svr2.postgresql.org [65.19.161.25]) by svr1.postgresql.org (Postfix) with ESMTP id E3FEDD99E9 for ; Wed, 9 Nov 2005 14:21:46 -0400 (AST) Received: from pjetlic.mobart.hr (pjetlic.mobart.hr [80.80.51.10]) by svr2.postgresql.org (Postfix) with ESMTP id 2895AF0E19 for ; Wed, 9 Nov 2005 15:10:58 +0000 (GMT) Received: from localhost (localhost.localdomain [127.0.0.1]) by pjetlic.mobart.hr (Postfix) with ESMTP id 2976017A5F for ; Wed, 9 Nov 2005 16:10:50 +0100 (CET) Received: from pjetlic.mobart.hr ([127.0.0.1]) by localhost (pjetlic [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 07215-03-3 for ; Wed, 9 Nov 2005 16:10:50 +0100 (CET) Received: from mike.mobart.hr (mike.mobart.hr [192.168.10.94]) (using SSLv3 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by pjetlic.mobart.hr (Postfix) with ESMTP id 1018C17A30 for ; Wed, 9 Nov 2005 16:10:50 +0100 (CET) Subject: RETURNS SETOF table; language 'sql' From: Mario Splivalo Reply-To: mario.splivalo@mobart.hr To: pgsql-sql@postgresql.org Content-Type: text/plain Organization: Mob-Art Date: Wed, 09 Nov 2005 16:10:50 +0100 Message-Id: <1131549050.7758.11.camel@ekim> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by OpenSource AV+AS Mail Server X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.003 required=5 tests=[AWL=0.003] X-Spam-Score: 0.003 X-Spam-Level: X-Archive-Number: 200511/78 X-Sequence-Number: 23329 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."