Re: WIP: Covering + unique indexes. - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: WIP: Covering + unique indexes.
Date
Msg-id CAB7nPqQa4HZ8QZaYB5zVWkYv6TFpBgY7QtemyRuJ2AJhbcNOUQ@mail.gmail.com
Whole thread Raw
In response to Re: WIP: Covering + unique indexes.  (Anastasia Lubennikova <a.lubennikova@postgrespro.ru>)
Responses Re: WIP: Covering + unique indexes.  (Anastasia Lubennikova <a.lubennikova@postgrespro.ru>)
List pgsql-hackers
On Wed, Mar 2, 2016 at 2:10 AM, Anastasia Lubennikova
<a.lubennikova@postgrespro.ru> wrote:
> 01.03.2016 19:55, Anastasia Lubennikova:
>> It is not the final version, because it breaks pg_dump for previous
>> versions. I need some help from hackers here.
>> pgdump. line 5466
>> if (fout->remoteVersion >= 90400)
>>
>> What does 'remoteVersion' mean? And what is the right way to change it? Or
>> it changes between releases?
>> I guess that 90400 is for 9.4 and 80200 is for 8.2 but is it really so?
>> That is totally new to me.

Yes, you got it. That's basically PG_VERSION_NUM as compiled on the
server that has been queried, in this case the server from which a
dump is taken. If you are changing the system catalog layer, you would
need to provide a query at least equivalent to what has been done
until now for your patch, the modify pg_dump as follows:
if (fout->remoteVersion >= 90600)
{   query = my_new_query;
}
else if (fout->remoteVersion >= 90400)
{   query = the existing 9.4 query
}
etc.

In short you just need to add a new block so as remote servers newer
than 9.6 will be able to dump objects correctly. pg_upgrade is a good
way to check the validity of pg_dump actually, this explains why some
objects are not dropped in the regression tests. Perhaps you'd want to
do the same with your patch if the current test coverage of pg_dump is
not enough. I have not looked at your patch so I cannot say for sure.
-- 
Michael



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: TAP / recovery-test fs-level backups, psql enhancements etc
Next
From: David Fetter
Date:
Subject: Re: 2016-03 Commitfest Manager