Re: about truncate - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: about truncate
Date
Msg-id 49771C55.8040102@dunslane.net
Whole thread Raw
In response to Re: about truncate  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: about truncate
List pgsql-hackers

Peter Eisentraut wrote:
> Andrew Dunstan wrote:
>> It's just occurred to me that if TRUNCATE no longer means TRUNCATE ONLY,
>> parallel restore will need to detect which server version is being 
>> used so that for version > 8.3 it issues TRUNCATE ONLY.
>
> The pg_dump output was never backward compatible.  (The input is.)  So 
> the output of parallel restore need not be backward compatible either. 
> (Unless this mandate has changed dramatically while I was not 
> looking?)  So always issue TRUNCATE ONLY, if that is what the logic 
> requires. The additional benefit is that this will fail safely on 
> older versions.
>

No it won't fail safely on older versions, because the truncate is part 
of a transaction, and thus the data member(s) will all fail. I'd like to 
be able to use 8.4 pg_restore to run parallel restores on older servers, 
and the fix for this is utterly trivial. I'll be posting a new patch 
with it in today.

(If we can't or don't want to make it work with older servers, I will 
create an out-of-tree patch for 8.3 that does, and put it on pgFoundry. 
But that would be a pity.)

cheers

andrew


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: rmgr hooks (v2)
Next
From: Andrew Chernow
Date:
Subject: Re: libpq WSACleanup is not needed