Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 902E9B5DBF2; Tue, 5 Jul 2011 12:13:42 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 37914-01-2; Tue, 5 Jul 2011 15:13:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f47.google.com (mail-fx0-f47.google.com [209.85.161.47]) by mail.postgresql.org (Postfix) with ESMTP id 917A5B5DCE5; Tue, 5 Jul 2011 12:13:32 -0300 (ADT) Received: by fxg11 with SMTP id 11so6950312fxg.34 for ; Tue, 05 Jul 2011 08:13:31 -0700 (PDT) Received: by 10.223.144.129 with SMTP id z1mr11824685fau.57.1309878811572; Tue, 05 Jul 2011 08:13:31 -0700 (PDT) Received: from [192.168.1.104] (58-53-133-95.pool.ukrtel.net [95.133.53.58]) by mx.google.com with ESMTPS id m26sm5357231fab.34.2011.07.05.08.13.29 (version=SSLv3 cipher=OTHER); Tue, 05 Jul 2011 08:13:30 -0700 (PDT) Date: Tue, 5 Jul 2011 18:13:21 +0300 From: Pavel Golub Reply-To: Pavel Golub Organization: Microolap X-Priority: 3 (Normal) Message-ID: <1564444906.20110705181321@gf.microolap.com> To: Alvaro Herrera CC: pgsql-bugs , PostgreSQL Hackers Subject: Re: [HACKERS] COPY .... WITH (FORMAT binary) causes syntax error at or near "binary" In-Reply-To: <1309878337-sup-685@alvh.no-ip.org> References: <6510382810.20110705175206@gf.microolap.com> <1309878337-sup-685@alvh.no-ip.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201107/28 X-Sequence-Number: 30640 Hello, Alvaro. You wrote: AH> Excerpts from Pavel Golub's message of mar jul 05 10:52:06 -0400 2011: >> Hello. >> >> System: PostgreSQL v9.0 Windows XP SP3 >> SQL: COPY "tablename" TO STDOUT WITH (FORMAT binary) >> ERROR: syntax error at or near "binary" >> LINE 1: ...OPY "tablename" TO STDOUT WITH (FORMAT binary) >> ^ >> >> ********** Error ********** >> >> ERROR: syntax error at or near "binary" >> SQL state: 42601 >> Character: 55 >> >> But if I use 'FORMAT text' or 'FORMAT csv' all is OK. >> >> Suppose this happens because BINARY is not listed in >> "unreserved_keyword" neither in "col_name_keyword parser" parser rules, but >> listed in "type_func_name_keyword" instead. AH> That seems pretty unfortunate. Of course, it works if you quote it: AH> COPY "tablename" TO STDOUT WITH (FORMAT "binary") AH> I assume it's not in unreserved_keyword because it would cause a AH> shift/reduce conflict elsewhere. Well, there are two ways: 1. Change documentation, so quoted or double quoted values are accepted 2. Fix parser -- With best wishes, Pavel mailto:pavel@gf.microolap.com