Re: [GENERAL] Possible FAQs: single-quote and rename database

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [GENERAL] Possible FAQs: single-quote and rename database
Дата
Msg-id 199912231150.GAA27645@candle.pha.pa.us
обсуждение исходный текст
Ответ на Possible FAQs: single-quote and rename database  ("Nathan L. Cutler" <livingston@iol.cz>)
Список pgsql-general
> Hello:
>
> I have two questions that might be FAQs (apologies in advance):
>
> (1) Why does the parser choke on backslashed single-quote characters?  Or,
> in other words, why doesn't this work:
>
> testing=> \d bubba
> Table    = bubba
> +--------------------------+----------------------------------+-------+
> |          Field           |              Type                | Length|
> +--------------------------+----------------------------------+-------+
> | litbub                   | varchar()                        | 60    |
> +--------------------------+----------------------------------+-------+
> testing=> insert '\'' into bubba;
> ERROR:  parser: parse error at or near "'"

INSERT INTO bubba VALUES ('\'');

>
> (2) How does one rename a database?  Other than dump/destroydb/restore,
> obviously.

I think you can modify pg_database with new name, stop postmaster,
rename database directory, and restart.  Not sure, but that may work.

--
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [GENERAL] Interbase replacement
Следующее
От: David Warnock
Дата:
Сообщение: Re: [GENERAL] Interbase replacement