Re: genbki.pl not quoting keywords in postgres.bki output

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: genbki.pl not quoting keywords in postgres.bki output
Дата
Msg-id 24788.1525542622@sss.pgh.pa.us
обсуждение исходный текст
Ответ на genbki.pl not quoting keywords in postgres.bki output  (Mark Dilger <hornschnorter@gmail.com>)
Список pgsql-hackers
Mark Dilger <hornschnorter@gmail.com> writes:
> There are not yet any examples in the postgres sources where this
> oversight causes problems, but in genbki.pl, where it makes the
> decision whether to quote a token: ...
> it should also quote anything that is a keyword, such as "open", as
> otherwise you get a syntax error during initdb.

Good point.  Up to now, I'd have written that off as one of the many
undocumented gotchas involved in construction of DATA lines.  However,
I think we've made a conscious effort in the bootstrap conversion work
to eliminate undocumented special cases, so we oughta do something to
make such cases work without extra hacking.

> This patch is not that complicated, but it does create a new coding
> requirement to keep bootparse.y and genbki.pl from getting out of sync.
> It might be simpler to just change genbki.pl to quote everything rather
> than applying this patch.  I don't have an opinion on that.

I don't like adding a lot of unnecessary quoting to the .bki file.

The patch as you have it isn't that awful from a maintenance perspective;
I don't think we've added new keywords to bootparse.y very often, so we
could surely cope with keeping genbki.pl in sync.

However, really this ought to be solved in bootparse.y itself, I think:
it should be possible to have it treat keywords like identifiers in INSERT
commands, just as (most) keywords aren't reserved in the main grammar.
Let me go poke at that idea.  If it doesn't work nicely I'll use your
patch.

            regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Python 3.7 support
Следующее
От: Shay Rojansky
Дата:
Сообщение: citext function overloads for text parameters