dbTalk Databases Forums  

[BUGS] [7.4beta3] pg_dump -t xxx won't output sequences

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] [7.4beta3] pg_dump -t xxx won't output sequences in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tomas Szepe
 
Posts: n/a

Default [BUGS] [7.4beta3] pg_dump -t xxx won't output sequences - 09-27-2003 , 06:52 AM






Hi,

Not sure if this is a bug, but still.
Compare:

<cut>

pgsql7.3.4$ pg_dump -a -t seq_wtmp db1
--
-- PostgreSQL database dump
--

\connect - kala

SET search_path = public, pg_catalog;

--
-- TOC entry 1 (OID 800427)
-- Name: seq_wtmp; Type: SEQUENCE SET; Schema: public; Owner: kala
--

SELECT pg_catalog.setval ('seq_wtmp', 3928, true);

<cut>

pgsql7.4beta3$ pg_dump -a -t seq_wtmp db1
pg_dump: specified table "seq_wtmp" does not exist

<cut>

seq_wtmp is a perfectly normal sequence.

Bye,
--
Tomas Szepe <szepe (AT) pinerecords (DOT) com>

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] [7.4beta3] pg_dump -t xxx won't output sequences - 09-27-2003 , 01:25 PM






Tomas Szepe <szepe (AT) pinerecords (DOT) com> writes:
Quote:
Not sure if this is a bug, but still.

pgsql7.3.4$ pg_dump -a -t seq_wtmp db1
[ works ]

pgsql7.4beta3$ pg_dump -a -t seq_wtmp db1
pg_dump: specified table "seq_wtmp" does not exist
Looking at the CVS history, I see that Neil added code to deliberately
reject this case, but I don't understand why.

/*
* If the user is attempting to dump a specific table, check to ensure
* that the specified table actually exists (and is a table or a view,
* not a sequence).
*/
if (selectTableName)
{
for (i = 0; i < ntups; i++)
if (strcmp(tblinfo[i].relname, selectTableName) == 0 &&
tblinfo[i].relkind != 'S')
break;

Neil, what's the reason not to allow dumping just a sequence?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
  #3  
Old   
Neil Conway
 
Posts: n/a

Default Re: [BUGS] [7.4beta3] pg_dump -t xxx won't output sequences - 09-27-2003 , 04:36 PM



On Sat, 2003-09-27 at 14:23, Tom Lane wrote:
Quote:
/*
* If the user is attempting to dump a specific table, check to ensure
* that the specified table actually exists (and is a table or a view,
* not a sequence).
*/
if (selectTableName)
{
for (i = 0; i < ntups; i++)
if (strcmp(tblinfo[i].relname, selectTableName) == 0 &&
tblinfo[i].relkind != 'S')
break;

Neil, what's the reason not to allow dumping just a sequence?
Good question. I can't see a good reason not to allow it, and I can't
recall my original reason for including that code. Please go ahead and
revert it (or let me know and I'll submit a patch myself).

Sorry about that.

-Neil



---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.