pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
VACUUM and locking
2+ messages / 2 participants
[nested] [flat]

* VACUUM and locking
@ 2002-10-25 14:36  Denise Bossarte <mypostgreSQL@hotmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Denise Bossarte @ 2002-10-25 14:36 UTC (permalink / raw)
  To: pgsql-sql

I am trying to automate VACUUMing several databases and am confused on how
client connections to the database might affect the VACUUM.

I have looked at the documentation on locking and VACUUM and have found
conflicting reports.

The 7.2.1 Documentation
http://www.postgresql.org/idocs/index.php?locking-tables.html states that
VACUUM (without FULL) acquires a ShareUpdateExclusiveLock and VACUUM with
FULL acquires an AcessExclusiveLock.

However, the 7.2.1 Appendix A. Release Notes state "Vacuuming no longer
locks tables, thus allowing normal user access during the vacuum. A new
VACUUM FULL command does old-style vacuum by locking the table and shrinking
the on-disk copy of the table."  Additionally, the "Transaction Processing
in Postgres" pdf http://developer.postgresql.org/pdf/transactions.pdf only
shows AcessExclusiveLock acquird by VACUUM (full? - not stated) (p. 18).

So which, if any, locks does VACUUM acquire?  How do client connections to
the database affect the VACUUM? What is the best way to automate VACUUM?

Thanks for your help,

Denise







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

* Re: VACUUM and locking
@ 2002-10-28 18:39  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Denise Bossarte <mypostgreSQL@hotmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2002-10-28 18:39 UTC (permalink / raw)
  To: Denise Bossarte <mypostgreSQL@hotmail.com>; +Cc: pgsql-sql

"Denise Bossarte" <mypostgreSQL@hotmail.com> writes:
> I have looked at the documentation on locking and VACUUM and have found
> conflicting reports.

> http://www.postgresql.org/idocs/index.php?locking-tables.html states that
> VACUUM (without FULL) acquires a ShareUpdateExclusiveLock and VACUUM with
> FULL acquires an AcessExclusiveLock.

This is correct.

> However, the 7.2.1 Appendix A. Release Notes state "Vacuuming no longer
> locks tables, thus allowing normal user access during the vacuum. A new
> VACUUM FULL command does old-style vacuum by locking the table and shrinking
> the on-disk copy of the table.

This is an oversimplification, as it says "lock" where it means
AccessExclusiveLock.

> Additionally, the "Transaction Processing
> in Postgres" pdf http://developer.postgresql.org/pdf/transactions.pdf only
> shows AcessExclusiveLock acquird by VACUUM (full? - not stated) (p. 18).

This document is pre-7.2.

			regards, tom lane



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


end of thread, other threads:[~2002-10-28 18:39 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-10-25 14:36 VACUUM and locking Denise Bossarte <mypostgreSQL@hotmail.com>
2002-10-28 18:39 ` 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