Re: Fwd: Problem with a "complex" upsert

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mario De Frutos Dieguez <mariodefrutos(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Fwd: Problem with a "complex" upsert
Date: 2018-06-21 17:05:53
Message-ID: 18795.1529600753@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-bugs

Mario De Frutos Dieguez <mariodefrutos(at)gmail(dot)com> writes:
> I'm trying to do an upsert to an updatable view with the following SQL
> query:
> ...
> If I don't get any conflict everything works as intended but if we hit a
> conflict then I get the following error message:
> ERROR: attribute 2 of type record has the wrong type
> DETAIL: Table has type character varying, but query expects double
> precision.

When filing a bug report, it's a good idea to provide both a self-
contained test case and a mention of what PG version you're using.

I guess from the ROW() syntax you used here, which isn't accepted pre-v10,
that you're using 10.0 or later, but that's not specific enough.

I tried to duplicate this problem using the attached script, but it
works for me.

FWIW, that error message definitely looks like a bug, but I can't
tell whether it's an already-fixed bug or there's some triggering
detail you didn't mention.

regards, tom lane

Attachment Content-Type Size
this-test-case-doesnt-fail.sql text/plain 1.0 KB

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jorge Daniel 2018-06-21 18:32:02 Unknown Process DETAIL: Failed process was running: LISTEN dirty
Previous Message Peter Geoghegan 2018-06-21 16:55:11 Re: Problem with a "complex" upsert

Browse pgsql-bugs by date

  From Date Subject
Next Message Amit Langote 2018-06-22 08:11:23 Re: Fwd: Problem with a "complex" upsert
Previous Message Peter Geoghegan 2018-06-21 16:55:11 Re: Problem with a "complex" upsert