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 1sGlan-00GxlD-Gg for pgsql-general@arkaria.postgresql.org; Mon, 10 Jun 2024 20:26:14 +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 1sGlal-00G1SN-Od for pgsql-general@arkaria.postgresql.org; Mon, 10 Jun 2024 20:26:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sGlal-00G1SE-DD for pgsql-general@lists.postgresql.org; Mon, 10 Jun 2024 20:26:12 +0000 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sGlag-000gRE-6g for pgsql-general@postgresql.org; Mon, 10 Jun 2024 20:26:11 +0000 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-24c9f73ccaaso2642153fac.1 for ; Mon, 10 Jun 2024 13:26:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718051165; x=1718655965; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=6lujlOL0B3SG+XQozvCmldT+F4r53NXbkVAJ35cI+pw=; b=B+1cPjA8K/y8hD0aHzoBvbpuAk98CgtBcSYT+L+mFiMuITj+DBshNLQLKpxaH/0dOr VwZbhvgNad7DSOk+4f/LYtcSKluZm0HHI07Utnh4JpzAHHO8524CXD3WhMxpBBfR9Xzh NSng6dBR5+3nFO16AJtVMcd2xfqxekpXqNC1YEUlv9d+BtxVXyWbm7SCGsVKb9Qrk3Yu M/9hgxM9kAF779fsA6hcP8NNVBSSOdCW0G7qgkfctrLHCUzzXweNX6Aw+sW4cVzmLaqm b4r695kQdFmTzv/TV66bgIn726kjkYTeJKcJgAvzFInh9/aYhJIupcBiDocDK2D/ARBO /6eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718051165; x=1718655965; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6lujlOL0B3SG+XQozvCmldT+F4r53NXbkVAJ35cI+pw=; b=ugR5lSS6BlbXA4X7vqBq4BDJkiEMWKqY+cy+5n6fU51AWuB/b695F1VzZjr7EIcplD S/paxQd/0fa6tpxZRdRYvNqGnUejUTMDzvV2pJhObE2ttzLYLleGmeagVxQfzfKLnGyp ZUy9yjw6yZU4eyjG14sa6adh+Jy/Q38C2d4jwyijcYu0qFjzsfckwjcWrNvuVGrLjLou 1pz61XPinxCY/SkqtxHlU35yoGt2qcsV1w7LpXT9ObkgbE19gbeUCc0kxwZlnpMuU3Ea sOkP7YrmcebDvjmBBeB29qA8nILy0WdhNnewXMQzuHiX7I2myXTUcMfkYGdtu6EnRKlR QVmw== X-Gm-Message-State: AOJu0YxWUqZjLCqvhTvdj5pcgZKU47tb47FHJvan2ugBs6z0mViU5gzw fgZbCkdR1UcPuDpeNesnG8lPcMhBA3i0gId57qTL+Dio43xljdzjXmUqSkotbeCYGZq+gdq8ULZ e4zwPViJIkbERn1uwQ591jerrQwTb7g== X-Google-Smtp-Source: AGHT+IFejcpRw7e63LFk1OQF6c6NxoCUaWq+oXsWep/RoPz0BTpBqueNbfjNzwi0oBjCpEPc/3Sh73p4848D6m4iMdk= X-Received: by 2002:a05:6871:5b17:b0:250:8913:740a with SMTP id 586e51a60fabf-25464455fd6mr12324536fac.4.1718051165146; Mon, 10 Jun 2024 13:26:05 -0700 (PDT) MIME-Version: 1.0 References: <7da8ec9-089-74ce-eb3-c88889b62c64@appl-ecosys.com> In-Reply-To: From: Ron Johnson Date: Mon, 10 Jun 2024 16:25:54 -0400 Message-ID: Subject: Re: Multiple tables row insertions from single psql input file To: pgsql-general Content-Type: multipart/alternative; boundary="000000000000679874061a8ef5d1" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000679874061a8ef5d1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jun 10, 2024 at 4:06=E2=80=AFPM Rich Shepard wrote: > On Mon, 10 Jun 2024, Ron Johnson wrote: > > > With enough clever scripting you can create a .sql file that does almos= t > > anything. > > Ron, > > My projects don't all use SQL so I'm far from a clever scripter. :-) > No one is born a scripter, much less a clever scripter. > > Most useful to you will be some number of "ALTER TABLE DISABLE > > TRIGGER ALL;" statements near the beginning of the file, and their "ALT= ER > > TABLE ... ENABLE TRIGGER ALL;" counterparts near the end of the file. > > Doesn't alter table primarily apply to existing row values for specific > columns rather than inserting new rows and their column values? > I don't think so. For example, pg_dump has an option to add those DISABLE/ENABLE TRIGGER statements. It makes bulk loading of records much simpler. --000000000000679874061a8ef5d1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Jun 10, 2024 at 4:06=E2=80=AFPM R= ich Shepard <rshepard@appl-e= cosys.com> wrote:
On Mon, 10 Jun 2024, Ron Johnson wrote:=

> With enough clever scripting you can create a .sql file that does almo= st
> anything.

Ron,

My projects don't all use SQL so I'm far from a clever scripter. :-= )

No one is born a scripter, much less = a clever scripter.
=C2=A0
> Most useful to you will be some number of "ALTER = TABLE <foo> DISABLE
> TRIGGER ALL;" statements near the beginning of the file, and thei= r "ALTER
> TABLE ... ENABLE TRIGGER ALL;" counterparts near the end of the f= ile.

Doesn't alter table primarily apply to existing row values for specific=
columns rather than inserting new rows and their column values?

I don't think=C2=A0so.=C2=A0 For example, pg_d= ump has an option to add those DISABLE/ENABLE TRIGGER=C2=A0 statements.=C2= =A0 It makes bulk loading of records much simpler.

--000000000000679874061a8ef5d1--