From: | grygoriy(dot)gonchar(at)kreditech(dot)com |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | BUG #14397: Updatable VIEW doesn't work with ON CONFLICT from PgPreparedStatement |
Date: | 2016-10-26 09:24:23 |
Message-ID: | 20161026092423.1423.90821@wrigleys.postgresql.org |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
The following bug has been logged on the website:
Bug reference: 14397
Logged by: Grygoriy Gonchar
Email address: grygoriy(dot)gonchar(at)kreditech(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Stephen Frost | 2016-10-26 14:17:09 | Re: BUG #14396: grant drop table |
Previous Message | sennirban89 | 2016-10-26 06:57:45 | BUG #14396: grant drop table |