BUG #8154: pg_dump throws error beacause of field called "new".

Started by Willy-Bas Loosalmost 13 years ago5 messagesbugs
Jump to latest
#1Willy-Bas Loos
willybas@gmail.com

The following bug has been logged on the website:

Bug reference: 8154
Logged by: Willy-Bas Loos
Email address: willybas@gmail.com
PostgreSQL version: 9.1.9
Operating system: ubuntu 12.04 server
Description:

pg_dump (PostgreSQL) 9.1.9 ends in an error when backing up my db, which
contains a field called "new".

Here's the raised message:
pg_dump: SQL command failed
pg_dump: Error message from server: ERROR: syntax error at or near "new"
LINE 1: ...ag, beginmaand, einddag, eindmaand, fusieafstand, new, opmer...
^
pg_dump: The command was: COPY lsb.zsoorten (id, euringchar, begindag,
beginmaand, einddag, eindmaand, fusieafstand, new, opmerkingen, euring) TO
stdout;

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Willy-Bas Loos (#1)
Re: BUG #8154: pg_dump throws error beacause of field called "new".

willybas@gmail.com writes:

pg_dump (PostgreSQL) 9.1.9 ends in an error when backing up my db, which
contains a field called "new".

Works for me:

regression=# create table new (f1 text, new text);
CREATE TABLE
regression=# insert into new (f1, new) values ('1','2');
INSERT 0 1
regression=# copy new(f1,new) to stdout;
1 2

You sure the server is 9.1?

regards, tom lane

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#3Willy-Bas Loos
willybas@gmail.com
In reply to: Tom Lane (#2)
Re: BUG #8154: pg_dump throws error beacause of field called "new".

oh, silly me.
I was making a dump of a PostgreSQL 8.4.17 backend with pg_dump
(PostgreSQL) 9.1.9

On Mon, May 13, 2013 at 4:24 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

willybas@gmail.com writes:

pg_dump (PostgreSQL) 9.1.9 ends in an error when backing up my db, which
contains a field called "new".

Works for me:

regression=# create table new (f1 text, new text);
CREATE TABLE
regression=# insert into new (f1, new) values ('1','2');
INSERT 0 1
regression=# copy new(f1,new) to stdout;
1 2

You sure the server is 9.1?

regards, tom lane

--
"Quality comes from focus and clarity of purpose" -- Mark Shuttleworth

#4Willy-Bas Loos
willybas@gmail.com
In reply to: Willy-Bas Loos (#3)
Re: BUG #8154: pg_dump throws error beacause of field called "new".

Hi,

The manual says:
It is recommended that you use the pg_dump and pg_dumpall programs from the
newer version of PostgreSQL, to take advantage of enhancements that might
have been made in these programs. Current releases of the dump programs can
read data from any server version back to 7.0.
http://www.postgresql.org/docs/9.1/static/upgrading.html

That means that this actually should work.

Cheers,

WBL

On Mon, May 13, 2013 at 5:43 PM, Willy-Bas Loos <willybas@gmail.com> wrote:

oh, silly me.
I was making a dump of a PostgreSQL 8.4.17 backend with pg_dump
(PostgreSQL) 9.1.9

On Mon, May 13, 2013 at 4:24 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

willybas@gmail.com writes:

pg_dump (PostgreSQL) 9.1.9 ends in an error when backing up my db, which
contains a field called "new".

Works for me:

regression=# create table new (f1 text, new text);
CREATE TABLE
regression=# insert into new (f1, new) values ('1','2');
INSERT 0 1
regression=# copy new(f1,new) to stdout;
1 2

You sure the server is 9.1?

regards, tom lane

--
"Quality comes from focus and clarity of purpose" -- Mark Shuttleworth

--
"Quality comes from focus and clarity of purpose" -- Mark Shuttleworth

#5Jeff Janes
jeff.janes@gmail.com
In reply to: Willy-Bas Loos (#4)
Re: BUG #8154: pg_dump throws error beacause of field called "new".

On Wed, Jul 24, 2013 at 5:18 AM, Willy-Bas Loos <willybas@gmail.com> wrote:

Hi,

The manual says:
It is recommended that you use the pg_dump and pg_dumpall programs from the
newer version of PostgreSQL, to take advantage of enhancements that might
have been made in these programs. Current releases of the dump programs can
read data from any server version back to 7.0.
http://www.postgresql.org/docs/9.1/static/upgrading.html

That means that this actually should work.

It will work if you use the --quote-all-identifiers option.

Cheers,

Jeff

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs