Обсуждение: Dump

Поиск
Список
Период
Сортировка

Dump

От
Mihai Gheorghiu
Дата:
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

От
Tom Lane
Дата:
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

От
Trurl McByte
Дата:

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

От
Tom Lane
Дата:
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

От
Trurl McByte
Дата:
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--|