Thread: truncate problem

truncate problem

From
"frank_lupo"
Date:
I change to 7.3.2 database postgresql from 7.2.2 version.
I am using cygwin:
PostgreSQL 7.3.2 on i686-pc-cygwin, compiled by GCC gcc (GCC) 3.2 20020927 (prerelease)

In 7.2.2 I created a function using the instruction TRUNCATE TABLE inside and it works well.

When I try to call the same function in 7.3.2, I receive the following message:
ERROR:  TRUNCATE TABLE cannot be executed from a function.

Thank you for the help





Bye !!
Frank Lupo (Wolf) !!

       /\_ _/\
       \ o o /
--ooo-----ooo---





--
Prendi GRATIS l'email universale che... risparmia: http://www.email.it/f

Sponsor:
Oro, argento, diamanti e pietre preziose: una miniera di meraviglie.
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=772&d=20-2

Re: truncate problem

From
Neil Conway
Date:
On Thu, 2003-02-20 at 05:20, frank_lupo wrote:
> In 7.2.2 I created a function using the instruction TRUNCATE TABLE inside and it works well.
>
> When I try to call the same function in 7.3.2, I receive the following message:

It was never a good idea to use TRUNCATE inside a function -- you were
living dangerously using it inside one in 7.2. The only change in 7.3
TRUNCATE is no longer allowed.

Note that in current sources (and therefore in 7.4 when it's been
released), Rod Taylor has improved the TRUNCATE implementation to be
transaction-safe, so the restriction has been lifted.

Cheers,

Neil
--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC