pg_get_indexdef() doesn't quote string reloptions

Поиск
Список
Период
Сортировка
От Eric Ridge
Тема pg_get_indexdef() doesn't quote string reloptions
Дата
Msg-id 5D265224-30B2-4A1E-811E-E4F60E21FA45@tcdi.com
обсуждение исходный текст
Ответы Re: pg_get_indexdef() doesn't quote string reloptions
Re: pg_get_indexdef() doesn't quote string reloptions
Список pgsql-hackers
Hi all!

I've been working on implementing a custom index using the Index Access Method API and have the need for custom
reloptionsthat are "complex" strings (ie, also contain non-alphaumerics). 

pg_get_indexdef() and pg_dump don't quote the reloption values, making a restore (or cut-n-paste of the
pg_get_indexdef()output) impossible if the reloption value contains non-alphanumerics. 

For example, the statement:
# CREATE INDEX idxfoo ON table USING myindex (col) WITH (option = 'some complex string');

cannot be restored as it gets rewritten as:
CREATE INDEX idxfoo ON table USING myindex (col) WITH (option = some complex string);    (note the lack of quotes
aroundthe option value) 

Looks like (at least) ruleutils.c:flatten_reloptions() needs to be smarter.

eric




PROPRIETARY AND COMPANY CONFIDENTIAL COMMUNICATIONS
The information contained in this communication is intended only for
the use of the addressee. Any other use is strictly prohibited.
Please notify the sender if you have received this message in error.
This communication is protected by applicable legal privileges and is
company confidential.




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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [PATCH] PostgreSQL 9.4 mmap(2) performance regression on FreeBSD...
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: jsonb generator functions