Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1chZ-00045j-Im for pgsql-sql@arkaria.postgresql.org; Wed, 06 Mar 2019 19:59:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h1chY-0007JC-97 for pgsql-sql@arkaria.postgresql.org; Wed, 06 Mar 2019 19:59:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1chX-0007J5-J9 for pgsql-sql@lists.postgresql.org; Wed, 06 Mar 2019 19:59:40 +0000 Received: from server.dayspringpublisher.com ([108.179.223.62]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1chR-0004oX-Pb for pgsql-sql@lists.postgresql.org; Wed, 06 Mar 2019 19:59:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dayspringpublisher.com; s=default; h=Content-Type:MIME-Version:Date: Message-ID:Subject:From:To:Sender:Reply-To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4AVk2GPi5V4FlGwuGS7W+M8Gk8LTdS9NlNmy2vN+zM4=; b=G9jAMczCv0s+IWMWKnVRAJXji zRK/LL+QJuyu8Sv49IPg2Nv8MvCFkoDRNIdimeXDZ6mzDF0pVlnS0jzzo2DFwPM4aVLJHhCMWb+ei jkwFawbvm+W4s6ywKxsxiBtU0F; Received: from [104.218.91.150] (port=43934 helo=[192.168.1.9]) by server.dayspringpublisher.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1h1chN-0005R3-QW for pgsql-sql@lists.postgresql.org; Wed, 06 Mar 2019 12:59:29 -0700 To: pgsql-sql@lists.postgresql.org From: Lou Subject: INSERT / UPDATE into 2 inner joined table simultaneously Message-ID: <38a1b75c-2a29-5833-cbd6-6b76dca019da@dayspringpublisher.com> Date: Wed, 6 Mar 2019 13:59:22 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------A5CCE3E18589FFB319AECDD8" Content-Language: en-US X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server.dayspringpublisher.com X-AntiAbuse: Original Domain - lists.postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - dayspringpublisher.com X-Get-Message-Sender-Via: server.dayspringpublisher.com: authenticated_id: lou@dayspringpublisher.com X-Authenticated-Sender: server.dayspringpublisher.com: lou@dayspringpublisher.com X-Source: X-Source-Args: X-Source-Dir: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------A5CCE3E18589FFB319AECDD8 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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 --------------A5CCE3E18589FFB319AECDD8 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

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

--------------A5CCE3E18589FFB319AECDD8--