PLPGSQL function schema or table parameter

From: Sidnei de Souza <sidnei(at)cria(dot)org(dot)br>
To: pgsql-general(at)postgresql(dot)org
Subject: PLPGSQL function schema or table parameter
Date: 2005-09-05 17:26:31
Message-ID: 431C7FC7.3070508@cria.org.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is it possible to pass a table name and/or schema name to a plpgsql
function?
How can I use them in the code? Which Types to use for each of the
parameters?

E.g.

create or replace function MyTest (mySchema WhichType?, myTable
WhichType?) returns integer as '

declare result integer;

Begin
select id into result from mySchema.myTable where...
return result;
End;
' language plpgsql;

Sorry if this issue has already been addressed before but I can't find
any objective comments on this.
Thanks.
sidnei

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Browne 2005-09-05 17:48:32 Re: More statistics?
Previous Message Steve Atkins 2005-09-05 16:48:24 Re: remote connection, web hosting, IP adress