use of Function - Mailing list pgsql-general

From Uro Gruber
Subject use of Function
Date
Msg-id 1088978510.20010604174858@sir-mag.com
Whole thread Raw
In response to Re: 7.1.2 packaging  (teg@redhat.com (Trond Eivind Glomsrød))
List pgsql-general
Hi!

Here is my problem.

I  have  one  table  with  some data and i want to make some
function.

This  function  must  do  some  data  reordering  and delete
something and then return some data.

I make almost everything exept returning data. I want return
five filelds of row and not just text.

I call this function like

SELECT myfunction(argument)

and  when  i call this it delete some data, then i calculate
some  values  and  update  it.  And  then  i  want  outpu to
something like this.

Id      |   date    |  name    | status
00304   |  24.06.01 | mike     |  new

CREATE function myfunction(string) RETURNS text
                                           ^^^^
                                           how  can  i  tell
here  to  return  like  int,datetime,varchar,varchar.  Is it
possible to use return SET or something.

Now  i  have  solution like function return me id and then i
use normal select to get this data. But i would like to have
only one function to do this.

Any sugestions.


thanks, Uros


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: upgrading a database with large objects
Next
From: Martín Marqués
Date:
Subject: Re: datestyle