COPY problem on -- strings

Поиск
Список
Период
Сортировка
От Sabin Coanda
Тема COPY problem on -- strings
Дата
Msg-id gg0rg0$2dlf$1@news.hub.org
обсуждение исходный текст
Ответы Re: COPY problem on -- strings  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: COPY problem on -- strings  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
Hi,

I have "PostgreSQL 8.3.5, compiled by Visual C++ build 1400" on Windows OS.

I try to use the COPY command to optimize the backup/restore performance,
but I found a problem. I reproduce it below.

I create a database with a simple table:
  CREATE TABLE "A"
  (
    "Col1" integer NOT NULL,
    "Col2" character varying NOT NULL,
    CONSTRAINT "A_pkey" PRIMARY KEY ("Col1")
  )
  WITH (OIDS=FALSE);
  ALTER TABLE "A" OWNER TO postgres;

I populate the table with the statement:
  INSERT INTO "A" ( "Col1", "Col2" )
  VALUES (2, '-- any text' );

I backup the database plain with the command:
 pg_dump.exe -U postgres -F p -v -f "backup_plain.sql" "DemoDB"

I create a new database, and I run the script. But it rise me the error:
  ERROR:  syntax error at or near "1"
  LINE 49: 1 -- any text

I look for the error line and I saw how pg_dump created the script
statement:
  COPY "A" ("Col1", "Col2") FROM stdin;
  1 -- any text
  \.

Please let me know if this is a bug on pg_dump, or on the COPY syntax
design, or am I wrong ?
Do you know an workaround to make my backup/restore process available by
COPY, not by INSERT commands ?

TIA,
Sabin



В списке pgsql-general по дате отправления:

Предыдущее
От: "Andrus"
Дата:
Сообщение: Re: Conversion of string to int using digits at beginning
Следующее
От: paulo matadr
Дата:
Сообщение: Res: Res: Res: Archive files growth!!!