From: John Naylor <jcnaylor@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [RFC] Removing "magic" oids
Date: Thu, 15 Nov 2018 17:25:21 +0700
Message-ID: <CAJVSVGVepnvnYN2TRufCa+dZ-JhVKGo77rtgO2frz1tj+wriHQ@mail.gmail.com> (raw)
In-Reply-To: <20181115014807.kqhndjzbvdmkbkhv@alap3.anarazel.de>
References: <20180930034810.ywp2c7awz7opzcfr@alap3.anarazel.de>
<20181114080152.xkk6coduvfrh4ntr@alap3.anarazel.de>
<20181115014807.kqhndjzbvdmkbkhv@alap3.anarazel.de>
On 11/15/18, Andres Freund <andres@anarazel.de> wrote:
> I've now revised this slightly. genbki.pl now computes the maximum oid
> explicitly assigned in .dat files, and assignes oids to all 'oid'
> columns without a value. It does so starting directly at the maximum
> value. I personally don't see need to have implicit .bki oids be in a
> different range, and having them assigned more densely is good for some
> things (e.g. the fmgr builtins table, even though we currently assign
> all proc oids manually).
I don't see an advantage to having a different range, but maybe it
should error out if $maxoid reaches FirstBootstrapObjectId.
This patch breaks reformat_dat_file.pl. I've attached a fix, which
also de-lists oid as a special key within the *.dat files. It might be
good to put off reformatting until feature freeze, so as not to break
others' patches.
-John Naylor
Attachments:fix-reformat-dat-files.patch (text/x-patch, 935B) downloaddiff --git a/src/include/catalog/reformat_dat_file.pl b/src/include/catalog/reformat_dat_file.plindex ca20fb86da..14e561c168 100755--- a/src/include/catalog/reformat_dat_file.pl+++ b/src/include/catalog/reformat_dat_file.pl@@ -28,8 +28,7 @@ use Catalog;
# Names of the metadata fields of a catalog entry. (line_number is also
# a metadata field, but we never write it out, so it's not listed here.)
-my @METADATA =- ('oid', 'oid_symbol', 'array_type_oid', 'descr', 'autogenerated');+my @METADATA = ('oid_symbol', 'array_type_oid', 'descr', 'autogenerated');
my @input_files;
my $output_path = '';
@@ -193,7 +192,7 @@ sub strip_default_values
{
my $attname = $column->{name};
die "strip_default_values: $catname.$attname undefined\n"
- if !defined $row->{$attname};+ if !defined $row->{$attname} and $attname ne 'oid';
if (defined $column->{default}
and ($row->{$attname} eq $column->{default}))
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: jcnaylor@gmail.com, andres@anarazel.de
Subject: Re: [RFC] Removing "magic" oids
In-Reply-To: <CAJVSVGVepnvnYN2TRufCa+dZ-JhVKGo77rtgO2frz1tj+wriHQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox