COPY syntax

Started by Peter Eisentrautabout 23 years ago8 messages
#1Peter Eisentraut
peter_e@gmx.net

According to the syntax diagram in the documenation, I can write

COPY table TO STDOUT WITH BINARY OIDS;

Shouldn't the "binary", being an adjective, be attached to something?

--
Peter Eisentraut peter_e@gmx.net

#2Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Peter Eisentraut (#1)
Re: COPY syntax

Peter Eisentraut wrote:

According to the syntax diagram in the documenation, I can write

COPY table TO STDOUT WITH BINARY OIDS;

Shouldn't the "binary", being an adjective, be attached to something?

Uh, it is attached to WITH?

Seriously, yea, it doesn't read well, but it follows the WITH format of
parameters to a command.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#3Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#2)
Re: COPY syntax

Bruce Momjian writes:

According to the syntax diagram in the documenation, I can write

COPY table TO STDOUT WITH BINARY OIDS;

Shouldn't the "binary", being an adjective, be attached to something?

Uh, it is attached to WITH?

Attached to a noun phrase, like "mode" or "output". Note that all the
other things the typically follow WITH in any command are nouns.

--
Peter Eisentraut peter_e@gmx.net

#4Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Peter Eisentraut (#3)
Re: COPY syntax

Peter Eisentraut wrote:

Bruce Momjian writes:

According to the syntax diagram in the documenation, I can write

COPY table TO STDOUT WITH BINARY OIDS;

Shouldn't the "binary", being an adjective, be attached to something?

Uh, it is attached to WITH?

Attached to a noun phrase, like "mode" or "output". Note that all the
other things the typically follow WITH in any command are nouns.

Should we add an optional MODE after BINARY?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#5Lee Kindness
lkindness@csl.co.uk
In reply to: Bruce Momjian (#4)
Re: COPY syntax

Bruce Momjian writes:

Peter Eisentraut wrote:

Bruce Momjian writes:

COPY table TO STDOUT WITH BINARY OIDS;
Shouldn't the "binary", being an adjective, be attached to something?

Uh, it is attached to WITH?

Attached to a noun phrase, like "mode" or "output". Note that all the
other things the typically follow WITH in any command are nouns.

Should we add an optional MODE after BINARY?

Are you serious? You'd like to mess up the COPY syntax even further
for a purely grammatical reason!

A good few months ago I put formward an idea to change (well migrate
really) to "COPY TABLE" rather than "COPY" - this would allow a well
designed and thoughtout syntax for the new version while retaining old
compatibility.

egards, Lee Kindness.

#6Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Lee Kindness (#5)
Re: COPY syntax

Lee Kindness wrote:

Bruce Momjian writes:

Peter Eisentraut wrote:

Bruce Momjian writes:

COPY table TO STDOUT WITH BINARY OIDS;
Shouldn't the "binary", being an adjective, be attached to something?

Uh, it is attached to WITH?

Attached to a noun phrase, like "mode" or "output". Note that all the
other things the typically follow WITH in any command are nouns.

Should we add an optional MODE after BINARY?

Are you serious? You'd like to mess up the COPY syntax even further
for a purely grammatical reason!

A good few months ago I put formward an idea to change (well migrate
really) to "COPY TABLE" rather than "COPY" - this would allow a well
designed and thoughtout syntax for the new version while retaining old
compatibility.

I don't like the added MODE either, but Peter doesn't seem to like
BINARY alone, though it seems fine to me.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#7Peter Eisentraut
peter_e@gmx.net
In reply to: Lee Kindness (#5)
Re: COPY syntax

Lee Kindness writes:

Are you serious? You'd like to mess up the COPY syntax even further
for a purely grammatical reason!

We already "messed up" the COPY syntax in this release to achieve better
user friendliness. I do not think it's unreasonable to review this goal
from a variety of angles.

A good few months ago I put formward an idea to change (well migrate
really) to "COPY TABLE" rather than "COPY" - this would allow a well
designed and thoughtout syntax for the new version while retaining old
compatibility.

Well, I am the first to agree that the current syntax is not well
designed, but I must admit that I don't quite see what benefit simply
adding "TABLE" would have.

--
Peter Eisentraut peter_e@gmx.net

#8Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#7)
Re: COPY syntax

Peter Eisentraut <peter_e@gmx.net> writes:

Well, I am the first to agree that the current syntax is not well
designed, but I must admit that I don't quite see what benefit simply
adding "TABLE" would have.

I think the idea was that "COPY TABLE ..." could have a new clean syntax
without the warts of the current syntax. TABLE wouldn't be a noise word,
but a trigger for a different syntax for what follows.

However, COPY's feature set is inherently pretty wart-y. Even if we had
a green field to design syntax in, where exactly is the improvement
going to come, assuming that functionality has to stay the same?

regards, tom lane