SQL Script - Mailing list pgsql-general

From Kevin Willems
Subject SQL Script
Date
Msg-id Hz4x6.1028$Tfq.8978590@tomcat.sk.sympatico.ca
Whole thread Raw
Responses Re: SQL Script
Re: SQL Script
List pgsql-general
I have written the following function but when I try to run it, I get Error:
ERROR:  parser: parse error at or near "". As you can see, there is no
instance of "" in my function. Does anyone have any idea why this is
happening?

CREATE FUNCTION dropifexists(text)
RETURNS text
AS 'DECLARE
   numcount integer;
   nameoftable text;
BEGIN
   nameoftable := lower($1);
   SELECT INTO numcount count(tablename)
   FROM pg_tables
   WHERE tablename = nameoftable;

   if numcount = 1
   then DROP TABLE nameoftable;
   end if;
   RETURN nameoftable;
END;'




pgsql-general by date:

Previous
From: Justin Clift
Date:
Subject: Need PostgreSQL startup scripts
Next
From: Carlos Felipe Zirbes
Date:
Subject: RE: Data access permission?