Re: A couple of issues with psql variable substitution

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: A couple of issues with psql variable substitution
Дата
Msg-id 23537.1314306779@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: A couple of issues with psql variable substitution  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: A couple of issues with psql variable substitution  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
While I'm looking at this ... the current implementation has got a
number of very inconsistent behaviors with respect to when it will
expand a variable reference within a psql meta-command argument.
Observe:

regression=# \set foo 'value of foo'
regression=# \set bar 'value of bar'
regression=# \echo :foo
value of foo
regression=# \echo :foo@bar
value of foo @bar

(there shouldn't be a space before the @, IMO --- there is because this
gets treated as two separate arguments, which seems bizarre)

regression=# \echo :foo:bar
value of foo value of bar

(again, why is this two arguments not one?)

regression=# \echo :foo@:bar
value of foo @:bar

(why isn't :bar expanded here, when it is in the previous case?)

regression=# \echo foo:foo@:bar
foo:foo@:bar

(and now neither one gets expanded)

ISTM the general rule ought to be that we attempt to substitute for a
colon-construct regardless of where it appears within an argument, as
long as it's not within quotes.

Thoughts?
        regards, tom lane


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

Предыдущее
От: "Tomas Vondra"
Дата:
Сообщение: PATCH: regular logging of checkpoint progress
Следующее
От: Robert Haas
Дата:
Сообщение: Re: A couple of issues with psql variable substitution