pg_dump: Too much <SPACE> in COPY ouput

Started by PostgreSQL Bugs Listalmost 25 years ago3 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

Jean-Francois Leveque (leveque@webmails.com) reports a bug with a severity of 4
The lower the number the more severe it is.

Short Description
pg_dump: Too much <SPACE> in COPY ouput

Long Description
System: SuSE 7.0
select version(); :
PostgreSQL 7.1.2 on i686-pc-linux-gnu, compiled by GCC 2.95.2

pg_dump inserts an extra <SPACE> between double-quoted tablename
and FROM.

This was not the case with the version I used before:

System: SuSE 7.0
PostgreSQL RPM: postgres-7.0.2-29
select version(); :
PostgreSQL 7.0.2 on i686-pc-linux-gnu, compiled by gcc 2.95.2

Example form two pg_dump outputs
7.1.2 :
COPY "list" FROM stdin;
7.0.2 :
COPY "list" FROM stdin;

Sample Code

No file was uploaded with this report

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PostgreSQL Bugs List (#1)
Re: pg_dump: Too much <SPACE> in COPY ouput

pgsql-bugs@postgresql.org writes:

Example form two pg_dump outputs
7.1.2 :
COPY "list" FROM stdin;
7.0.2 :
COPY "list" FROM stdin;

I have a very hard time considering that a bug...

regards, tom lane

#3Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#2)
Re: pg_dump: Too much <SPACE> in COPY ouput

pgsql-bugs@postgresql.org writes:

Example form two pg_dump outputs
7.1.2 :
COPY "list" FROM stdin;
7.0.2 :
COPY "list" FROM stdin;

I have a very hard time considering that a bug...

Looks like an easy fix. In fact, the coder had a space after WITH OIDS
already, so there is no need for the extra space after the second %s:

if (oids == true)
oidsPart = "WITH OIDS ";
else
oidsPart = "";
...

sprintf(copyBuf, "COPY %s %sFROM stdin;\n", fmtId(tblinfo[i].relname, force_quotes),
oidsPart);

Patch applied.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Attachments:

/bjm/difftext/plainDownload+2-2