Writing SQL functions in Postgres

From: Boulat Khakimov <boulat(at)inet-interactif(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Writing SQL functions in Postgres
Date: 2001-03-08 16:44:04
Message-ID: 3AA7B6D4.C8BD7DB@inet-interactif.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I want to write an SQL function in postgres that returns
row as a result.

The problem is the select statement inside the funtion has
a two table join. So I dont know what to put after SETOF

CREATE FUNCTION dummy()
RETURNS SETOF ?????
AS 'select a.name,b.cc
from tblusers a,
tbldocs b
where a.name=b.name'
LANGUAGE 'SQL';

SETOF tblusers -- doesnt work
ERROR: function declared to return type tblusers does not retrieve
(tblusers.*)

neither does SETOF tbldocs

SETOF tblusers,tbldocs wont work either.

Anyone was able to returns a row that is a result of few table joins
inside the
function???

Regards,
Boulat Khakimov


--
Nothing Like the Sun

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Frank Joerdens 2001-03-08 16:51:26 Re: Re: How to drop an <unnamed> trigger
Previous Message Frank Joerdens 2001-03-08 16:06:29 Re: How to drop an <unnamed> trigger