Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1glLL3-00005N-FI for pgsql-hackers@arkaria.postgresql.org; Sun, 20 Jan 2019 22:13:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1glLL2-0006L4-4I for pgsql-hackers@arkaria.postgresql.org; Sun, 20 Jan 2019 22:13:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1glLL1-0006Kx-EA for pgsql-hackers@lists.postgresql.org; Sun, 20 Jan 2019 22:13:07 +0000 Received: from bay.acenet.us ([173.230.252.50]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1glLKy-0003pL-Qc for pgsql-hackers@lists.postgresql.org; Sun, 20 Jan 2019 22:13:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=anastigmatix.net; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=qnd/cW+/wHtbU/JGVD54T6+9ZgYPceg8mzBqkuTNz6A=; b=FQ/tSmIGFSdmSQBahWduJ/hiPx ehN3QxAa2aApY/aM6ygpTPnhm/9xxuvXSxWrWJhY1FRtetYqxQ0S5N8t9kTsRr9UP4m3zZBi62nGU lOetv/Vcow1eWJMRwtFIbJrAVIpSd7WAkxUpmktuIy1VhmHk0eAu7jejm6o5M3MKW1nRF1v403vzj LKWGOFT7VDE6McP6WktsSAggfxRCfBa6U1Qoig3w+zqPatUGP9zsvCIBqiN9kXeVuM+yDde4RTnK2 Fb53gYCC2ZBAMcd/4sAcHRNiMCpr/FkxH+KLSNRbzjDvqJAybJbY6ZVlk+lIPmh9tysXJkJdMyUOI 8T9TLevA==; Received: from [192.182.57.242] (port=50348) by bay.acenet.us with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1glLKw-00DOFm-7W; Sun, 20 Jan 2019 17:13:03 -0500 Subject: Re: PostgreSQL vs SQL/XML Standards To: Pavel Stehule References: <5C283168.8060001@anastigmatix.net> <5C291741.9060506@anastigmatix.net> <5C297BB7.9070509@anastigmatix.net> <5C3A7A90.3070207@anastigmatix.net> <5C43FAEB.2070000@anastigmatix.net> <5C4401BE.4080606@anastigmatix.net> <5C449C71.7060903@anastigmatix.net> <5C44B332.6070609@anastigmatix.net> Cc: PostgreSQL Hackers From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <5C44F26D.5010703@anastigmatix.net> Date: Sun, 20 Jan 2019 17:13:01 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-OutGoing-Spam-Status: No, score=-95.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bay.acenet.us X-AntiAbuse: Original Domain - lists.postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - anastigmatix.net X-Get-Message-Sender-Via: bay.acenet.us: authenticated_id: chap@anastigmatix.net X-Authenticated-Sender: bay.acenet.us: chap@anastigmatix.net X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 01/20/19 12:48, Pavel Stehule wrote: >> >> Accordingly, I think the paragraph beginning "Unlike regular PostgreSQL >> functions," is more likely to perplex readers than to enlighten them. >> What it says about column_expression does not seem to lead to any useful >> difference from the behavior if it were "just like regular PostgreSQL >> functions". > > regular Postgres' functions has evaluated all arguments before own > execution. I think so this note is related much more to expressions used as > defaults. Sure, but again, is there an example, or can one easily be constructed, that shows the default expressions working in such a way? I am not able to use a default expression to refer to an earlier column in the column list of the xmltable call. I am able to use a default expression to refer to a column of an earlier FROM item in the enclosing SELECT. But such a query ends up having LATERAL form (whether or not the word LATERAL is used), and re-executes xmltable whenever the referenced column value changes. In that case, whether the default argument is evaluated at function entry or later doesn't seem to matter: the function is re-executed, so evaluating the new default at the time of entry is sufficient. So, I have still not been able to construct a query that requires the deferred evaluation behavior. But perhaps there is a way I haven't thought of. Regards, -Chap