Re: [ERROR] syntax error at end of input - Mailing list pgsql-general

From Tom Lane
Subject Re: [ERROR] syntax error at end of input
Date
Msg-id 957.1188228906@sss.pgh.pa.us
Whole thread Raw
In response to [ERROR] syntax error at end of input  ("Marcelo de Moraes Serpa" <celoserpa@gmail.com>)
List pgsql-general
"Marcelo de Moraes Serpa" <celoserpa@gmail.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

pgsql-general by date:

Previous
From: "Jonah H. Harris"
Date:
Subject: Re: [HACKERS] Undetected corruption of table files
Next
From: brian
Date:
Subject: Re: Tables dissapearing