Re: SET TABLESPACE ... NOWAIT - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: SET TABLESPACE ... NOWAIT
Date
Msg-id 5452D0E4.7030609@fuzzy.cz
Whole thread Raw
In response to Re: SET TABLESPACE ... NOWAIT  (David G Johnston <david.g.johnston@gmail.com>)
List pgsql-hackers
On 30.10.2014 23:19, David G Johnston wrote:
> Tomas Vondra wrote
>> Also, the current phrasing "If the NOWAIT option is specified then
>> the command will fail if it is unable to acquire all of the locks
>> required immediately." seems a bit ambiguous to me. Maybe it's just
>> me, but I wasn't sure if that means "locks for all objects
>> immediately, before actually starting moving them to the new
>> tablespace", and I had to check to code that I understand it
>> correctly. But maybe that's just me and it's unambiguous to
>> everyone else. Well, it would be really strange if it behaved
>> differently ...
> 
> If you weren't sure that it meant "locks for all objects [first]..."
> what did you think it could have meant instead?
> 
> NOWAIT semantics seem fairly straight-forward in that at no point do
> I want to wait to get a lock so unless I can get all my locks right 
> now give up and let me try again when I am ready. Once you have all
> the locks feel free to do your thing cause the locks you hold will
> prevent you from having to wait for someone else during your
> processing (aside from resource contention anyways).
> 
> Note from the ALTER TABLE documentation section:
> 
> "All tables in the current database in a tablespace can be moved by
> using the ALL IN TABLESPACE form, which will lock all tables to be
> moved first and then move each one."
> 
> This immediately precedes the comment about NOWAIT so there is not 
> need to reason things out...

EINSUFFICIENTCAFFEINE I guess ... I was already in slighly confused mode
because of something else, and apparently I skipped the sentence about
locking all the tables first.

So nevermind, let's forget this ever happened, OK?

Tomas



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: TAP test breakage on MacOS X
Next
From: Andres Freund
Date:
Subject: Re: TAP test breakage on MacOS X