Re: ERROR: DROP TABLE is not allowed in a non-volatile function - Mailing list pgsql-novice

From Keith Worthington
Subject Re: ERROR: DROP TABLE is not allowed in a non-volatile function
Date
Msg-id 20050517184437.M25296@narrowpathinc.com
Whole thread Raw
In response to ERROR: DROP TABLE is not allowed in a non-volatile function  ("Alan T. Miller" <amiller@hollywood101.com>)
List pgsql-novice
On Tue, 17 May 2005 11:21:14 -0700, Alan T. Miller wrote
> I had written a function that would recreate a static table. The
> function called the "DROP TABLE" command and then proceeded to
> create the new table. This used to work fine until I upgraded the
> database server to 8.x. Now when I try to run the function I get the
> error message...
>
> ERROR:  DROP TABLE is not allowed in a non-volatile function
>
> What can I do now? Is there a way to redefine my function so that it
> is a "non-volatile" function? Tried to find more about this online
> with little luck. Please any suggestions would be welcome.
>
> Alan

Alan,

At the end of the function definition you may find a line that reads something
like:  LANGUAGE 'plpgsql' STABLE; simply change it to: LANGUAGE 'plpgsql'
VOLATILE;

Kind regards,
Keith

pgsql-novice by date:

Previous
From: "Alan T. Miller"
Date:
Subject: ERROR: DROP TABLE is not allowed in a non-volatile function
Next
From: Timo Roessner
Date:
Subject: cluster-operation successfull?