Re: Move bki file pre-processing from initdb - part 1 - initdb->genbki.pl

Поиск
Список
Период
Сортировка
От John Naylor
Тема Re: Move bki file pre-processing from initdb - part 1 - initdb->genbki.pl
Дата
Msg-id CANWCAZa7J8cqSrz-q0YXfZOMcKvCeP-6ZRFQzu4iDu6bsRHYBQ@mail.gmail.com
обсуждение исходный текст
Ответ на Move bki file pre-processing from initdb - part 1 - initdb->genbki.pl  (Krishnakumar R <kksrcv001@gmail.com>)
Список pgsql-hackers
On Mon, Dec 4, 2023 at 5:03 PM Krishnakumar R <kksrcv001@gmail.com> wrote:
>
> Hi,
>
> As per discussion in [1] splitting the patch. Part1 moves replacement
> logic in initdb of  NAMEDATALEN, FLOAT8PASSBYVAL, SIZEOF_VOID_P,
> ALIGNOF_POINTER to compile time via genbki.pl.

Hi Krishnakumar,

Note this comment in genbki.pl:

# Fetch some special data that we will substitute into the output file.
# CAUTION: be wary about what symbols you substitute into the .bki file here!
# It's okay to substitute things that are expected to be really constant
# within a given Postgres release, such as fixed OIDs.  Do not substitute
# anything that could depend on platform or configuration.  (The right place
# to handle those sorts of things is in initdb.c's bootstrap_template1().)

The premise of this patch is to invalidate this comment, so we need to
show that it's not needed any more. With commit 721856ff24 to remove
distprep, the biggest obstacle is out of the way, I think. If all else
goes well, this comment will need to be removed.

Also some cosmetic review:

+my $include_conf;

This is referring to a path, a different one than the include path. I
suggest "config_path" or something like that. Since the script now
uses both paths, I wonder if we can just call them "source" and
"build" paths...

+ if ($row{attnotnull} eq 't' && ($row{attlen} eq 'NAMEDATALEN'))
+ {
+ $row{attlen} = $NameDataLen;
+ }

The check for $row{attnotnull} must be a copy-paste-o.

+my $Float8PassByVal=$SizeOfPointer >= 8 ? "true": "false";

This is copied from the C source, but it's spelled 't' / 'f' in the
bki file, so I'm mildly astonished it still seems to work.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: Emitting JSON to file using COPY TO
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Which parts of src/backend/nodes/print.c are used?