public inbox for [email protected]
help / color / mirror / Atom feedpg_dump -t broken for mixed case table names in beta3?
5+ messages / 3 participants
[nested] [flat]
* pg_dump -t broken for mixed case table names in beta3?
@ 2006-11-28 19:27 Kevin Grittner <[email protected]>
2006-11-28 19:43 ` Re: pg_dump -t broken for mixed case table names in beta3? Tom Lane <[email protected]>
0 siblings, 1 reply; 5+ messages in thread
From: Kevin Grittner @ 2006-11-28 19:27 UTC (permalink / raw)
To: [email protected]
Unless I'm missing something, pg_dump is not allowing selective dump of
a table where the table name is mixed case. The -t switch still works
for lower case. Even though quotes weren't previously needed on the
pg_dump command line, I tried that with no better luck.
postgres@DTR3:~> psql dtr
Welcome to psql 8.2beta3, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
dtr=# \d "DbTranLogRecord"
Table "public.DbTranLogRecord"
Column | Type | Modifiers
----------------+-------------------+-----------
countyNo | "CountyNoT" | not null
tranImageSeqNo | "TranImageSeqNoT" | not null
logRecordSeqNo | "LogRecordSeqNoT" | not null
operation | "OperationT" | not null
tableName | "TableNameT" | not null
Indexes:
"DbTranLogRecordPK" PRIMARY KEY, btree ("countyNo",
"tranImageSeqNo", "logRecordSeqNo")
"DbTranLogRecord_tableName" btree ("countyNo", "tableName",
operation)
dtr=# \q
postgres@DTR3:~> pg_dump -s -t DbTranLogRecord dtr
pg_dump: No matching tables were found
postgres@DTR3:~>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: pg_dump -t broken for mixed case table names in beta3?
2006-11-28 19:27 pg_dump -t broken for mixed case table names in beta3? Kevin Grittner <[email protected]>
@ 2006-11-28 19:43 ` Tom Lane <[email protected]>
2006-11-28 19:49 ` Re: pg_dump -t broken for mixed case table names in Kevin Grittner <[email protected]>
2006-11-28 22:51 ` Re: [HACKERS] pg_dump -t broken for mixed case table names in beta3? David Fetter <[email protected]>
0 siblings, 2 replies; 5+ messages in thread
From: Tom Lane @ 2006-11-28 19:43 UTC (permalink / raw)
To: Kevin Grittner <[email protected]>; +Cc: [email protected]
"Kevin Grittner" <[email protected]> writes:
> Unless I'm missing something, pg_dump is not allowing selective dump of
> a table where the table name is mixed case.
You do it like this:
$ pg_dump -s -t '"DbTranLogRecord"' dtr
A bit ugly but the conflict between shell and SQL quoting rules
sometimes forces us into compromises :-(
Perhaps it's worth having an example for this in the pg_dump man page?
regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: pg_dump -t broken for mixed case table names in
2006-11-28 19:27 pg_dump -t broken for mixed case table names in beta3? Kevin Grittner <[email protected]>
2006-11-28 19:43 ` Re: pg_dump -t broken for mixed case table names in beta3? Tom Lane <[email protected]>
@ 2006-11-28 19:49 ` Kevin Grittner <[email protected]>
1 sibling, 0 replies; 5+ messages in thread
From: Kevin Grittner @ 2006-11-28 19:49 UTC (permalink / raw)
To: Tom Lane <[email protected]>; +Cc: [email protected]
Thanks much; it might have been a while before I tried that nested
quoting technique. I think it's worth documenting. Would you like me
to try to put a doc patch together, or would it be better for someone
else to do so?
-Kevin
>>> Tom Lane <[email protected]> 11/28/06 1:43 PM >>>
"Kevin Grittner" <[email protected]> writes:
> Unless I'm missing something, pg_dump is not allowing selective dump
of
> a table where the table name is mixed case.
You do it like this:
$ pg_dump - s - t '"DbTranLogRecord"' dtr
A bit ugly but the conflict between shell and SQL quoting rules
sometimes forces us into compromises :- (
Perhaps it's worth having an example for this in the pg_dump man page?
regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [HACKERS] pg_dump -t broken for mixed case table names in beta3?
2006-11-28 19:27 pg_dump -t broken for mixed case table names in beta3? Kevin Grittner <[email protected]>
2006-11-28 19:43 ` Re: pg_dump -t broken for mixed case table names in beta3? Tom Lane <[email protected]>
@ 2006-11-28 22:51 ` David Fetter <[email protected]>
2006-11-28 22:54 ` Re: [HACKERS] pg_dump -t broken for mixed case table names in beta3? Tom Lane <[email protected]>
1 sibling, 1 reply; 5+ messages in thread
From: David Fetter @ 2006-11-28 22:51 UTC (permalink / raw)
To: Tom Lane <[email protected]>; +Cc: Kevin Grittner <[email protected]>; [email protected]; PostgreSQL Patches <[email protected]>; pgsql-docs
On Tue, Nov 28, 2006 at 02:43:17PM -0500, Tom Lane wrote:
> "Kevin Grittner" <[email protected]> writes:
> > Unless I'm missing something, pg_dump is not allowing selective dump of
> > a table where the table name is mixed case.
>
> You do it like this:
>
> $ pg_dump -s -t '"DbTranLogRecord"' dtr
>
> A bit ugly but the conflict between shell and SQL quoting rules
> sometimes forces us into compromises :-(
>
> Perhaps it's worth having an example for this in the pg_dump man page?
Please find enclosed a patch which adds this :)
Cheers,
D
--
David Fetter <[email protected]> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter
Remember to vote!
Index: doc/src/sgml/ref/pg_dump.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/pg_dump.sgml,v
retrieving revision 1.91
diff -c -r1.91 pg_dump.sgml
*** doc/src/sgml/ref/pg_dump.sgml 23 Oct 2006 18:10:32 -0000 1.91
--- doc/src/sgml/ref/pg_dump.sgml 28 Nov 2006 22:50:15 -0000
***************
*** 805,810 ****
--- 805,818 ----
</para>
<para>
+ To dump a single table named <literal>camelCaseTable</>:
+
+ <screen>
+ <prompt>$</prompt> <userinput>pg_dump -t '"camelCaseTable"' mydb > db.sql</userinput>
+ </screen>
+ </para>
+
+ <para>
To dump all tables whose names start with <literal>emp</> in the
<literal>detroit</> schema, except for the table named
<literal>employee_log</literal>:
Attachments:
[text/plain] pg_dump_camel_case_example.patch (800B, 2-pg_dump_camel_case_example.patch)
download | inline diff:
Index: doc/src/sgml/ref/pg_dump.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/pg_dump.sgml,v
retrieving revision 1.91
diff -c -r1.91 pg_dump.sgml
*** doc/src/sgml/ref/pg_dump.sgml 23 Oct 2006 18:10:32 -0000 1.91
--- doc/src/sgml/ref/pg_dump.sgml 28 Nov 2006 22:50:15 -0000
***************
*** 805,810 ****
--- 805,818 ----
</para>
<para>
+ To dump a single table named <literal>camelCaseTable</>:
+
+ <screen>
+ <prompt>$</prompt> <userinput>pg_dump -t '"camelCaseTable"' mydb > db.sql</userinput>
+ </screen>
+ </para>
+
+ <para>
To dump all tables whose names start with <literal>emp</> in the
<literal>detroit</> schema, except for the table named
<literal>employee_log</literal>:
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [HACKERS] pg_dump -t broken for mixed case table names in beta3?
2006-11-28 19:27 pg_dump -t broken for mixed case table names in beta3? Kevin Grittner <[email protected]>
2006-11-28 19:43 ` Re: pg_dump -t broken for mixed case table names in beta3? Tom Lane <[email protected]>
2006-11-28 22:51 ` Re: [HACKERS] pg_dump -t broken for mixed case table names in beta3? David Fetter <[email protected]>
@ 2006-11-28 22:54 ` Tom Lane <[email protected]>
0 siblings, 0 replies; 5+ messages in thread
From: Tom Lane @ 2006-11-28 22:54 UTC (permalink / raw)
To: David Fetter <[email protected]>; +Cc: Kevin Grittner <[email protected]>; [email protected]; PostgreSQL Patches <[email protected]>; pgsql-docs
David Fetter <[email protected]> writes:
> On Tue, Nov 28, 2006 at 02:43:17PM -0500, Tom Lane wrote:
>> Perhaps it's worth having an example for this in the pg_dump man page?
> Please find enclosed a patch which adds this :)
Already done, thanks.
regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2006-11-28 22:54 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-11-28 19:27 pg_dump -t broken for mixed case table names in beta3? Kevin Grittner <[email protected]>
2006-11-28 19:43 ` Tom Lane <[email protected]>
2006-11-28 19:49 ` Re: pg_dump -t broken for mixed case table names in Kevin Grittner <[email protected]>
2006-11-28 22:51 ` David Fetter <[email protected]>
2006-11-28 22:54 ` Tom Lane <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox