Re: TG_TABLE_NAME as identifier

From: Richard Huxton <dev(at)archonet(dot)com>
To: Tiziano Slack <slack83(at)hotmail(dot)it>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: TG_TABLE_NAME as identifier
Date: 2008-02-05 09:32:50
Message-ID: 47A82D42.8070007@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Tiziano Slack wrote:
> Hello everybody! I'm newbie to plpgsql syntax. Can anyone tell where
> I'm getting wrong?

> INSERT INTO TG_TABLE_NAME SELECT NEW.*;

If you need to build a dynamic query with plpgsql you'll need to
assemble it as a string and use EXECUTE. You can use variables in
comparisons etc. but not as column-names or table-names.

You might want to look at pltcl or plperl etc. if you are going to be
doing a lot of this sort of stuff.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Robins Tharakan 2008-02-05 10:07:31 Re: TG_TABLE_NAME as identifier
Previous Message Tiziano Slack 2008-02-05 08:45:14 TG_TABLE_NAME as identifier