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 1sngMp-005LUy-2F for pgsql-general@arkaria.postgresql.org; Mon, 09 Sep 2024 15:31:52 +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 1sngMo-00E5yv-LT for pgsql-general@arkaria.postgresql.org; Mon, 09 Sep 2024 15:31: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 1sngMo-00E5ye-AF for pgsql-general@lists.postgresql.org; Mon, 09 Sep 2024 15:31:50 +0000 Received: from fout8-smtp.messagingengine.com ([103.168.172.151]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sngMg-000K5F-Pp for pgsql-general@lists.postgresql.org; Mon, 09 Sep 2024 15:31:49 +0000 Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfout.phl.internal (Postfix) with ESMTP id C271113801C9; Mon, 9 Sep 2024 11:31:41 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-07.internal (MEProxy); Mon, 09 Sep 2024 11:31:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1725895901; x=1725982301; bh=Val7TLIp+oDTH3lc+RLeA1GoY71mCoQ22oazQwUfzlQ=; b= 389dHSvjLaBCdmORsmuIL8HG2WDZ+nAGln2brkqDCwPtvCIQM/ua1N4f85/TMnGC xDnynDwoI5jELLNtxCf20ZXuRwPcVTNW3KjXZspuXSHS+YnJNgW65a3RZHGJkuxK Dgc2msiR4k/K8eVEllEFCE7UooWnuuyhJsH0FMfXFW5si7+Dg596Z2o90LIF6o6j tRhSFyCNzOgzXFlZoETRuerUsQTZspFq4/9egeSAdgXWUBnwH517ojdv2oNxz4mz eMv74VoEtdiTj50q2tL+9o8GmW/0MMT62ZpU+FRpV4rw9uSMfp8XLG/Pq7JmGPM5 IDyT+MYCVqNVziR5IcXvbg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1725895901; x= 1725982301; bh=Val7TLIp+oDTH3lc+RLeA1GoY71mCoQ22oazQwUfzlQ=; b=D ZosWf0GIwaUul7Tg+bEVkeL+TGB7YV8xscCOZY9XXmP1j78lonIjuktH39ifMWki asuYoCqfLSGGatRZfIs/moerT8/O3wT8sQnd1R7x+RRbdgyM1bVvIA5Rs/d60Uj8 0d6O+rcAYykv5UYDiN/57VJpOX8nRU7YWds+ZQSbgFROks/0etlsX4uG+/9KSumK 9KYx2spKF9Jn7EWuZs5VfItg9Bc4qYZQ3pGU0kaV6Bzd/et/PHHpK2BFKdtuadYj sA8/N2Y6zevvhj04zgFqy2xdi0audpA8DsQdQVfjPoKIhx6twdrQwSR0Sjz0PWRm Gty2nJF/w3xigGs4AEnQA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudeijedgjeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvfhfhjggtgfesthejredttddvjeen ucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrse grkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeeivdfhieehheegueeileej ieettdejhedugeefleekvdelkeehtdfgiefffeekudenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhl rghvvghrrdgtohhmpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprh gtphhtthhopegrrdhmrghnthiiihhoshestghlohhuugdrghgrthgvfigrhihnvghtrdgt ohhmpdhrtghpthhtohepphhgshhqlhdqghgvnhgvrhgrlheslhhishhtshdrphhoshhtgh hrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 9 Sep 2024 11:31:40 -0400 (EDT) Message-ID: <4efd9c6b-4021-4230-8463-d22a3d23f06c@aklaver.com> Date: Mon, 9 Sep 2024 08:31:40 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: postgresql FDW vs dblink for DDL To: Achilleas Mantzios - cloud , "pgsql-general@lists.postgresql.org" References: <1a884667-8474-dd01-d55f-1135724912f5@cloud.gatewaynet.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: <1a884667-8474-dd01-d55f-1135724912f5@cloud.gatewaynet.com> 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/9/24 03:24, Achilleas Mantzios - cloud wrote: > > 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) My sense is yes, if you want to encapsulate all of this within the database/app you will need to use dblink. > >> >>> >>> thanks >>> >>> >>> >>> >> -- Adrian Klaver adrian.klaver@aklaver.com