ON CONFLICT issie detected

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ON CONFLICT issie detected

Irina Mileva

 

 

From: Daniel Topalov
Sent: 21 April 2017 14:25
To: Irina Mileva
Subject: ON CONFLICT issue detected

 

“ON CONFLICT (columnName) DO UPDATE” do NOT works with FOREIGN TABLES

Returns:

“ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification”

 

“ALTER FOREIGN TABLE tableName

    ADD CONSTRAINT ConstName UNIQUE (columnName);”

Returns:

“ERROR: unique constraints are not supported on foreign tables”

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ON CONFLICT issie detected

Peter Geoghegan-4
On Fri, Apr 21, 2017 at 4:40 AM, Irina Mileva <[hidden email]> wrote:
> “ON CONFLICT (columnName) DO UPDATE” do NOT works with FOREIGN TABLES
>
> Returns:
>
> “ERROR: there is no unique or exclusion constraint matching the ON CONFLICT
> specification”

It's unsupported, because there is no such thing as a foreign unique
constraint. Only ON CONFLICT DO NOTHING will work against a foreign
table, and only when an arbiter constraint is not inferred.

See the docs on INSERT.


--
Peter Geoghegan

VMware vCenter Server
https://www.vmware.com/


--
Sent via pgsql-bugs mailing list ([hidden email])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ON CONFLICT issie detected

Irina Mileva
Many thanks!

Sent with AquaMail for Android
http://www.aqua-mail.com


On 21 април 2017 г. 19:15:58 Peter Geoghegan <[hidden email]> wrote:

> On Fri, Apr 21, 2017 at 4:40 AM, Irina Mileva <[hidden email]> wrote:
>> “ON CONFLICT (columnName) DO UPDATE” do NOT works with FOREIGN TABLES
>>
>> Returns:
>>
>> “ERROR: there is no unique or exclusion constraint matching the ON CONFLICT
>> specification”
>
> It's unsupported, because there is no such thing as a foreign unique
> constraint. Only ON CONFLICT DO NOTHING will work against a foreign
> table, and only when an arbiter constraint is not inferred.
>
> See the docs on INSERT.
>
>
> --
> Peter Geoghegan
>
> VMware vCenter Server
> https://www.vmware.com/


--
Sent via pgsql-bugs mailing list ([hidden email])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Previous Thread Next Thread
Loading...