Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X5rAI-0002S0-RA for pgsql-bugs@arkaria.postgresql.org; Sat, 12 Jul 2014 06:52:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X5rAI-0007i9-Bg for pgsql-bugs@arkaria.postgresql.org; Sat, 12 Jul 2014 06:52:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X5rAH-0007i2-Om for pgsql-bugs@postgresql.org; Sat, 12 Jul 2014 06:52:09 +0000 Received: from mail-qg0-x232.google.com ([2607:f8b0:400d:c04::232]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1X5rAA-0004vT-9D for pgsql-bugs@postgresql.org; Sat, 12 Jul 2014 06:52:08 +0000 Received: by mail-qg0-f50.google.com with SMTP id j5so1707734qga.37 for ; Fri, 11 Jul 2014 23:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=A8OmfevYL6GszdRYaEOcbgLEymDsG+J5zhV5cdn+qrM=; b=aYJjtDmSiudsNf1j94M9uGf7QBfpmCeBNI8nmgaU+uWMug1CJ5duhVCANNihwQ6hLw wUL+SwqNKuTLDfPi1SY6rcSd/9ObOAEuKX+8p3vfeH7NlLM1WYuScGWSLDax9q0B7dMK NYeDystrV+cK8wlo0SYbyjamazMLKA7U/uzg+qpWYO2wdLxe8ENuLqhl9/AqkQkEEGhC P/2qbByfBKbSbVMrv/v52mNL/INnh2+HFTZmt+aIO3kwb6M/TfcDQiNa46hIFqxnGvsr /XMNtRpxJkRN4b12d0eFtBpGeLtDUUhwx0kg5fZwDZnT1oA30XrIG5JgqDcvu7TJgS76 nfYQ== MIME-Version: 1.0 X-Received: by 10.224.172.10 with SMTP id j10mr2980518qaz.46.1405147919832; Fri, 11 Jul 2014 23:51:59 -0700 (PDT) Received: by 10.140.22.229 with HTTP; Fri, 11 Jul 2014 23:51:59 -0700 (PDT) In-Reply-To: <20140711073149.2752.2472@wrigleys.postgresql.org> References: <20140711073149.2752.2472@wrigleys.postgresql.org> Date: Fri, 11 Jul 2014 23:51:59 -0700 Message-ID: Subject: Re: BUG #10925: Documentation not clear on copy options containing '_' From: Michael Paquier To: gerke.ephorus@gmail.com Cc: pgsql-bugs@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On Fri, Jul 11, 2014 at 12:31 AM, wrote: > When reading the documentation of the copy command one bumps into the > feature 'FORCE_QUOTE'. When trying this out, the error message shown is: > ERROR: syntax error at or near "FORCE_QUOTE" > After fiddling with this, one finds out that it should be 'FORCE QUOTE' > (with a space between FORCE & QUOTE) > > Expected situation: > * an explanation that the '_' should be omitted > * drop the '_' in the documentation > > (I'd write a patch myself but I cannot find where to change the > documentation) I don't see any problems with the documentation. The grammar of copy command has changed in 9.0, making FORCE_QUOTE needing an underscore. For backward compatibility, the old grammar has been kept as well. Here is an example: =# CREATE TABLE aa (a text); CREATE TABLE =# INSERT INTO aa VALUES ('John, Doe'); INSERT 0 1 =# insert into aa values (E'\\h'); INSERT 0 1 =# COPY aa TO stdout WITH CSV; \h =# COPY aa TO stdout WITH CSV FORCE_QUOTE a; ERROR: 42601: syntax error at or near "FORCE_QUOTE" LINE 1: COPY aa TO stdout WITH CSV FORCE_QUOTE a; ^ LOCATION: scanner_yyerror, scan.l:1053 =# COPY aa TO stdout WITH CSV FORCE QUOTE a; "\h" =# COPY aa TO stdout (FORMAT CSV, FORCE_QUOTE (a)); "\h" Regards, -- Michael -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs