Обсуждение: 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
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@frostconsultingllc.com> Frost Consulting, LLC http://www.frostconsultingllc.com/ Phone: 650-780-7908 FAX: 650-649-1954
"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_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
>From: Jeff Frost [mailto:jeff@frostconsultingllc.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.
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@frostconsultingllc.com> Frost Consulting, LLC http://www.frostconsultingllc.com/ Phone: 650-780-7908 FAX: 650-649-1954
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_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
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)
"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