Unix Technical Forum

dropdb lock

This is a discussion on dropdb lock within the pgsql Hackers forums, part of the PostgreSQL category; --> In dbcommands.c::dropdb() there are these lines: /* Close pg_database, but keep exclusive lock till commit */ heap_close(pgdbrel, NoLock); However, ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-11-2008, 06:53 AM
Andrew Dunstan
 
Posts: n/a
Default dropdb lock



In dbcommands.c::dropdb() there are these lines:

/* Close pg_database, but keep exclusive lock till commit */
heap_close(pgdbrel, NoLock);

However, ISTM that if I return early from that function because the db
doesn't exist I should release the lock immediately. Or is there
something I have missed? Is that the only cleanup I would need for the
IF EXISTS case (looks like it to me)?

cheers

andrew

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-11-2008, 06:53 AM
Tom Lane
 
Posts: n/a
Default Re: dropdb lock

Andrew Dunstan <andrew@dunslane.net> writes:
> In dbcommands.c::dropdb() there are these lines:


> /* Close pg_database, but keep exclusive lock till commit */
> heap_close(pgdbrel, NoLock);


> However, ISTM that if I return early from that function because the db
> doesn't exist I should release the lock immediately. Or is there
> something I have missed?


Should be OK to drop the lock if you didn't change anything. OTOH, it
probably doesn't matter much since we don't allow dropdb inside a
transaction block; commit is going to happen shortly anyhow.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:21 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com