Hi all!

I've been working on implementing a custom index using the Index Access Method 
API and have the need for custom reloptions that 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 around the 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.



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to