pg_dump -t and mixed case table names

Started by Tina Messmannalmost 24 years ago3 messagesgeneral
Jump to latest
#1Tina Messmann
tina.messmann@xinux.de

hello List,
i have a cuple of tables with mixed cased names.
I want to dump the schema from these tables (not from the whole database)
with pg_dump, but it's not working for me :(

Example:

test=# \d "TestTable"
Table "TestTable"
Column | Type | Modifiers
--------+---------------+-----------
id | integer |
name | character(10) |

Now i want to dump the schema from only this table:
postgres@trill:~$ pg_dump -s -t "TestTable" test
--
-- Selected TOC Entries:
--
postgres@trill:~$

Is it impossible to dump a table whose name is mixed cased with the -t
option?
Do i have to rename the table to lower case names to do this?
Why can i create a table with a mixed case name and then it is not
possible to dump it?
(with the -t option, when dumping the whole database, it's no problem)
Am i missing something?

My system: Debian Woody - postgresql 7.2.1 (debian package)

Regards
Tina

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tina Messmann (#1)
Re: pg_dump -t and mixed case table names

Tina Messmann <tina.messmann@xinux.de> writes:

postgres@trill:~$ pg_dump -s -t "TestTable" test

The shell ate your quote marks. Try

pg_dump -s -t '"TestTable"' test

regards, tom lane

#3Tina Messmann
tina.messmann@xinux.de
In reply to: Tina Messmann (#1)
Re: pg_dump -t and mixed case table names

Tom Lane wrote:

Tina Messmann <tina.messmann@xinux.de> writes:

postgres@trill:~$ pg_dump -s -t "TestTable" test

The shell ate your quote marks. Try

pg_dump -s -t '"TestTable"' test

regards, tom lane

This works. Thank you.
tina