Re:pg_dump barfs?

From: Chris Bitmead <chris(dot)bitmead(at)bigfoot(dot)com>
To: pgsql-hackers(at)hub(dot)org
Subject: Re:pg_dump barfs?
Date: 1999-05-07 04:54:51
Message-ID: 3732721B.7A5F6BF3@bigfoot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

I'm trying to dump and restore my database which is a 6.5 May 2nd
snapshot, but psql is barfing on pg_dump's output. Naturally I find that
quite disturbing! I'd like to find out how I can salvage my data,
because right now I havn't got a way of backing it up properly. pg_dump
-D |psql can re-insert my data, but with the loss of oids, and my schema
relies on oids. If anyone wants the full pg_dump data let me know.
pg_dump -o |psql results in the errors.....

The first one, it looks

COPY "urllink" WITH OIDS FROM stdin;
ERROR: pg_atoi: error in "http://www.photogs.com/bwworld/f5.html":
can't parse
"http://www.photogs.com/bwworld/f5.html"
PQendcopy: resetting connection

This was caused by the following input
COPY "urllink" WITH OIDS FROM stdin;
24265 \N Review of Nikon F5 \N \N \N 24065
http://www.photogs.com/bwworld/f5.html t

It looks like maybe postgres is expecting an integer and getting a
string maybe?

One thing I did which was a little unusual is that I did an ALTER TABLE
foo ADD COLUMN, but I should have said ALTER TABLE foo* ADD COLUMN to
get the column on inherited attributes. The only solution I could think
of was to go and add the attribute to all the sub-classes too. This
seemed to work (is this what I should have done?), but I don't know if
this might be related to this problem. Maybe postgres is confused now
about column orders?? So I wanted desperately to do a pg_dump -D -o, but
-D stops -o from working (Yuk! This really need to be fixed!)

(Please give us DROP COLUMN soon! :-)

The other error looks to be something to do with views...

CREATE RULE "_RETproductv" AS ON SELECT TO "productv" WHERE DO INSTEAD
SELECT "
oid" AS "oidv", "type", "title", "summary", "body", "image", "category",
"mfrcod
e", "mfr", "costprice", "taxrate", "profit", "rrprice", "taxrate" *
"costprice"
AS "tax", "costprice" + "profit" AS "exsaleprice", "costprice" +
"profit" + "tax
rate" * "costprice" AS "saleprice" FROM "product";
ERROR: parser: parse error at or near "do"
CREATE RULE "_RETorderitemv" AS ON SELECT TO "orderitemv" WHERE DO
INSTEAD SELE
CT "oid" AS "oidv", "product", "webuser", "quantity", "price",
"taxfree", "order
status", "orderdatetime", "shipdatetime", "price" * "quantity" AS
"totalprice" F
ROM "orderitem";
ERROR: parser: parse error at or near "do"

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chris Bitmead 1999-05-07 05:14:45 Re: [HACKERS] Re:pg_dump barfs?
Previous Message Bruce Momjian 1999-05-07 03:49:20 Re: [HACKERS] Hashjoin status report