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 1tg0lh-006zmx-CQ for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Feb 2025 12:14:05 +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 1tg0lf-006zD0-63 for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Feb 2025 12:14:03 +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 1tg0le-006zBx-Pk for pgsql-hackers@lists.postgresql.org; Thu, 06 Feb 2025 12:14:02 +0000 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tg0lb-003u7k-0o for pgsql-hackers@lists.postgresql.org; Thu, 06 Feb 2025 12:14:01 +0000 Received: by mail-pj1-x1044.google.com with SMTP id 98e67ed59e1d1-2f44353649aso1105994a91.0 for ; Thu, 06 Feb 2025 04:13:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738844037; x=1739448837; darn=lists.postgresql.org; h=mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=04B6Kf4RbCTsmwSflQVHOf568V1xU4AYkio+gdLNMPk=; b=FZ31TIvM94DCcYtbiOHaKKEkWiZuH5J1e+KjBOQI6plaH9cVE+zQ+7RCN187Evz//A Bnx88dBdYmwJ+ePs4+5SXIXcSO4E4SCh7Un/nJcDpw2Xg9S6FsO6+quMToD3XabuDuMB q36z/65KJY0TozZA/aEolAFfzYYeU6N6ryUwSs4TF2zeW09p97g6FO9VdJ1SP+0Ce4lI HpYBLQ8pVZvDAuYAneKKwVYzrYOVG+MJvEi7NDMzSzIbV5FsjG7QWydTQjrfgcjIYSOY ua/uWe41cPslD6KJzJbhwvW/RzSq3G1TNZoBGLUFHLVd9lhS7OJv33QryQmrAvErhZl8 WOXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738844037; x=1739448837; h=mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=04B6Kf4RbCTsmwSflQVHOf568V1xU4AYkio+gdLNMPk=; b=XZ6J5eCndUO1UGXnD1heVTY/HLGfCxG+cxp3uztlcxo+ECMg7RG1ajs0ci8woP5TLO vwFYKeCpwmVsKRzILEqD9KjraD9zP4p3jnzW+h79XFK+DR3ky1Yhq4Tw/PEFGU06qEM3 MR6f8iz2l702N93Hck+nswv6My8mXQb74nq3AjNVfuxGXiZ/C7P0G6QMFT8Q4VxMr0hk F3sr1UqRgUp/Xmr4jqN1wWXUJLrLd+Kz8NIWHbramg3Xl9gr9dZg4jzT5hcvshmtcOV1 EL3hytPug6h2VdfiNmd7g/rDxXP89FTrBP8xUD2a0So29+7IytltY+C4uIlPWh2wd3So 1l/w== X-Forwarded-Encrypted: i=1; AJvYcCV0bok3bPbPE4TZ204yGHIuDWNcwgGEom9OLVAOA23v/jxSyOKYRH3PFEgAbCBA6sTPGqemyiN48akWUix6@lists.postgresql.org X-Gm-Message-State: AOJu0YwfrXLNCcFyLakqGJNRS464+SZGtuNBFwryaTmE9WsT7lKLbyvc yZGP3AxnbP66fvPlkOXYtGvkDyb4zx3fAVHZbu9QjU+lKPXaK/6o X-Gm-Gg: ASbGncupZw7LzO4nMGWsd/HwxJj0VqDIT8+ikzIkna2CkH3wCK5OXa48Ksa7GCl2x2O euPiEFlCsvuHsKce2WAvn3koPcF9rAwUtC+i/FXoni+0TgEQcATQAAWRByjGJUn4PVItvXLRsOx xWKpAFH/iX4J/lb39bq/u9NGPGcrmCtOHOINa8+AF0eBELKhQV0JgBWAaz4ub5yP2600pgmeJNa xzvhZA+VSLGsu7XgQEk3Y9BmQ2GArWuXKtvpgQw0MjsQfw35gxGZ6/O1K6WFiuR927xV2JUPxJw Kx/SZ0Bvob5za9gc5pY= X-Google-Smtp-Source: AGHT+IEXtIwig22dzp5WVgHEQ95VKhX+/sub4NGA5ElDNnjR0KkEhK0u9ucnnV2G209T6bgnOG5DBg== X-Received: by 2002:a17:90b:1d87:b0:2ee:bc7b:9237 with SMTP id 98e67ed59e1d1-2f9e080a5c6mr10082474a91.27.1738844037451; Thu, 06 Feb 2025 04:13:57 -0800 (PST) Received: from [127.0.0.1] ([2406:da18:f9d:7d02:2633:229f:fdd8:5ed2]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2fa09b5c925sm1189967a91.48.2025.02.06.04.13.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Feb 2025 04:13:57 -0800 (PST) Date: Thu, 6 Feb 2025 20:13:47 +0800 From: Zhang Mingli To: =?utf-8?Q?=C3=81lvaro_Herrera?= Cc: Michael Paquier , PostgreSQL Hackers Message-ID: <0663eec9-883d-4c25-ade4-58f227ece827@Spark> In-Reply-To: <202502061031.wlj7ysbk7rfi@alvherre.pgsql> References: <202502061031.wlj7ysbk7rfi@alvherre.pgsql> Subject: Re: Proposal to CREATE FOREIGN TABLE LIKE X-Readdle-Message-ID: 0663eec9-883d-4c25-ade4-58f227ece827@Spark MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="67a4a780_5108445b_1738b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --67a4a780_5108445b_1738b Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On =46eb 6, 2025 at 18:31 +0800, =C3=81lvaro Herrera , wrote: > > 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. Hi, Yeah, Our current convention is to ignore any inapplicable options without thro= wing errors. As you mentioned, we use bits to identify the options, which does add som= e complexity to the codes if we try to track the origin of the option bit= s. -- Zhang Mingli HashData --67a4a780_5108445b_1738b Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
On =46eb 6, 2025 at 18:31 +0800, =C3=81lvaro Herrer= a <alvherre=40alvh.no-ip.org>, wrote:

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.
Hi, Yeah,

Our current convention is to ignore any inapplicable options without thro= wing errors.

As you mentioned, we use bits to identify the options, which does add som= e complexity to the codes if we try to track the origin of the option bit= s.

--
Zhang Mingli
HashData
--67a4a780_5108445b_1738b--