Home > Archive > PostgreSQL Administration > August 2005 > Restore from pg_dumpall









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Restore from pg_dumpall
Buorn, Yoway

2005-08-05, 8:24 pm

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_depe
nd () 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



Jeff Frost

2005-08-06, 3:23 am

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 < jeff@frostconsulting
llc.com>
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

Tom Lane

2005-08-06, 3:23 am

"Buorn, Yoway" <Yoway.Buorn@gd-ais.com> writes:
> I'm upgrading Gforge and the first sql file I tried to load gave me the =
> following error:


> DROP FUNCTION projtask_insert_depe
nd () 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

Buorn, Yoway

2005-08-08, 1:24 pm

>From: Jeff Frost & #91;mailto:jeff@fros
tconsultingllc.com]
>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

Jeff Frost

2005-08-08, 8:25 pm

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 < jeff@frostconsulting
llc.com>
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 majordomo@postgresql
.org so that your
message can get through to the mailing list cleanly

Buorn, Yoway

2005-08-16, 1:26 pm

No, I'm not trying to back-port a dump. I simply followed the
instructions in the section 2.3.4 of the gforge manual which tells me to
go into the db/ folder and apply the schema changes in order for all sql
files dated after the existing installation. So I started with
20050312.sql and it gave me this parse error near "CASCADE".

You mention there's nothing wrong with this. Does this mean the message
is not really an error and I can safely ignore it?

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Friday, August 05, 2005 9:24 PM
To: Buorn, Yoway
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Restore from pg_dumpall

"Buorn, Yoway" <Yoway.Buorn@gd-ais.com> writes:
> I'm upgrading Gforge and the first sql file I tried to load gave me
> the = following error:


> DROP FUNCTION projtask_insert_depe
nd () 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 5: don't forget to increase your free space map settings

Alvaro Herrera

2005-08-16, 1:26 pm

On Tue, Aug 16, 2005 at 08:55:30AM -0700, Buorn, Yoway wrote:
> No, I'm not trying to back-port a dump. I simply followed the
> instructions in the section 2.3.4 of the gforge manual which tells me to
> go into the db/ folder and apply the schema changes in order for all sql
> files dated after the existing installation. So I started with
> 20050312.sql and it gave me this parse error near "CASCADE".
>
> You mention there's nothing wrong with this. Does this mean the message
> is not really an error and I can safely ignore it?


Not at all. What server version are you using? You can find out by
issuing

SELECT version();

--
Alvaro Herrera (<alvherre[a]alvh.no-ip.org> )
One man's impedance mismatch is another man's layer of abstraction.
(Lincoln Yeoh)

---------------------------(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

Tom Lane

2005-08-16, 8:24 pm

"Buorn, Yoway" <Yoway.Buorn@gd-ais.com> writes:
> No, I'm not trying to back-port a dump. I simply followed the
> instructions in the section 2.3.4 of the gforge manual which tells me to
> go into the db/ folder and apply the schema changes in order for all sql
> files dated after the existing installation. So I started with
> 20050312.sql and it gave me this parse error near "CASCADE".


> You mention there's nothing wrong with this. Does this mean the message
> is not really an error and I can safely ignore it?


What that probably means is that you need a newer version of Postgres
before trying to install gforge. It would seem that you have PG 7.2 or
before. I don't know what gforge's minimum requirement for PG version
is, but certainly 7.2 is pretty ancient.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com