X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 87BCB9DCAA3 for ; Thu, 9 Mar 2006 09:35:50 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 63948-08 for ; Thu, 9 Mar 2006 09:35:53 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 494D99DC853 for ; Thu, 9 Mar 2006 09:35:48 -0400 (AST) Received: from coral.mweb.co.za (coral.mweb.co.za [196.2.50.72]) by svr4.postgresql.org (Postfix) with ESMTP id 7547D5AF069 for ; Thu, 9 Mar 2006 13:35:51 +0000 (GMT) Received: from coral.mweb.co.za (localhost.localdomain [127.0.0.1]) by pwfilter01.mweb.co.za (Postfix) with ESMTP id 600994990E for ; Thu, 9 Mar 2006 15:35:46 +0200 (SAST) Received: from MWS40 (unknown [196.2.63.104]) by coral.mweb.co.za (Postfix) with ESMTP id 45B504903F for ; Thu, 9 Mar 2006 15:35:46 +0200 (SAST) From: "Klay Martens" To: pgsql-sql@postgresql.org Message-ID: Date: Thu, 09 Mar 2006 15:35:45 +0200 X-Priority: 3 MIME-Version: 1.0 Content-type: text/html; charset=Windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: ClamAV using ClamSMTP X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.859 required=5 tests=[HTML_MESSAGE=0.001, HTML_MIME_NO_HTML_TAG=0.512, MIME_HTML_ONLY=0.001, MISSING_SUBJECT=1.345] X-Spam-Score: 1.859 X-Spam-Level: * X-Archive-Number: 200603/133 X-Sequence-Number: 24479

Hi all=2E=

I am new to postgres, so I = am still learning the basics=2E

In Sequel Server, one can s= et up a function to return a table eg:

 

CREATE FUNCTION [dbo]=2E[Au= thCodes] (@CLIENTID INT) 

RETURNS @AuthCodes TABLE

(

 &nbs= p;          [ID] INT,

 &nbs= p;          AUTHCOD= E VARCHAR(100),

 &nbs= p;          ISSUEDA= TE DATETIME,

 &nbs= p;          ISSUEDB= Y VARCHAR(100),

 &nbs= p;          RECIPIE= NT VARCHAR(100),

 &nbs= p;          EMAILID VARCHAR(100)   

)

 

and then use select into or= insert to populate the table=2E

I am really battling to fig= ure out how to do the same in a postgres function=2E

It seems like one would hav= e to create a user defined type (myType for eg), and then set the return type of the = function to be a set of myType, but I can=92t seem to make it work=2E I am guess= ing that I am on the wrong track=85does anyone have any suggestions, or examples I= could follow?