pg_dump: Simplify internal archive version handling

Started by Peter Eisentrautover 9 years ago3 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

I propose the attached patch to clean up some redundancy and confusion
in pg_dump.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachments:

0001-pg_dump-Simplify-internal-archive-version-handling.patchtext/x-patch; name=0001-pg_dump-Simplify-internal-archive-version-handling.patchDownload+53-56
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#1)
Re: pg_dump: Simplify internal archive version handling

Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:

I propose the attached patch to clean up some redundancy and confusion
in pg_dump.

Looks sane, though I'd suggest coding the access macros with shifts
not multiplies/divides.

Since these numbers are purely internal and not stored in this form in the
file, I wonder whether we shouldn't drop the rightmost zero byte, ie make
it just <maj><min><rev> not <maj><min><rev>00. That would save at least
one divide/shift when accessing.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#2)
Re: pg_dump: Simplify internal archive version handling

On 10/13/16 9:13 AM, Tom Lane wrote:

Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:

I propose the attached patch to clean up some redundancy and confusion
in pg_dump.

Looks sane, though I'd suggest coding the access macros with shifts
not multiplies/divides.

Done.

Since these numbers are purely internal and not stored in this form in the
file, I wonder whether we shouldn't drop the rightmost zero byte, ie make
it just <maj><min><rev> not <maj><min><rev>00. That would save at least
one divide/shift when accessing.

Done and committed. Thanks.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers