Search Postgresql Archives

Saw some strange behavior when using `INSERT ON CONFLICT` inside a transaction.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Repro steps:
I created the table:
```
create table t (col TEXT primary key);
```

Open two database consoles and use the following queries in them:

```
1 begin;
2 select txid_current();
3 insert into t (col) values ('test') on conflict (col) do nothing;
4 commit;
```

I ran 1 and 2 in both. It worked for both.
And then I ran query 3 in the first console. It worked.
After that I ran query 3 in the second console. It got stuck!
When I commit the tx in first console, the stuck query in second console finishes
The transaction isolation level is 'read committed'. 

--
Best Regards
Sagar Tiwari

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux