Re: pgsql: Fix pg_dumpall with database names containing =

Поиск
Список
Период
Сортировка
От Thom Brown
Тема Re: pgsql: Fix pg_dumpall with database names containing =
Дата
Msg-id CAA-aLv5ZECCtzuBVWW8oB5yN0GCxFSNb9Eb1Onqj40fFxTRnxA@mail.gmail.com
обсуждение исходный текст
Ответ на pgsql: Fix pg_dumpall with database names containing =  (Heikki Linnakangas <heikki.linnakangas@iki.fi>)
Ответы Re: pgsql: Fix pg_dumpall with database names containing =  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Список pgsql-committers
On 20 February 2013 15:14, Heikki Linnakangas <heikki.linnakangas@iki.fi> wrote:
> Fix pg_dumpall with database names containing =
>
> If a database name contained a '=' character, pg_dumpall failed. The problem
> was in the way pg_dumpall passes the database name to pg_dump on the
> command line. If it contained a '=' character, pg_dump would interpret it
> as a libpq connection string instead of a plain database name.
>
> To fix, pass the database name to pg_dump as a connection string,
> "dbname=foo", with the database name escaped if necessary.
>
> Back-patch to all supported branches.

I also notice that if you create a database with an "=" in, you can't
connect to it using psql.

thom@swift ~/Development/postgresql $ psql "8=8"
psql: invalid connection option "8"
thom@swift ~/Development/postgresql $ psql -d "8=8"
psql: invalid connection option "8"
thom@swift ~/Development/postgresql $ psql --dbname="8=8"
psql: invalid connection option "8"
thom@swift ~/Development/postgresql $ psql -d '8=8'
psql: invalid connection option "8"
thom@swift ~/Development/postgresql $ psql postgres
Expanded display is used automatically.
psql (9.3devel)
Type "help" for help.

postgres=# \c "8=8"
invalid connection option "8"
Previous connection kept
postgres=# \c 8=8
invalid connection option "8"
Previous connection kept

--
Thom


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: doc: Fix markup typo
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: pgsql: Fix pg_dumpall with database names containing =