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 1gidu6-0008KH-Fr for pgsql-general@arkaria.postgresql.org; Sun, 13 Jan 2019 11:26:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gidu2-0007fA-I7 for pgsql-general@arkaria.postgresql.org; Sun, 13 Jan 2019 11:26:06 +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 1gidu2-0007f3-6f for pgsql-general@lists.postgresql.org; Sun, 13 Jan 2019 11:26:06 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gidtu-0007zX-TF for pgsql-general@postgresql.org; Sun, 13 Jan 2019 11:26:04 +0000 Received: from [192.168.127.1] (port=60121 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1gidtq-0001KS-SE; Sun, 13 Jan 2019 11:25:54 +0000 Received: from [127.0.0.1] (port=17678 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.89 (FreeBSD)) (envelope-from ) id 1gidtq-000Fi1-33; Sun, 13 Jan 2019 11:25:54 +0000 From: Andrew Gierth To: Alexander Farber Cc: pgsql-general Subject: Re: How to always run UPDATE FROM despite missing records in the source table? In-Reply-To: (Alexander Farber's message of "Sun, 13 Jan 2019 11:11:47 +0100") Message-ID: <87r2dgn8l6.fsf@news-spur.riddles.org.uk> References: <1f962321-5973-fe09-e52f-182115296555@aklaver.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) Date: Sun, 13 Jan 2019 11:25:53 +0000 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >>>>> "Alexander" == Alexander Farber writes: Alexander> even though I wonder what is the (VALUES Alexander> ('20.20.20.20'::inet)) v(ip) construct there, some temporary Alexander> table which is then LEGT JOINed to the geoip table? The SQL spec calls it a . The VALUES clause behaves like a SELECT that returns a fixed number of rows (1 or more) whose columns contain the results of the specified expressions. The v(ip) part is just a table and column alias (I omitted the optional AS keyword out of long habit) to name the constructed table. -- Andrew (irc:RhodiumToad)