On Mon, Oct 31, 2011 at 03:56, Jun Omae <[email protected]> wrote:
>> So it looks like the quoting is necessary at least in some cases. Could
>> this be a 8.x vs. 9.x thing with PostgreSQL?
>
> Hmm, I uses PostgreSQL 8.1.23. The backup test failed without [10864].
> I'll test with other versions later.

I've tested with PostgreSQL 8.4 and it needs quoting with 8.4.
Because it seems the -n (--schema) option of pg_dump has changed
between 8.1 and 8.2.

 * 
https://raw.github.com/postgres/postgres/REL8_1_STABLE/src/bin/pg_dump/pg_dump.c
 * 
https://raw.github.com/postgres/postgres/REL8_2_STABLE/src/bin/pg_dump/pg_dump.c
 * 
https://raw.github.com/postgres/postgres/REL9_1_STABLE/src/bin/pg_dump/pg_dump.c

I think that we should check the version of pg_dump when dburi has
schema parameter and quote the schema if it is 8.2+.

The patch is pg_dump-schema-option-r10865.diff.


Log:
======

[root@ip-32 src]# psql -h 127.0.0.1 -U tracuser tractest
Password for user tracuser:
psql (8.4.9)
Type "help" for help.

tractest=> create schema "FooBar";
CREATE SCHEMA
tractest=> \q

[root@ip-32 src]# pg_dump --version
pg_dump (PostgreSQL) 8.4.9

[root@ip-32 src]# pg_dump -h 127.0.0.1 -n '"FooBar"' -Fc -f
tractest.dmp -U tracuser tractest
Password:

[root@ip-32 src]# pg_dump -h 127.0.0.1 -n 'FooBar' -Fc -f tractest.dmp
-U tracuser tractest
Password:
pg_dump: No matching schemas were found


-- 
Jun Omae <[email protected]> (大前 潤)

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en.

Attachment: pg_dump-schema-option-r10865.diff
Description: Binary data

Reply via email to