X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 17674568CB for ; Mon, 21 Mar 2005 14:59:39 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 15549-10 for ; Mon, 21 Mar 2005 14:59:30 +0000 (GMT) Received: from smtp018.mail.yahoo.com (smtp018.mail.yahoo.com [216.136.174.115]) by svr1.postgresql.org (Postfix) with SMTP id D5F51568C9 for ; Mon, 21 Mar 2005 14:59:29 +0000 (GMT) Received: from unknown (HELO jupiter.black-lion.info) (janwieck@68.80.245.191 with login) by smtp018.mail.yahoo.com with SMTP; 21 Mar 2005 14:59:32 -0000 Received: from [172.21.8.128] (ismtp.afilias.com [216.217.55.254]) (authenticated bits=0) by jupiter.black-lion.info (8.12.10/8.12.9) with ESMTP id j2LExUOU056199; Mon, 21 Mar 2005 09:59:31 -0500 (EST) (envelope-from JanWieck@Yahoo.com) Message-ID: <423EE14A.5080202@Yahoo.com> Date: Mon, 21 Mar 2005 09:59:22 -0500 From: Jan Wieck User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.1) Gecko/20040707 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Qingqing Zhou Cc: pgsql-performance@postgresql.org Subject: Re: column name is "LIMIT" References: <674d1f8a0503132314754df153@mail.gmail.com> <200503141825.22827.mr-russ@pws.com.au> <674d1f8a05031400482c413087@mail.gmail.com> <42355185.3070803@familyhealth.com.au> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=2.122 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, FORGED_RCVD_HELO, RCVD_IN_NJABL_DUL, RCVD_IN_SORBS_DUL X-Spam-Level: ** X-Archive-Number: 200503/418 X-Sequence-Number: 11123 On 3/14/2005 4:26 AM, Qingqing Zhou wrote: > So is it to make SQL parser context-sensitive - say the parser will > understand that in statement "SELECT * from LIMIT", LIMIT is just a table > name, instead of keyword? More or less, yes. To use a reserved keyword as an identifier (table or column name), it must be enclosed in double quotes. Double quotes are also used to make identifiers case sensitive. So select someval, "SOMEVAL", "someVAL" from "user"; is a valid query retrieving 3 distinct columns from the table "user". There is a builtin function quote_ident() in PostgreSQL that is supposed to return a properly quoted string allowed as an identifier for whatever name is passed in. But it fails to do so for all lower case names that are reserved keywords. The queries Slony executes on the replicas are constructed using that quoting function, and therefore Slony fails to build valid SQL for replicated table containing reserved keyword identifiers. One solution would be to brute-force quote all identifiers in Slony ... not sure what the side effects performance wise would be. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com #