Unix Technical Forum

BUG #1843: pg_restore -O restores lowercase schemanaam

This is a discussion on BUG #1843: pg_restore -O restores lowercase schemanaam within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 1843 Logged by: D.J. Kniep Email address: dick@kniep.nl PostgreSQL version: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 10:08 AM
D.J. Kniep
 
Posts: n/a
Default BUG #1843: pg_restore -O restores lowercase schemanaam


The following bug has been logged online:

Bug reference: 1843
Logged by: D.J. Kniep
Email address: dick@kniep.nl
PostgreSQL version: 7.4.8
Operating system: Linux (SuSE 9.3)
Description: pg_restore -O restores lowercase schemanaam
Details:

I make a backup using

pg_dump -f /tmp/dumpdb -F c -Z 5 cvix

When I try to restore this file, it fails with

postgres@linux:/tmp> pg_restore -O -d cvix2 /tmp/dumpdb
pg_restore: [archiver (db)] could not execute query: ERROR: schema "Lindix"

does not exist

After checking, the schema lindix does exist (Note the lowercase l), but is
empty.

If I turn on statement logging, I see the following when running
pg_restore -O:

CREATE SCHEMA Test;

If I run pg_restore without -O, I see the following:

CREATE SCHEMA "Test" AUTHORIZATION postgres;

Off course this should be
CREATE SCHEMA "Test";

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 10:08 AM
Tom Lane
 
Posts: n/a
Default Re: BUG #1843: pg_restore -O restores lowercase schemanaam

"D.J. Kniep" <dick@kniep.nl> writes:
> Description: pg_restore -O restores lowercase schemanaam


Thanks for the report. This bug seems to exist only in the 7.4 branch.
Applied patch is attached if you need it right away.

regards, tom lane

Index: src/bin/pg_dump/pg_backup_archiver.c
================================================== =================
RCS file: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v
retrieving revision 1.79.2.5
diff -c -r1.79.2.5 pg_backup_archiver.c
*** pg_backup_archiver.c 17 May 2005 17:30:53 -0000 1.79.2.5
--- pg_backup_archiver.c 25 Aug 2005 00:09:55 -0000
***************
*** 2256,2262 ****
*/
if (AH->ropt && AH->ropt->noOwner && strcmp(te->desc, "SCHEMA") == 0)
{
! ahprintf(AH, "CREATE SCHEMA %s;\n\n\n", te->tag);
}
else
{
--- 2256,2262 ----
*/
if (AH->ropt && AH->ropt->noOwner && strcmp(te->desc, "SCHEMA") == 0)
{
! ahprintf(AH, "CREATE SCHEMA %s;\n\n\n", fmtId(te->tag));
}
else
{

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:15 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com