Thread: Dump

Dump

From
Mihai Gheorghiu
Date:
I wanted to back up a database prior to upgrading to 7.0.2

pg_dump dbname > dbname.bak
FATAL 1: Memory exhausted in AllocSetAlloc()
PQendcopy: resetting connection
SQL query to dump the contents of Table 'tblname' did not execute correctly.
After we read all the table contents from the backend, PQendcopy() failed.
Explanation from backend: ''.
The query was : 'COPY "tblname" TO stdout;
'.

Please help.

Thanks,

Mihai


Re: Dump

From
Tom Lane
Date:
Mihai Gheorghiu <tanhq@bigplanet.com> writes:
> I wanted to back up a database prior to upgrading to 7.0.2
> pg_dump dbname > dbname.bak
> FATAL 1: Memory exhausted in AllocSetAlloc()
> PQendcopy: resetting connection
> SQL query to dump the contents of Table 'tblname' did not execute correctly.

Hmm, what version are you using now?  COPY used to have a memory leak
problem according to the CVS logs, but that was long ago (pre-6.4).

            regards, tom lane

Dump

From
Trurl McByte
Date:

Error in dumpig defaults on serial type!
If table name have non-statndart name (example: "Order")
sequenser auto created with name "Order_id_seq".
In the dump filed definition is:

...
"id" int4 DEFAULT nextval ( 'Order_id_seq' ) NOT NULL,
...

, but need:

...
"id" int4 DEFAULT nextval ( '"Order_id_seq"' ) NOT NULL,
...


--
      Trurl McByte, Capt. of StasisCruiser "Prince"
|InterNIC: AR3200                   RIPE: AR1627-RIPE|
|--98 C3 78 8E 90 E3 01 35  87 1F 3F EF FD 6D 84 B3--|


Re: Dump

From
Tom Lane
Date:
Trurl McByte <trurl@realtor3d.odessa.ua> writes:
> Error in dumpig defaults on serial type!
> If table name have non-statndart name (example: "Order")
> sequenser auto created with name "Order_id_seq".
> In the dump filed definition is:
> ...
> "id" int4 DEFAULT nextval ( 'Order_id_seq' ) NOT NULL,
> ...
> , but need:
> ...
> "id" int4 DEFAULT nextval ( '"Order_id_seq"' ) NOT NULL,
> ...

Hmm.  This is not pg_dump's fault: the default expression is actually
being stored that way in the database.  Someone seems to have thought
it was a good idea to strip the double quotes at parse time instead
of run time :-(.

Will fix for 7.1 ... in the meantime, don't name your sequences that way
...

            regards, tom lane

Re: Dump

From
Trurl McByte
Date:
On Wed, 7 Jun 2000 (Yesterday), Tom Lane wrote:

  TL> Trurl McByte <trurl@realtor3d.odessa.ua> writes:
  TL> > Error in dumpig defaults on serial type!
  TL> > If table name have non-statndart name (example: "Order")
  TL> > sequenser auto created with name "Order_id_seq".
  TL> > In the dump filed definition is:
  TL> > ...
  TL> > "id" int4 DEFAULT nextval ( 'Order_id_seq' ) NOT NULL,
  TL> > ...
  TL> > , but need:
  TL> > ...
  TL> > "id" int4 DEFAULT nextval ( '"Order_id_seq"' ) NOT NULL,
  TL> > ...
  TL>
  TL> Hmm.  This is not pg_dump's fault: the default expression is actually
  TL> being stored that way in the database.  Someone seems to have thought
  TL> it was a good idea to strip the double quotes at parse time instead
  TL> of run time :-(.

In the same dump pg_dump writes the following:
...
CREATE SEQUENCE "Order_id_seq" start 0 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
SELECT nextval ('"Order_id_seq"');
...

Quite probably and serial type it is possible to generate differently.

  TL>
  TL> Will fix for 7.1 ... in the meantime, don't name your sequences that way
  TL> ...
I shall wait for...
  TL>
  TL>             regards, tom lane
Thanx

--
      Trurl McByte, Capt. of StasisCruiser "Prince"
|InterNIC: AR3200                   RIPE: AR1627-RIPE|
|--98 C3 78 8E 90 E3 01 35  87 1F 3F EF FD 6D 84 B3--|