Re: small cleanup: unify scanstr() functions

Поиск
Список
Период
Сортировка
От John Naylor
Тема Re: small cleanup: unify scanstr() functions
Дата
Msg-id CACPNZCsH30MhQGHO+NyfaAS1-_G9QN+zniHuQ1KT4h+uRo9K8A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: small cleanup: unify scanstr() functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: small cleanup: unify scanstr() functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Thu, Oct 1, 2020 at 11:19 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I'm unsure this topic is worth messing with.  But if we do so, I'd kind
> of like to move scanstr() out of parser/scansup.c.  Since it's not used
> by the core scanner, only bootstrap, it seems out of place there; and
> it's confusing because somebody coming across it for the first time
> would reasonably assume that it does have something to do with how
> we lex normal SQL strings.
>
> Of course, that just begs the question of where to put it instead.
> But since guc-file.l lives in utils/misc/, in or beside that file
> does not seem that awful.

A ringing endorsement if I ever heard one. ;-) Seems fine if it
remains in guc-file.l. Cosmetic considerations are

- The declaration in guc.h should fit in with code that's already
there. I put it next to the *Parse* functions.
- There seem to be a few unused headers included into bootscanner.l.
To keep "#include guc.h" from looking as strange as those, I added a
comment. It might be worth removing those extra includes, but that's
for another day.

> We might consider renaming it to something a shade less generic, too.
> I have no immediate suggestions on that score.

I've named it DeescapeQuotedString to see how that looks.

> In short: maybe instead of what you have here, leave GUC_scanstr()
> alone except for a possible rename; make bootscanner.l use that;
> and drop the now-unused scanstr().

v2 done that way.

-- 
John Naylor                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

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

Предыдущее
От: Andy Fan
Дата:
Сообщение: Improve choose_custom_plan for initial partition prune case
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Improving connection scalability: GetSnapshotData()