Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kkVPW-0002sa-Ng for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Dec 2020 16:55:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kkVPV-0003B6-OH for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Dec 2020 16:55:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kkVOE-0007IJ-SU for pgsql-hackers@lists.postgresql.org; Wed, 02 Dec 2020 16:54:03 +0000 Received: from mail-io1-xd30.google.com ([2607:f8b0:4864:20::d30]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kkVO8-0004CK-3q for pgsql-hackers@lists.postgresql.org; Wed, 02 Dec 2020 16:54:02 +0000 Received: by mail-io1-xd30.google.com with SMTP id 81so904544ioc.13 for ; Wed, 02 Dec 2020 08:53:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7xWSuKSUY028rel7s5MS1B2JUOGGqE4VY1WiVIGlMYg=; b=x2ob/wmSC5YEtr6v478AgRh2CYRCrQWmYl2aYK4YaXcsVl0phU4sRbqRrtUwGBxhwe u/mownVgiCrLZaBx9eROWUpf5rkDeuZJ0sHsV6FDOV3B+H+qvnMqymwgzFSB8pbwKu8W eL1uEfskdE3UUJnn6w9M3wJ5IYrze192YGOt3wvoesTK1RX0GDgMIfFJXWDNj7GIHfMY ydDeDYN04VSjZncKYPd2NqS7W4ZxA3kuFiRZCsQUwwtBhJJnmWdlKAju9fAT5QiGl6+H hzZFPXTkuR7pZCaKy5sEckAPGHKOgHrAYXAgVCqfp6cXe2juPJAvLR6Ofdq8FWi1hRyu nwQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7xWSuKSUY028rel7s5MS1B2JUOGGqE4VY1WiVIGlMYg=; b=bB1uuspwZMyAnFXOB/GSmPtwpucFwWSZIJMYSiL2z/npL5zPsHOrGCuM+cN4ovQq8A 1Nd/2FgmPi5Ty8xOxhS/ve8LbloufXkurqSDFQ1X3IUOoOjElyGEc6u/Wnf5Y6WKsbCD FhEPNyTEZT/cnangUvZk+10ifBjLM+yeU94418ypCekKc9PtJgXOgwBa17G/jV/SE8vI q2pdKXvQUq3cyhzxvaQP0GCHN0M+DEifL+F/cZTiBA9fcuXyJhnYCIaSaTImspUlruZd 8pl5ouDLiLqOe07hlbglOn94xuJNvk6WsD3kyrJ5Tj0Dsk59v7SFZxulH+I0Iu3jJ1BZ EWUQ== X-Gm-Message-State: AOAM532CxxIYFzXrzltmFw596UJlhNzv0dtkvPofw2fZGYJAwsrZpz61 6jyT3iV0rr+0t4Pq1hlBivQ8qQ== X-Google-Smtp-Source: ABdhPJzjk+XNMmwG6SjHMyPa4U31B4UmYg4jyn/pE5Qmh9k7SsILdqixxk0ejmOGlflt+IfcyCZjmw== X-Received: by 2002:a05:6602:1305:: with SMTP id h5mr2708707iov.202.1606928033602; Wed, 02 Dec 2020 08:53:53 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id b12sm1435512ilr.60.2020.12.02.08.53.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Dec 2020 08:53:52 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 757C580084D; Wed, 2 Dec 2020 10:53:51 -0600 (CST) Date: Wed, 2 Dec 2020 10:53:51 -0600 From: Justin Pryzby To: Luc Vlaming Cc: Simon Riggs , Andres Freund , pgsql-hackers@lists.postgresql.org, Heikki Linnakangas Subject: Re: should INSERT SELECT use a BulkInsertState? Message-ID: <20201202165351.GG24052@telsasoft.com> References: <20200604173047.dirdp6zln7ogj54k@alap3.anarazel.de> <20200713015700.GA23581@telsasoft.com> <20200919133215.GB30557@telsasoft.com> <20201016210511.GC9241@telsasoft.com> <20201030045138.GA3080@telsasoft.com> <20201102184551.GJ22691@telsasoft.com> <20201124020020.GK24052@telsasoft.com> <20201130011146.GS24052@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201130011146.GS24052@telsasoft.com> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk One loose end in this patch is how to check for volatile default expressions. copyfrom.c is a utility statement, so it can look at the parser's column list: COPY table(c1,c2)... However, for INSERT, in nodeModifyTable.c, it looks like parsing, rewriting, and planning are done, at which point I don't know if there's a good way to find that. The default expressions will have been rewritten into the planned statement. We need the list of columns whose default is volatile, excluding columns for which a non-default value is specified. INSERT INTO table (c1,c2) VALUES (1,default); We'd want the list of any column in the table with a volatile default, excluding columns c1, but not-excluding explicit default columns c2 or any implicit default columns (c3, etc). Any idea ? -- Justin