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 1nAwGM-0007r5-Jy for pgsql-general@arkaria.postgresql.org; Fri, 21 Jan 2022 15:55:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nAwFp-00066Y-Gb for pgsql-general@arkaria.postgresql.org; Fri, 21 Jan 2022 15:55:09 +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 1nAwFp-00066P-2x for pgsql-general@lists.postgresql.org; Fri, 21 Jan 2022 15:55:09 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nAwFh-0002aF-JJ for pgsql-general@lists.postgresql.org; Fri, 21 Jan 2022 15:55:08 +0000 Received: by mail-wm1-x32d.google.com with SMTP id c66so18462455wma.5 for ; Fri, 21 Jan 2022 07:55:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=DCyKJNhPAKW24HSGvEfT5KTm6Obd9j7eI+YjLx5XCuo=; b=hZpMUNHxPW94QwDXa4IdrVmMlX81KYnPNsfoB+qJPGdLaLksrx4kJkLQBZb4L74vI6 CUbKGKgzij3vrhxX//lj79TnXpbcVzdJjR9uAkQn/FN/wWpT1zaamu8C2i5LFHdj49o3 B/ZCOGx2tNAJNGXsU9x6xv7129NM6EYgZAR1TEEW//j2V7+5CVWChq+w2ZIJoAqoWV/t eYG48tJyQYXgde6LyO3Dsu0/Fpqc0Cy6suWnx0blr65QLJ12G2t561fDGxHc8ybZzmPt uUw9zj1J+JHq0lbmKyhvyceTY+1OObmtA9mic78cdSB8HBHZS6eVKCNxIxyvKMBzIwVa ClTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=DCyKJNhPAKW24HSGvEfT5KTm6Obd9j7eI+YjLx5XCuo=; b=p2jA775gXIZxn7dsrwjJI8c8I8BEUlh6i89NBCusT76cwOsh4neddZN6Eoae56ZRuN +NC4C23trdnMii6uxbmDrD8Ct/f1Ucm7yTg3vmgLYbUgJnN8r8uwY7Y2ultSUTI34F1a jVBf7xsyTUkJ2ylUhrquisoS9hiBJLaG9NzYuNi3q6a3UIBrHvM57IqXnAR5rPYCRKzr yJlbNjVd6cZCNBYG/q03nq1iFoX/lzz2+DwodKJGOm+61CnnGTBizwRKk1HiD2f1h2Mp asG5AH76cWrDXkSGNwiLxJ/cyPTPnzHEwrFwLmsfWn06k103zHCJ6mNLn3rHJTwKq5sb wr0g== X-Gm-Message-State: AOAM530sUUIIK5l8w3GPCLAhjfj/Jf78IxCcW5udzwNRZGwN2LBvU+9R 35YZO1pvOZ8cQBc64KFsM9dEuA== X-Google-Smtp-Source: ABdhPJxFa98n/Ym9m58YgWABP5CRAssvqVK1zZDQ9M8RgGZyAhV6OWLys5uHidyC81AqDj48+FJBxQ== X-Received: by 2002:a1c:20a:: with SMTP id 10mr648706wmc.6.1642780500234; Fri, 21 Jan 2022 07:55:00 -0800 (PST) Received: from localhost.localdomain (dynamic-ecrv3bo4u6qqfgwnb-pd01.res.v6.highway.a1.net. [2001:871:5e:805f:8289:96bc:214c:4047]) by smtp.gmail.com with ESMTPSA id a3sm7717922wri.89.2022.01.21.07.54.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jan 2022 07:54:59 -0800 (PST) Message-ID: <881a552bf99081609275aa9fe151073ad569c059.camel@cybertec.at> Subject: Re: Query on postgres_fdw extension From: Laurenz Albe To: Duarte Carreira Cc: Tom Lane , Swathi P , Bharath Rupireddy , pgsql-general@lists.postgresql.org Date: Fri, 21 Jan 2022 16:54:59 +0100 In-Reply-To: References: <1883853.1621003992@sss.pgh.pa.us> <342e0b863a3b6fc4c31ab18c827cb9b165cdb365.camel@cybertec.at> <780b4208700bb54138e5e17961282b26832a51a8.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 (3.40.4-2.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2022-01-21 at 14:33 +0000, Duarte Carreira wrote: > If we just create the 2 foreign tables, one complete and one without id, > you can simply insert into the table without id and it will work fine. > To select and show data, you use the "complete" table that has the id column. > > No need for trigger and view. If I understood correctly. > > I have this 2 table setup working. > > It's a workaround that quickly escalates out of hand though... with little added value. Sure, that will work. I just wanted to show how you can do without dealing with two different foreign tables explicitly. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com