pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alban Hertroys <haramrae@gmail.com>
To: tango ward <tangoward15@gmail.com>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: ON CONFLICT DO UPDATE
Date: Thu, 10 May 2018 11:57:00 +0200
Message-ID: <DF8A2622-3434-464D-A385-33A0BBA81095@gmail.com> (raw)
In-Reply-To: <CAA6wQL+cLH=6+5DRXh31ch8C9vL48cOuvCQsPUuS5_euBaou5Q@mail.gmail.com>
References: <CAA6wQL+Os7BMmowFQqBYLZJdmw6faGn+xbe=OpRa7u7mqC=joQ@mail.gmail.com>
	<8c437506-072c-7829-b649-fd2a4a5ecc69@aklaver.com>
	<CAA6wQL+cLH=6+5DRXh31ch8C9vL48cOuvCQsPUuS5_euBaou5Q@mail.gmail.com>


> On 10 May 2018, at 7:13, tango ward <tangoward15@gmail.com> wrote:

>                          ON CONFLICT (school_system_id,
>                                       student_id,
>                                       campus_name
>                                       ) DO UPDATE
>                               SET school_system_id = excluded.school_system_id,
>                                   student_id = excluded.student_id,
>                                   campus_name = excluded.campus_name

I'm pretty sure this ought to read:
	ON CONFLICT (school_system_id, student_id, campus_name)
	DO
	   UPDATE SET modified = EXCLUDED.modified,
		balance = EXCLUDED.balance,
		balance_as_of = EXCLUDED.balance_as_of

Instead, you were re-assigning the keys (school_system_id, student_id, campus_name) to the same values again.

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.





view thread (8+ messages)  latest in thread

Message-ID: <DF8A2622-3434-464D-A385-33A0BBA81095@gmail.com>
Permalink:  ../DF8A2622-3434-464D-A385-33A0BBA81095@gmail.com/
Also on:    postgresql.org/message-id/DF8A2622-3434-464D-A385-33A0BBA81095@gmail.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: haramrae@gmail.com, tangoward15@gmail.com, adrian.klaver@aklaver.com
  Subject: Re: ON CONFLICT DO UPDATE
  In-Reply-To: <DF8A2622-3434-464D-A385-33A0BBA81095@gmail.com>
  References: <CAA6wQL+Os7BMmowFQqBYLZJdmw6faGn+xbe=OpRa7u7mqC=joQ@mail.gmail.com> <8c437506-072c-7829-b649-fd2a4a5ecc69@aklaver.com> <CAA6wQL+cLH=6+5DRXh31ch8C9vL48cOuvCQsPUuS5_euBaou5Q@mail.gmail.com> <DF8A2622-3434-464D-A385-33A0BBA81095@gmail.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