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 1twPVW-00ECBT-TS for pgsql-general@arkaria.postgresql.org; Sun, 23 Mar 2025 17:53:10 +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 1twPVV-002svZ-LO for pgsql-general@arkaria.postgresql.org; Sun, 23 Mar 2025 17:53:09 +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 1twPVV-002suG-Aa for pgsql-general@lists.postgresql.org; Sun, 23 Mar 2025 17:53:09 +0000 Received: from mail-oo1-xc2a.google.com ([2607:f8b0:4864:20::c2a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1twPVT-000iA9-0W for pgsql-general@lists.postgresql.org; Sun, 23 Mar 2025 17:53:08 +0000 Received: by mail-oo1-xc2a.google.com with SMTP id 006d021491bc7-601a46ee19fso1929397eaf.0 for ; Sun, 23 Mar 2025 10:53:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742752385; x=1743357185; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=wBJJRjBGxZBKEW3FTB8wGYYSaVyyPylwzT0+IzHYdeE=; b=WKpvb0qYkMe/APjANUa6+qiuVvusUTFtwLCwa+6l+3ZQkC+zoNuqexxXT0utfn+3+H eS7qoVBsb35RNc+tE373qVvDxGv3v/zGcKzVRthLk+PZl5u9iiK93rcPi0t6lBH8F+c8 0mK/r40g5RtecUdg1CcyQQcm/oFWP26DuMe0mtjU1PUq2iQCrTHrJ1Hl838InwZ7rbMW zb/nGZyvNAkwjPTnRJVjSE2fNEnSX3priTQ2/U9KIERznNn/rCqNIjqeQQpnpY0UVYXU coX+FiwLbrbcl5Cm9W4ZKUoktm+nXE6XQQ1+HXtbBhGcXWSHKC04QkxLNwwCVUXWmXUP Z05g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742752385; x=1743357185; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wBJJRjBGxZBKEW3FTB8wGYYSaVyyPylwzT0+IzHYdeE=; b=XBxDWcGPnOh2klnnVk/1v3vCzpgMdxZ/810DlpCJgpV7p2vSv1nCleo6MbNlkIX1UD w6a918g9AF9E5dKyJ4pOxPFBnZO8nZOEcA46trbaLMvb2GQ2/8O5mJ4VBtNRtQVrYueT FOz1Vl+5/0NjR3xbutGlDiiovP9wA9+UBMtR/aVn6dwm/qFKYExs+gAEzUDmeZKYSGUI AKaONxsW/PRnJ/oVtuMECrURlYcuZ2tW5YxcP2d+CUKy2LZNoma2rcmh2INKdTij4hdb d5UhQzDQbIY2tkjUzX5SUFH1m/0fvztS+NljsE/xpVQgX6IiaWHHBDW73FXXmw55SsL0 9mPw== X-Forwarded-Encrypted: i=1; AJvYcCU1DMo41KuWC0CTVQxZVdz0tBfwh7vWic2dVbK4CFb5BI5IVdZCK/1P7gg6c0+G4152Vszx+eu6WpPcx8Cf@lists.postgresql.org X-Gm-Message-State: AOJu0YwrlToUH4PDRua3mNDK83OSP/aepyDl5enBK5tajtzK7IrOwr1n wV2a+mZBeFULUPDZ8JYBVC1zsm7BagFBqjb18aH5y075r6eTG+LBNpP28T1c4/y/o3gpw+yEEPR XWbUNYWG/JVzLy6REoqKS/hrO8WI8OjP9 X-Gm-Gg: ASbGncsn5M4dinw9nOInEVPK29aLcfDhKK/iZG1D8hjR5mAVY4sEYumo/PJ8Xkr2709 ZECgj+WDEXCo3WbXZXKZZSPQfJ+sbhXbzIDNkd31VfPTgEsGnUlSLiajKTX1eEZTXOL3lCNsp2C 8jIw3F1igWIoOwOxj6dOvkSLbh X-Google-Smtp-Source: AGHT+IFgekyPCh5VWB0fYqP4Fq9HE8/S9MtLwLbfv0J+VslsZL+shxSbSMyKffykk9Lm4geGb+apLSNnpt4ikpMlMEc= X-Received: by 2002:a05:6871:688:b0:2c2:371a:2b4e with SMTP id 586e51a60fabf-2c78051c496mr6912738fac.32.1742752385157; Sun, 23 Mar 2025 10:53:05 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a8a:349:0:b0:589:13f9:e937 with HTTP; Sun, 23 Mar 2025 10:53:04 -0700 (PDT) In-Reply-To: References: <90741d5f-5cda-4c4a-84f4-c470129732f4@aklaver.com> <473602.1742698901@sss.pgh.pa.us> From: "David G. Johnston" Date: Sun, 23 Mar 2025 10:53:04 -0700 X-Gm-Features: AQ5f1JoWmbKOFzSVer0FfRn3bACfv9s_8uxgDrzTrFxj02dUL7xq-01Y00lfVQ4 Message-ID: Subject: Re: Determine server version from psql script To: Igor Korot Cc: Tom Lane , Adrian Klaver , "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000d955fb0631062845" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d955fb0631062845 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sunday, March 23, 2025, David G. Johnston wrote: > On Sunday, March 23, 2025, Igor Korot wrote: > >> >> 2. Is there a way to do CREATE TRIGGER IF NOT EXIST for the earlier >> version? >> > > No. You have to drop the trigger if it does exist and then create the ne= w > one. > Well, you can always query the catalogs directly to answer the question =E2=80=9Cdoes this trigger exist=E2=80=9D. David J. --000000000000d955fb0631062845 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sunday, March 23, 2025, David G. Johnston <david.g.johnston@gmail.com> wrote:
On Sunday, March 23, 2025, Igor Korot <ikorot01@gmail.com> wrot= e:

2. Is there a way to do CREATE TRIGGER IF NOT EXIST for the ea= rlier version?

No.=C2=A0 You ha= ve to drop the trigger if it does exist and then create the new one.
<= /blockquote>

Well, you can always query the catalogs dir= ectly to answer the question =E2=80=9Cdoes this trigger exist=E2=80=9D.

David J.

--000000000000d955fb0631062845--