Re: [ERROR] syntax error at end of input

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Marcelo de Moraes Serpa" <celoserpa(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [ERROR] syntax error at end of input
Date: 2007-08-27 15:35:06
Message-ID: 957.1188228906@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Marcelo de Moraes Serpa" <celoserpa(at)gmail(dot)com> writes:
> DROP FUNCTION IF EXISTS aNomeProcAudita;
> DROP TRIGGER IF EXISTS 'Audita_' || pTabAudit || '_trigger';

Neither of those match the documented syntax for the commands: you have
left off required information. Also, as Andreas noted, if you want to
construct a name dynamically then you have to use EXECUTE. The second
one should go something like

EXECUTE 'DROP TRIGGER IF EXISTS Audita_' || pTabAudit || '_trigger ON ' || tableName;

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message brian 2007-08-27 15:37:12 Re: Tables dissapearing
Previous Message Jonah H. Harris 2007-08-27 15:26:40 Re: [HACKERS] Undetected corruption of table files