Re: PL/PGSQL function with parameters

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: David Richter <D(dot)Richter(at)DKFZ(dot)de>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: PL/PGSQL function with parameters
Date: 2001-02-05 16:00:49
Message-ID: web-1186645@davinci.ethosmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Mr. Richter,

> I wrote that function, wich doesn't work. I want to hand
> over the name
> of the tables(relation_table, update_table) and a
> column(column_to_fill). The intention is, to use the
> function also with
> other tables(not hard coded).

1. Try using type VARCHAR instead of TEXT for the
parameters. PL/pgSQL may be objecting to the "undefined"
size of TEXT.

2. I don't believe that you can supply variables in the
place of object names in PL/pgSQL, only in place of values.
Thus, "SELECT * FROM table_name" would be invalid.
(Jan, please tall me if I'm wrong in this; I could really
use the functionality if it *is* possible.)
You could use some creative manipulation of the system
tables to achieve the same result, however.

-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh(at)agliodbs(dot)com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Mathieu Dube 2001-02-05 16:07:44 1024 limit???
Previous Message Michael Davis 2001-02-05 15:28:43 RE: C function for use from PLpgSQL trigger