public inbox for [email protected]  
help / color / mirror / Atom feed
Re: Multiple tables row insertions from single psql input file
2+ messages / 2 participants
[nested] [flat]

* Re: Multiple tables row insertions from single psql input file
@ 2024-06-10 20:06  Rich Shepard <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Rich Shepard @ 2024-06-10 20:06 UTC (permalink / raw)
  To: pgsql-generallists.postgresql.org <[email protected]>

On Mon, 10 Jun 2024, Ron Johnson wrote:

> With enough clever scripting you can create a .sql file that does almost
> anything.

Ron,

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

> Most useful to you will be some number of "ALTER TABLE <foo> DISABLE
> TRIGGER ALL;" statements near the beginning of the file, and their "ALTER
> 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?

Thanks,

Rich






^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Multiple tables row insertions from single psql input file
@ 2024-06-10 20:25  Ron Johnson <[email protected]>
  parent: Rich Shepard <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Ron Johnson @ 2024-06-10 20:25 UTC (permalink / raw)
  To: pgsql-general

On Mon, Jun 10, 2024 at 4:06 PM Rich Shepard <[email protected]>
wrote:

> On Mon, 10 Jun 2024, Ron Johnson wrote:
>
> > With enough clever scripting you can create a .sql file that does almost
> > 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 <foo> DISABLE
> > TRIGGER ALL;" statements near the beginning of the file, and their "ALTER
> > 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.


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2024-06-10 20:25 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-06-10 20:06 Re: Multiple tables row insertions from single psql input file Rich Shepard <[email protected]>
2024-06-10 20:25 ` Ron Johnson <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox