Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r7ir1-006SgG-Fn for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Nov 2023 21:09:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r7iqz-00GiaF-Ax for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Nov 2023 21:09:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r7iqz-00Gia0-11 for pgsql-hackers@lists.postgresql.org; Mon, 27 Nov 2023 21:09:17 +0000 Received: from mail-qv1-xf34.google.com ([2607:f8b0:4864:20::f34]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1r7iqv-008r0S-TU for pgsql-hackers@postgresql.org; Mon, 27 Nov 2023 21:09:16 +0000 Received: by mail-qv1-xf34.google.com with SMTP id 6a1803df08f44-677fba00a49so38993776d6.1 for ; Mon, 27 Nov 2023 13:09:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunslane-net.20230601.gappssmtp.com; s=20230601; t=1701119352; x=1701724152; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=m22l9aKW3zP/hL3j0QG9c7kiB3HrGchIAwTsSWv65qg=; b=P28ThnjrMXmEYiez/pN4fUMAjuUG1+jFbWi+vkYvLmK9orbSpz8X1LpndFTewK7tOP 6UOkXk9UeCYzH2HlGQCPtYXQiEoisWoUNs6FPNxwTmuKwRQD714aDxlBUFOVqhUSVpqv AXJqDxheZq7r+YcOCwyTogKAyC9RccmF33fdYfIOoKxRKDcWUD0GyM7hO16tlSITZlSG KkwxgLRPMLoau5StZ3u/j/Kl1qsDUG0ZCMyHQtBoOlB7ttefD9rWKxr6R1ZHwiEkbcKc pOIjvNNDJPu0NAyYbqiL0wFSd2hYpIrobI30uOsKifT0nRSzWH8vco69ZdYyuLrrEO/8 QuUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701119352; x=1701724152; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=m22l9aKW3zP/hL3j0QG9c7kiB3HrGchIAwTsSWv65qg=; b=e5IM+1Fnb+pwymtGhxGRfyonvuHpS3aI0025URQ9/VivbOR04r6Pth7W9ObbQq948B YYzH0YOyetBGfvhEZyjV+qx2Rpk7TyF5rZMguLsOSE1Dx/HrdBskYEEDWL1t8N+bDUAI XrkHZSWWQ8St2mrQY/QC75f72eczSqYUXmtKkq/Tdo5PXI6heRMi2B4A1AUT/2G+CvTD Ik+N+cLq7wdrQ6gTjKwdhx3PoSsHvD5TijoqC/Y2wk++4C9iAqddH3NtByiSLu70iwmJ wkYLgGGI9LZNizUPLZxCJvzsRYmjJNLHV+q7UXEHTmKds5cCcZNAQwS+rsZHWMT4Viqj QeEQ== X-Gm-Message-State: AOJu0Yzm6bTmXoBHTPYfwo8vyIT/hgXzRncRevqFJkDANIosmldW2udF I1CarmMa98r9VjdpPIzhp/rqdQ== X-Google-Smtp-Source: AGHT+IGBCju0M3rLfxg399V2ET23pnB6NhAuFIYY8b6RC3+0PgvOlPqjOdSPGNH+D1k2UTHJydEpIw== X-Received: by 2002:a05:6214:1c86:b0:670:b327:c86f with SMTP id ib6-20020a0562141c8600b00670b327c86fmr20013255qvb.17.1701119351744; Mon, 27 Nov 2023 13:09:11 -0800 (PST) Received: from ?IPV6:2605:a601:9122:d800::2bb? ([2605:a601:9122:d800::2bb]) by smtp.googlemail.com with ESMTPSA id pp10-20020a056214138a00b0067a56ff6bc6sm104636qvb.122.2023.11.27.13.09.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Nov 2023 13:09:11 -0800 (PST) Message-ID: <9df52975-686d-c945-36bd-559c930f2dc7@dunslane.net> Date: Mon, 27 Nov 2023 16:09:10 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: Missing docs on AT TIME ZONE precedence? Content-Language: en-US To: Tom Lane , Alvaro Herrera Cc: Bruce Momjian , Shay Rojansky , pgsql-hackers References: <202311271732.hn567fcmvy37@alvherre.pgsql> <4006949.1701117264@sss.pgh.pa.us> From: Andrew Dunstan In-Reply-To: <4006949.1701117264@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-11-27 Mo 15:34, Tom Lane wrote: > Alvaro Herrera writes: >> (TBH I don't think the added comments really explain the problems fully. >> That's most likely because I don't actually understand what the problems >> are.) > The actual problem is that nobody has applied a cluestick to the SQL > committee about writing an unambiguous grammar :-(. But I digress. > > I don't like the existing coding for more reasons than just > underdocumentation. Global assignment of precedence is a really, > really dangerous tool for solving ambiguous-grammar problems, because > it can mask problems unrelated to the one you think you are solving: > basically, it eliminates bison's complaints about grammar ambiguities > related to the token you mark. (Commits 12b716457 and 28a61fc6c are > relevant here.) Attaching precedence to individual productions is > far safer, because it won't have any effect that extends beyond that > production. You still need a precedence attached to the lookahead > token; but I think we should try very hard to not assign a precedence > different from IDENT's to any unreserved keywords. > > After a bit of fooling around I found a patch that seems to meet > that criterion; attached. > > Looks good. Perhaps the comments above the UNBOUNDED precedence setting (esp. the first paragraph) need strengthening, with a stern injunction to avoid different precedence for non-reserved keywords if at all possible. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com