pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Lou <lou@dayspringpublisher.com>
To: pgsql-sql@lists.postgresql.org
Subject: INSERT / UPDATE into 2 inner joined table simultaneously
Date: Wed, 6 Mar 2019 13:59:22 -0600
Message-ID: <38a1b75c-2a29-5833-cbd6-6b76dca019da@dayspringpublisher.com> (raw)

Hi everyone,

This is my first post here.

I have two tables named c and p. When using SELECT, they are linked
using an INNER JOIN like in this example: "SELECT * FROM c INNER JOIN p
ON c.id = p.c_id WHERE name = 'Jones';"

How can I INSERT new rows into both tables simultaneously with
automatically created id numbers, and how can I UPDATE both tables
simultaneously?

Lou

view thread (6+ messages)  latest in thread

Message-ID: <38a1b75c-2a29-5833-cbd6-6b76dca019da@dayspringpublisher.com>
Permalink:  ../38a1b75c-2a29-5833-cbd6-6b76dca019da@dayspringpublisher.com/
Also on:    postgresql.org/message-id/38a1b75c-2a29-5833-cbd6-6b76dca019da@dayspringpublisher.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: lou@dayspringpublisher.com, pgsql-sql@lists.postgresql.org
  Subject: Re: INSERT / UPDATE into 2 inner joined table simultaneously
  In-Reply-To: <38a1b75c-2a29-5833-cbd6-6b76dca019da@dayspringpublisher.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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