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 1snbZi-004mnQ-O4 for pgsql-general@arkaria.postgresql.org; Mon, 09 Sep 2024 10:24:51 +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 1snbZi-00A1pY-8w for pgsql-general@arkaria.postgresql.org; Mon, 09 Sep 2024 10:24:50 +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 1snbZh-00A1o3-TZ for pgsql-general@lists.postgresql.org; Mon, 09 Sep 2024 10:24:49 +0000 Received: from cloud.gatewaynet.com ([185.90.37.94]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1snbZe-000Hov-Bl for pgsql-general@lists.postgresql.org; Mon, 09 Sep 2024 10:24:49 +0000 Message-ID: <1a884667-8474-dd01-d55f-1135724912f5@cloud.gatewaynet.com> Date: Mon, 9 Sep 2024 13:24:41 +0300 MIME-Version: 1.0 Subject: Re: postgresql FDW vs dblink for DDL To: Adrian Klaver , "pgsql-general@lists.postgresql.org" References: Content-Language: en-US From: Achilleas Mantzios - cloud In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/8/24 23:46, Adrian Klaver wrote: > On 9/8/24 13:04, Achilleas Mantzios wrote: >> Hi >> >> for remote DDL execution (such as CREATE TABLE) is dblink my only >> option? > > You will need to define in what context you are considering options. > > For instance you can do remote DDL operations by passing a command or > script via psql. Thank you Adrian, I was thinking of wrapping the DDL around a FUNCTION that will handle both the local and the (possibly various logical subscriptions), so that my programmers don't need to write extra scripts. And the thing is that this creation via DDL is inside our design. Certain users create some backup tables of the public data in their own schema (via our app), then do some manipulations on the public data, then restore to the public or merge with the backups. When done, those backup tables are dropped. So the DDL is inside the app. And the question was if dblink is my only option, in the sense of doing this in a somewhat elegant manner. (and not resort to scripts, etc) > >> >> thanks >> >> >> >> >