Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UenPx-000079-7q for pgsql-docs@arkaria.postgresql.org; Tue, 21 May 2013 14:19:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UenPw-0005SH-O7 for pgsql-docs@arkaria.postgresql.org; Tue, 21 May 2013 14:19:56 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UenPw-0005SC-6E for pgsql-docs@postgresql.org; Tue, 21 May 2013 14:19:56 +0000 Received: from moutng.kundenserver.de ([212.227.126.186]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UenPp-000132-Ht for pgsql-docs@postgresql.org; Tue, 21 May 2013 14:19:55 +0000 Received: from [192.168.1.110] (mail.highperformancepostgresql.com [71.179.240.8]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MJ0M1-1UcKZm11w1-00366I; Tue, 21 May 2013 16:19:47 +0200 Message-ID: <519B8281.10105@2ndQuadrant.com> Date: Tue, 21 May 2013 10:19:45 -0400 From: Greg Smith User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: pgsql-docs Subject: Reserved word "date" in tutorial example Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:pVQMKOGtRnPYReahHzxxjoreMHSOOJ/OBFqWtCmORAM iek/MzELtd9yso6rdYahOc4E1ESG3RszGF4M4vbEJ8Z8gaKvyE 5DQU8QxRM7D5K0IyObw+Pq+KnX2Ge3/2fW4jFfj8eGUN8fz7uD 9sQTAjEMuZv5/X0SYSmwH+Bjk6n5pZlkNqYr80Wj9znH9c+/A0 8vcqO6cXz3cGQt63/3MCZbAa/8Lda9m4ikV2+/aXskvfwFMIug MsxoO+qfqQYKjbqU1wGSHt7Jd1Fb3EgXGtoSR3og22L2TrzIRY G/dBtGIbiN+CBaNVLxxUA04jiThp5gk38doNIgq3hKO6HcKgEv 3MFp/JyNOWeV7BOtwDsY= X-Pg-Spam-Score: 0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org doc/src/sgml/query.sgml includes a tutorial example with this definition: CREATE TABLE weather ( ... date date ); The fact that "date" is used for both the column name and the type is highlighted by two later comments: (Yes, the column of type date is also named date. This might be convenient or confusing--you choose.) type names are not key words in the syntax, except where required to support special cases in the SQL standard. But as a documentation comment submitted recently points out, "date" *is* a reserved word in the SQL spec: http://www.postgresql.org/docs/current/interactive/sql-keywords-appendix.html , just not in PostgreSQL. That makes using it as a column name in an example an odd choice for a tutorial. The example is using the ambiguity to point out where the line between what is and isn't legal is at, and maybe that's a feature instead of a bug. There are a few approaches that could improve on this: -Keep all of that, but expand the description to link to "SQL Key Words"--right now "SQL standard" doesn't go to that section--and say this might be a reserved word in other SQL implementations. This is the smallest useful improvement. -Change the name of the column and remove the two related descriptions. This will lose the lesson about where the parser's line is at. -Do both: move this example of parser trivia somewhere else, but remove it from the tutorial material by using a non-reserved column name there. -- Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.com -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs