Re: function to update different tables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Lars Eckberg" <le(at)eckbergconsulting(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: function to update different tables
Date: 2004-11-08 02:08:11
Message-ID: 26018.1099879691@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"Lars Eckberg" <le(at)eckbergconsulting(dot)com> writes:
> I'm trying to create a function, where the first parameter will be the
> tablename to update.

There is no way to do that in an SQL-language function. If you use
plpgsql then it's possible to construct an SQL command as a string
(ie, concatenate the constant parts with the table name) and then
execute it with an EXECUTE statement.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2004-11-08 04:05:22 Re: function parse error
Previous Message padma k 2004-11-07 15:39:20 How do I unsubscribe to Group ?