Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cbFLV-0004fT-Pj for pgsql-bugs@arkaria.postgresql.org; Tue, 07 Feb 2017 23:38:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cbFLV-0001lD-Cn for pgsql-bugs@arkaria.postgresql.org; Tue, 07 Feb 2017 23:38:49 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cbF50-00074z-Do for pgsql-bugs@postgresql.org; Tue, 07 Feb 2017 23:21:46 +0000 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cbF4w-0006Yi-Qd for pgsql-bugs@postgresql.org; Tue, 07 Feb 2017 23:21:45 +0000 Received: by mail-wr0-x242.google.com with SMTP id 89so6886184wrr.1 for ; Tue, 07 Feb 2017 15:21:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=vbD8XZzHAxKkyaUWYp1qSL9KKMeF9uf8fVTOaERx41o=; b=E1QeadzSBvfGfeb+g9uXPx3cS1NxOJpBR+eJFfdzBTlugVx/Pn221rznsj+6qcIp6C dKmI3u+DhCN1PvSehEK7hz2Ph1pKOli4UoAFWX/zwZWfEPYh3oyBukXO7jJBytdLp0gq C9E/f5OuNT/Ys6aWYDN0n8Y1N3JFkDCqEWg4OBoELhU/k1aWDFfO6Yv+7p3Glxl6PfDw w/UCv1fVSbn1WUQcS7F6QhAsUcvPmcmrroAyt+3XSt678k8fHHQtnLaxLYza0c1//rVI poABa3UjdJevggWCqhYRa3VjkjRYTW8yuvYI/OLrYBeFnKUT8qUhEziz4WqiYhg2ctE0 aS2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=vbD8XZzHAxKkyaUWYp1qSL9KKMeF9uf8fVTOaERx41o=; b=psFpkLW3JhNVAfGs01w//+n7EseOVKntGxUkgvZA7WeelHA/FtXsNMe+Ql0rb0N2HH 76KPLfIMdlVcALPy2pYf0NO1VC1DrXXfEsaabeXZJW+xA4r+lGM14rBCSko+9UmS6KmP c5w0w6b1PxDrVRBslmI1zMMwXdg/TyD38VUXVo6WHPg/5gqEq/iNDqvtSNB8JCIDvHdV AuAMZefe90t6pVCsvGiRMGZchroov2hvGbYBkNYJhln5klk70ZYqhPjgRT20K99bbLPm ORNMOuGuzGOqErisSkSH7sXjZWMlpgaFYSVxirIciDk3CXKs3cfxWC+r8lS0AnXUkMMh WbMA== X-Gm-Message-State: AIkVDXJ4yE3jpTlhKQhGGMip1MrVwn2KZ7hSeGwn/DpJW4GmgEDBvUBjbO6Je46AFCnktA== X-Received: by 10.223.140.18 with SMTP id z18mr12197788wra.6.1486509701114; Tue, 07 Feb 2017 15:21:41 -0800 (PST) Received: from [192.168.0.103] (a109-51-13-153.cpe.netcabo.pt. [109.51.13.153]) by smtp.gmail.com with ESMTPSA id z67sm9773487wrb.49.2017.02.07.15.21.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Feb 2017 15:21:40 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: BUG #14526: no unique or exclusion constraint matching the ON CONFLICT From: Tiago Babo In-Reply-To: Date: Tue, 7 Feb 2017 23:21:39 +0000 Cc: Tom Lane , pgsql-bugs@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20170202140701.1401.31196@wrigleys.postgresql.org> <166D0A9D-162D-4216-9490-3163533166C1@gmail.com> <14575.1486493671@sss.pgh.pa.us> <499844AD-291B-40F5-9892-E5591736FD2E@gmail.com> <22106.1486500247@sss.pgh.pa.us> To: Peter Geoghegan X-Mailer: Apple Mail (2.3259) X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The only difference (so it seems), is that when it crashes, the person was = created in the seconds before creating the account. When it previously exis= ts in the persons table, it never gives the error. Working example: INSERT INTO accounts (type, person_id, created_at, updated_at) VALUES (=E2=80=98PersonAccount', 137842, '2017-02-07 23:17:37.61', '2017-02= -07 23:17:37.61') ON CONFLICT (type, person_id) WHERE type =3D =E2=80=98PersonAccount' DO UPD= ATE SET updated_at =3D EXCLUDED.updated_at RETURNING * > On 7 Feb 2017, at 22:17, Peter Geoghegan wrote: >=20 > On Tue, Feb 7, 2017 at 2:15 PM, Tiago Babo wrote: >> Here is an example where it gives the error (I excluded the created_at a= nd >> updated_at columns in the last e-mail, but they do exist in the table): >>=20 >> INSERT INTO accounts (type, person_id) VALUES ('PersonAccount', 69559, >> '2017-02-03 12:09:27.259', '2017-02-03 12:09:27.259') ON CONFLICT (type, >> person_id) WHERE type =3D 'PersonAccount' DO UPDATE SET updated_at =3D >> EXCLUDED.updated_at RETURNING * >=20 > Can you give an example of where it does actually work? Is there any > discernible pattern to what each case looks like? >=20 >=20 > --=20 > Peter Geoghegan --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs