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.96) (envelope-from ) id 1wWuk8-002wIv-2v for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jun 2026 11:35:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wWuk7-0075MR-2F for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jun 2026 11:35:39 +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.96) (envelope-from ) id 1wWuk7-0075MJ-1N for pgsql-hackers@lists.postgresql.org; Tue, 09 Jun 2026 11:35:39 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wWuk4-000000028yP-3TGK for pgsql-hackers@lists.postgresql.org; Tue, 09 Jun 2026 11:35:38 +0000 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-692491fec0bso714182a12.2 for ; Tue, 09 Jun 2026 04:35:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781004936; x=1781609736; darn=lists.postgresql.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=joQuyGiVENZIflx3QCZB773LBGly7l3SjfH0l8loOsA=; b=Qsjc6wD+fF8aRALBsXVUURZb0nuGw7EBqLDKhaVVVTROcPpTc5GF7FEhqQsVCrmoZy uaFmEqPPzCVshPM1Z3YIMiJpSNB40sxtCD1+Ntp80EvTSp9t31UzaDTGSlwvhrABVYUu VW5jHlU8Zh7dJtde8+xE15dtK1Wcq2ViNEhF+Jlafvcz9UAS19NVIHlQxn0ibPAH8PP4 OjusacOUNqq9I7Idh8JAW3G+3WvXqMg/i1Ho4di/8oW3na/otqT7kKU4pBmATqn+Xhql SnSnUKdLjUDSi2OuM+taS04kY8MaSPNhJG+DoNhBRrgBwirBQoLdFvy/Q3RCoMchKadD voag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781004936; x=1781609736; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=joQuyGiVENZIflx3QCZB773LBGly7l3SjfH0l8loOsA=; b=fknPGP1Py8o+XBZyCmA/t03g/vsVGzU+Huo7l3tefMFVRsnjrteLzR10BZsKuv/kOE NGwf5odXPcrZmncA1Dm+9h0Dp8ltlw/VPRcgauL6U/W/SnewXohNI2/yUYd9uRq0XOFt LEgUDPPvgAr/SUaZT+L+Tnw/IOZE2zC4+nWjSajV/Xuj6o9wfNpGTO1WRfCVjVKpq1BV u2hhIcKvWUk5ZoaXKX569VwM5GMMLCyGZ9m62LuK3cG/GyQU0puAkgEZEZStiGGLOyvY SMo4vsh9aV6xuaf2e9XS00nopqU7kTNaDdhe1JGrF1GFNySP/z+cVtrHQLkQybuKff4n cEaQ== X-Gm-Message-State: AOJu0YzbW4yeLqnnCkqzKN/ElQBd9VmmkUy9VkXq8IBHfCn49d2/P0G+ RoqbrziqY4/NNYKQuZS/OTSUy+GIS3XVPBb81F+Jc1fZ+sB97kTrWNdOeoBh8Pw= X-Gm-Gg: Acq92OEGHAJTgWgDTe+8U3DWdOMTh0502/7GXwiuJd+K+2uc3nDyQ0cxWN1NOeiYfub G6qtNcYJmlz8AVvNCFvAnuPn8pYR4T6gyQEqpO0YRy1U8fNAaiF7fMwuZAfzPi/xkY6Z0Qn+xMy YKcdXKE7Ah4HxjQYM5jhwePm4CYXygTGk/NLeVx1z66rQpO+1j/tZwd3HjK4NLYrvXz4U/o2g6a bsxchQWdKvqd7DRHnlI2r+Y7eIqoHAaAON50gGl9UmhfMeq/pATt2FrHNV+8P/p6HVoCuWhqHIg AGZTmxXpfqjhFQ2OzX2toQV2SB2C3MJzmDb4lDnwB0w1wjEjpQoYQm2eY2boJ6cnCi4AN6mgykD wNK8Q7wQK5LxGWCcXnlcSSWK/26ggvdCRRLr1tJ6vToTROd4lsknM/bOuWxO4udNdmuhb2z4nwu Y+j5u9m8lmCcLK0NxFWoCKuzHiFHezWiP9GcLVLYXHjRZUkjMBZQ== X-Received: by 2002:a17:907:c22:b0:bd5:1482:930a with SMTP id a640c23a62f3a-bf372e1e4b3mr936197766b.39.1781004935350; Tue, 09 Jun 2026 04:35:35 -0700 (PDT) Received: from localhost ([2a00:6d43:908:5803::3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-bf051d86f75sm1025891966b.21.2026.06.09.04.35.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2026 04:35:34 -0700 (PDT) From: "Jonathan Gonzalez V." To: solai v Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Add pg_get_publication_ddl function In-Reply-To: (solai v.'s message of "Tue, 2 Jun 2026 16:40:25 +0530") References: <70d20c14d1c14f93e4200c1a9327b97d7c18a782.camel@gmail.com> Date: Tue, 09 Jun 2026 13:35:33 +0200 Message-ID: <87wlw83q0q.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk solai v writes: Hello, > > [...] One thing I noticed is that the function currently returns > SETOF text, producing multiple DDL statements such as CREATE > PUBLICATION followed by ALTER PUBLICATION ... OWNER TO .... I wanted > to check whether this is the intended long-term API design, as most > existing pg_get_* functions return a single text value. Yes this is by design, it's documented that they will return the OWNER[1] unless that publications doesn't intend to have an OWNER in the DDL. > I also noticed > that publication options are emitted as quoted values, for example: > > publish='insert, update' > publish_generated_columns='none' > publish_via_partition_root='false' > > Would it make sense to emit enum-like and boolean values in their > native SQL form instead, such as: > > publish = 'insert, update' > publish_generated_columns = none > publish_via_partition_root = false Yes, this was already handled by Peter Smith[1] email Regards! [1] https://www.postgresql.org/docs/19/functions-info.html#FUNCTIONS-GET-OBJECT-DDL [2] https://www.postgresql.org/message-id/CAHut%2BPvyd3vN_LV8ppyX6Vu7pKdBhC5M3_zHN7gdJCvz1%3DkKHQ%40mail.gmail.com -- Jonathan Gonzalez V. EDB https://www.enterprisedb.com