Unix Technical Forum

Hmmm 8.1 pg_dumpall cannot dump older db's?

This is a discussion on Hmmm 8.1 pg_dumpall cannot dump older db's? within the pgsql Hackers forums, part of the PostgreSQL category; --> I can't seem to dump old db's: -bash-2.05b$ pg_dumpall -s -h database-dev > dump.sql Password: pg_dumpall: could not connect ...


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-11-2008, 05:47 AM
Christopher Kings-Lynne
 
Posts: n/a
Default Hmmm 8.1 pg_dumpall cannot dump older db's?

I can't seem to dump old db's:

-bash-2.05b$ pg_dumpall -s -h database-dev > dump.sql
Password:
pg_dumpall: could not connect to database "postgres": FATAL: database
"postgres" does not exist

Seems that it is expecting the new 'postgres' database to exist on old
installations?

Chris


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-11-2008, 05:47 AM
Tom Lane
 
Posts: n/a
Default Re: Hmmm 8.1 pg_dumpall cannot dump older db's?

Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> Seems that it is expecting the new 'postgres' database to exist on old
> installations?


Ooops :-( Seems like maybe we want it to try postgres and then fall
back to trying template1?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-11-2008, 05:47 AM
Christopher Kings-Lynne
 
Posts: n/a
Default Re: Hmmm 8.1 pg_dumpall cannot dump older db's?

>>Seems that it is expecting the new 'postgres' database to exist on old
>>installations?

>
> Ooops :-( Seems like maybe we want it to try postgres and then fall
> back to trying template1?


Actually, also ONLY assume postgres is a special database if the backend
is 8.1 or higher. We don't want to mess with poor people who have
already created a database called 'postgres' in their installation of
7.4, say...

Chris


---------------------------(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
  #4 (permalink)  
Old 04-11-2008, 05:47 AM
Christopher Kings-Lynne
 
Posts: n/a
Default Re: Hmmm 8.1 pg_dumpall cannot dump older db's?

>>Seems that it is expecting the new 'postgres' database to exist on old
>>installations?

>
> Ooops :-( Seems like maybe we want it to try postgres and then fall
> back to trying template1?


No idea I haven't followed the new postgres database changes
particularly well...

Chris


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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-11-2008, 05:47 AM
Tom Lane
 
Posts: n/a
Default Re: Hmmm 8.1 pg_dumpall cannot dump older db's?

Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
>> Ooops :-( Seems like maybe we want it to try postgres and then fall
>> back to trying template1?


> Actually, also ONLY assume postgres is a special database if the backend
> is 8.1 or higher. We don't want to mess with poor people who have
> already created a database called 'postgres' in their installation of
> 7.4, say...


No, because it's special anyway where the dump will be reloaded. Keep
in mind that the design assumption for pg_dump(all) is always that the
destination database will be current release or higher; frequently the
dump file won't even be parseable by older servers.

The thing that makes this slightly painful is that we can't tell what
version we are dumping *from* until we've connected, and so we cannot
automagically "do the right thing" here. I don't really see any other
way to do it than the try-and-fallback approach.

regards, tom lane

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-11-2008, 05:47 AM
Bruno Wolff III
 
Posts: n/a
Default Re: Hmmm 8.1 pg_dumpall cannot dump older db's?

On Thu, Jul 07, 2005 at 23:44:44 -0400,
Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> The thing that makes this slightly painful is that we can't tell what
> version we are dumping *from* until we've connected, and so we cannot
> automagically "do the right thing" here. I don't really see any other
> way to do it than the try-and-fallback approach.


But after falling back to template1, a version check could be made and
if running 8.1 or higher an error message could be displayed.

---------------------------(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
  #7 (permalink)  
Old 04-11-2008, 05:47 AM
Tom Lane
 
Posts: n/a
Default Re: Hmmm 8.1 pg_dumpall cannot dump older db's?

Bruno Wolff III <bruno@wolff.to> writes:
> But after falling back to template1, a version check could be made and
> if running 8.1 or higher an error message could be displayed.


Once we're connected to template1, we might as well just use it ...

regards, tom lane

---------------------------(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
  #8 (permalink)  
Old 04-11-2008, 05:47 AM
Andrew Dunstan
 
Posts: n/a
Default Re: Hmmm 8.1 pg_dumpall cannot dump older db's?



Tom Lane wrote:

>Bruno Wolff III <bruno@wolff.to> writes:
>
>
>>But after falling back to template1, a version check could be made and
>>if running 8.1 or higher an error message could be displayed.
>>
>>

>
>Once we're connected to template1, we might as well just use it ...
>
>
>
>

Agreed. In any case, I thought that dropping the postgres database was
supposed to be OK if you wanted to work that way. (I also thought
fallback was the way all this was supposed to work anyway).

cheers

andrew

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

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 06:23 AM.


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