pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: grygoriy.gonchar@kreditech.com
To: pgsql-bugs@postgresql.org
Subject: BUG #14397: Updatable VIEW doesn't work with ON CONFLICT from PgPreparedStatement
Date: Wed, 26 Oct 2016 09:24:23 +0000
Message-ID: <20161026092423.1423.90821@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      14397
Logged by:          Grygoriy Gonchar
Email address:      grygoriy.gonchar@kreditech.com
PostgreSQL version: 9.5.4
Operating system:   x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 4.8.2
Description:        

I have a view defined as:
CREATE OR REPLACE VIEW TEST AS SELECT * FROM TEST_1 WITH CASCADED CHECK
OPTION;

This is necessary to abstract from table name while application code is
working via view name (to implement a kind of simple partitioning)

When I run the following query on view:
 
   insert into test (c1, c2, c3) values (?, ?, ?) on conflict (c1, c2) do
update set c3=excluded.c3

I get the following error:

An exception or error caused a run to abort: ERROR: ON CONFLICT is not
supported on table "test" used as a catalog table
  Position: 98 
org.postgresql.util.PSQLException: ERROR: ON CONFLICT is not supported on
table "encrypted_value" used as a catalog table
  Position: 98
	at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2310)
	at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2023)
	at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:217)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:421)
	at
org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:166)
	at
org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:137)

If I run the same query without prepared statement from command line all
works fine

If I run the same query on table directly all works fine both from command
line and PgPreparedStatement

Looks to me like a bug with PgPreparedStatement


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


view thread (5+ messages)  latest in thread

Message-ID: <20161026092423.1423.90821@wrigleys.postgresql.org>
Permalink:  ../20161026092423.1423.90821@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20161026092423.1423.90821@wrigleys.postgresql.org

 · 

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-bugs@postgresql.org
  Cc: grygoriy.gonchar@kreditech.com
  Subject: Re: BUG #14397: Updatable VIEW doesn't work with ON CONFLICT from PgPreparedStatement
  In-Reply-To: <20161026092423.1423.90821@wrigleys.postgresql.org>
  References: <20161026092423.1423.90821@wrigleys.postgresql.org>

* 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