Re: Multitable insert syntax support on Postgres?

From: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
To: Alexandre hadjinlian guerra <alexhguerra(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Multitable insert syntax support on Postgres?
Date: 2022-11-21 05:02:43
Message-ID: CADkLM=fMfuya2_9c6EPShnj6ka-a-UdcQ1otm-HojOCYm-3Fww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 14, 2022 at 7:06 PM Alexandre hadjinlian guerra <
alexhguerra(at)gmail(dot)com> wrote:

> Hello
> Are there any plans to incorporate a formal syntax multitable/conditional
> insert , similar to the syntax below? snowflake does have the same feature
>
> https://oracle-base.com/articles/9i/multitable-inserts
>
> Today, im resorting to a function that receives the necessary parameters
> from the attributes definition/selection area in a sql select query, called
> by each tuple retrieved. A proper syntax show be real cool
>
> Thanks!
>

I'm not aware of any efforts to implement this at this time, mostly because
I don't think it's supported in the SQL Standard. Being in the standard
would change the question from "why" to "why not".

I've used that feature when I worked with Oracle in a data warehouse
situation. I found it most useful when migrating data dumps from mainframes
where the data file contained subrecords and in cases where one field in a
row changes the meaning of subsequent fields in the same row. That may
sound like a First Normal Form violation, and it is, but such data formats
are common in the IBM VSAM world, or at least they were in the data dumps
that I had to import.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Laurenz Albe 2022-11-21 05:07:04 Re: Reducing power consumption on idle servers
Previous Message Tom Lane 2022-11-21 04:46:13 Re: Unstable regression test for contrib/pageinspect