pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
problem on truncate for v.7.3.2
3+ messages / 3 participants
[nested] [flat]

* problem on truncate for v.7.3.2
@ 2003-02-20 05:45  jack <datactrl@tpg.com.au>
  0 siblings, 1 reply; 3+ messages in thread

From: jack @ 2003-02-20 05:45 UTC (permalink / raw)
  To: pgsql-sql

On version 7.3.2, 'truncate' can not be executed from pl/pgsql. But it isn't
stated on change notes. Is it a bug?

Jack




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: problem on truncate for v.7.3.2
@ 2003-02-20 06:14  Josh Berkus <josh@agliodbs.com>
  parent: jack <datactrl@tpg.com.au>
  0 siblings, 1 reply; 3+ messages in thread

From: Josh Berkus @ 2003-02-20 06:14 UTC (permalink / raw)
  To: jack <datactrl@tpg.com.au>; pgsql-sql

Jack,

> On version 7.3.2, 'truncate' can not be executed from pl/pgsql. But it
> isn't stated on change notes. Is it a bug?

No, it's a fix.   

TRUNCATE, VACUUM, ANALYZE, and REINDEX all perform COMMIT statements as part 
of their operation.   If called within a function, this could cause part of 
the function to be committed while the rest failed, or even cause a fatal 
error.   

As such, these statements have been deliberately disabled within PL/pgSQL and 
SQL functions.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: problem on truncate for v.7.3.2
@ 2003-02-20 15:13  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Josh Berkus <josh@agliodbs.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2003-02-20 15:13 UTC (permalink / raw)
  To: Josh Berkus <josh@agliodbs.com>; +Cc: jack <datactrl@tpg.com.au>; pgsql-sql

Josh Berkus <josh@agliodbs.com> writes:
>> On version 7.3.2, 'truncate' can not be executed from pl/pgsql. But it
>> isn't stated on change notes. Is it a bug?

> No, it's a fix.   

Note however that TRUNCATE has been reimplemented to be transaction-safe
in 7.4, and so the restriction has gone away again.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2003-02-20 15:13 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-02-20 05:45 problem on truncate for v.7.3.2 jack <datactrl@tpg.com.au>
2003-02-20 06:14 ` Josh Berkus <josh@agliodbs.com>
2003-02-20 15:13   ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox