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 1tfzAk-006lHW-FI for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Feb 2025 10:31:50 +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 1tfzAj-006AlV-4B for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Feb 2025 10:31:49 +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 1tfzAi-006AlN-RN for pgsql-hackers@lists.postgresql.org; Thu, 06 Feb 2025 10:31:48 +0000 Received: from fhigh-b3-smtp.messagingengine.com ([202.12.124.154]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tfzAg-003rsP-03 for pgsql-hackers@lists.postgresql.org; Thu, 06 Feb 2025 10:31:48 +0000 Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id 33F032540112; Thu, 6 Feb 2025 05:31:45 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Thu, 06 Feb 2025 05:31:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1738837905; x=1738924305; bh=S f6f/KYO9/VWX9v+V0tapdKDoVEtKYScdWFEMQu8nTg=; b=Xi+4rdNr3GSIxxctj fim1kTDytxUQgXreDjxV337O6TBw/la1agguS2MNktwo9dd2gNaCi6/JtLMWUDJq xp6XplCGfKSsjHJ07ptjlEP5mMh+Ov5hjRbj8XHwuGC7/O0n7m1aE4FaJ+dQE+S6 LIv/VA5ldRuSC29Y5Gpg2QX/NSWj3+Pn8MLf/5x9kszp5I6On2rbvZfI1lQHphzA GNJdFNXhxOmDj9ySOAWkoO4JfuE3vS0ZfSAaeVIImFgkviCKFRvSlt0Nh16JZch1 eExXEmRm+kQrhDKNSHW13yeH3K+NPykLB8t5iopj4CgmNeM1bG9C61weZw23xvvR 0gbJw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvieduhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpeffhffvvefukfggtggugfgjsehtkeertddttdej necuhfhrohhmpemllhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvh hhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpedvheeuffehgfeukeeufeeh hefghfeugfefudekjeevudffgeffkeegffffveegheenucffohhmrghinhepvghnthgvrh hprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdpnhgspg hrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepiihmlhhpohhs thhgrhgvshesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrh hssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehmihgthhgr vghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 6 Feb 2025 05:31:44 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1738837903; bh=2zIKoZzBsqknZg5smaYIbJJHvotfKaSbeHBEBeT01Lk=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=D6jSuHUrhOBCL/olXo6MPO3pRKI1GS9CBc12I+J9kt1YxgT8fsgCPDlog6AwcmzAY 7v9hGnQg9C2av0nLQUAFhZYnFZYDpq01zBFDk1LSXB0tSPUHo6aFxr4HlMEHoGOe44 bj7/n7HHSlMzPla8ObCiQgNWnVO0uPk1qinQ98bSidoB+ijhj1OVpGXmFJpvPpzIHr EpbPhA6CuAF9FShQmfFtQ8vEfDI5CIll6xRQaxYxgpj0+gAOvRg9adA/Sg6zSfpCUC mgGnWKxNndoAmx9lFPbxfFzUT2CRRnwNULZmu9Ou6Wvsre0TQGANqJcxCmTBoGP6sU z9pibNuUW90RA== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 679E390; Thu, 6 Feb 2025 11:31:43 +0100 (CET) Date: Thu, 6 Feb 2025 11:31:43 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Zhang Mingli Cc: Michael Paquier , PostgreSQL Hackers Subject: Re: Proposal to CREATE FOREIGN TABLE LIKE Message-ID: <202502061031.wlj7ysbk7rfi@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202502061029.s5sdtrnpfm7u@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-Feb-06, Álvaro Herrera wrote: > On 2025-Feb-06, Zhang Mingli wrote: > > > Added support for CREATE FOREIGN TABLE LIKE to enable the creation of > > foreign tables based on the column definitions, constraints of > > existing source tables. > > This feature mirrors the behavior of CREATE TABLE LIKE, but ignores > > inapplicable options such as INCLUDING INDEXES and INCLUDING > > COMPRESSION for foreign tables. > > I think it'd be better to throw errors if they are given -- but > INCLUDING ALL should be made to work in a different way than today so > that it doesn't raise errors uselessly. Right now it works by setting > all the bits in the value, um. Ah, but our fine manual already says The LIKE clause can also be used to copy column definitions from views, foreign tables, or composite types. Inapplicable options (e.g., INCLUDING INDEXES from a view) are ignored. so what you implemented seems to be okay from that POV. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "Investigación es lo que hago cuando no sé lo que estoy haciendo" (Wernher von Braun)