Re: PL/PGSQL function with parameters - Mailing list pgsql-sql

From Josh Berkus
Subject Re: PL/PGSQL function with parameters
Date
Msg-id web-1186645@davinci.ethosmedia.com
Whole thread Raw
In response to PL/PGSQL function with parameters  (David Richter <D.Richter@DKFZ.de>)
List 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
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


pgsql-sql by date:

Previous
From: Franck Martin
Date:
Subject: Re: [HACKERS] BLOB HOWTO??
Next
From: Michael Davis
Date:
Subject: RE: Hrm...why is this wrong?