Restore from pg_dumpall

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Restore from pg_dumpall

Buorn, Yoway
Restore from pg_dumpall

I'm upgrading Gforge and the first sql file I tried to load gave me the following error:

--
--        Function to enforce consistency in task start/end dates
--
DROP FUNCTION projtask_insert_depend () CASCADE ;
ERROR:  parser: parse error at or near "CASCADE"

Can anyone point out to me what is wrong with this sql?  Thanks.


Yoway Buorn
Software Engineer
Imagery Systems Engineering

GENERAL DYNAMICS
Advanced Information Systems

"Cockfighting has always been my idea of a great sport two armed entrées battling to see who'll be dinner." -- P.J. O'Rourke


Reply | Threaded
Open this post in threaded view
|

Re: Restore from pg_dumpall

Jeff Frost
Yoway,

What are you upgrading from/to?  Can you share your dump and restore command
line as well?

On Fri, 5 Aug 2005, Buorn, Yoway wrote:

> I'm upgrading Gforge and the first sql file I tried to load gave me the following error:

--
Jeff Frost, Owner <[hidden email]>
Frost Consulting, LLC http://www.frostconsultingllc.com/
Phone: 650-780-7908 FAX: 650-649-1954

---------------------------(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
Reply | Threaded
Open this post in threaded view
|

Re: Restore from pg_dumpall

Tom Lane-2
In reply to this post by Buorn, Yoway
"Buorn, Yoway" <[hidden email]> writes:
> I'm upgrading Gforge and the first sql file I tried to load gave me the =
> following error:

> DROP FUNCTION projtask_insert_depend () CASCADE ;
> ERROR:  parser: parse error at or near "CASCADE"

> Can anyone point out to me what is wrong with this sql?  Thanks.

Nothing ... in any PG version newer than 7.3 or so.  Are you trying
to back-port a dump into an older server version, and if so why?

                        regards, tom lane

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

               http://archives.postgresql.org
Reply | Threaded
Open this post in threaded view
|

Re: Restore from pg_dumpall

Buorn, Yoway
In reply to this post by Buorn, Yoway
>From: Jeff Frost [mailto:[hidden email]]
>What are you upgrading from/to?  Can you share your dump and restore
command line as well?

I am upgrading from Gforge 3.0b1 to Gforge 4.5.0.1.

Unfortunately, I don't have the dump and restore in my buffer, but I ran
"pg_dumpall > backup.dump" and then I tried to upgrade Gforge and I got
errors, so I freaked out and decided to restore before trying again.  I
then ran "pg_restore -c backup.dump" and it told me the file wasn't an
archive so it wouldn't restore.

>From: Tom Lane
>Nothing ... in any PG version newer than 7.3 or so.  Are you trying to
back-port a dump into an older
>server version, and if so why?

I don't think I'm back-porting a dump.  I don't even know what that
means exactly.  All I want to do is upgrade to Gforge 4.5.0.1.  However,
I *feel* I jacked up the DB in the process, so now I just want to
restore from my dump and then try upgrading again.  Thanks for all your
help guys.

---------------------------(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
Reply | Threaded
Open this post in threaded view
|

Re: Restore from pg_dumpall

Jeff Frost
On Mon, 8 Aug 2005, Buorn, Yoway wrote:

> Unfortunately, I don't have the dump and restore in my buffer, but I ran
> "pg_dumpall > backup.dump" and then I tried to upgrade Gforge and I got
> errors, so I freaked out and decided to restore before trying again.  I
> then ran "pg_restore -c backup.dump" and it told me the file wasn't an
> archive so it wouldn't restore.

There's your problem (or at least one of them).  The pg_dumpall outputs
straight SQL to stdout to recreate all DBs.  To restore this, you would just
do the following:

psql template1 < backup.dump

pg_restore is looking for one of the other output formats (tar or custom).

--
Jeff Frost, Owner <[hidden email]>
Frost Consulting, LLC http://www.frostconsultingllc.com/
Phone: 650-780-7908 FAX: 650-649-1954

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [hidden email] so that your
       message can get through to the mailing list cleanly