Re: partitions vs indexes

2019-10-03 Thread Enrico Thierbach
On 2 Oct 2019, at 22:16, Michael Lewis wrote: "I would like to convert a table with a primary key into a partitioned setup by a column which is not part of the primary key" That isn't possible. The partition key must be contained by the primary key. That is, the primary key could be site_id,

partitions vs indexes

2019-10-02 Thread Enrico Thierbach
Hello list, I run into some trouble with partitions: I would like to convert a table with a primary key into a partitioned setup by a column which is not part of the primary key. Also, a column might hold a referenece to a parent row. So this is my current table setup, slimmed down:

Re: Trouble matching a nested value in JSONB entries

2018-07-03 Thread Enrico Thierbach
Oleg, 1 | {"group_id": 1} 2 | {“group_id": 1} 3 | {“group_id": 2} 4 | {“group_id": 3} PS: Please note that I am currently at postgres 9.5. An update, if necessary, would be possible though. Upgrade, please ! I have only master 11beta2 right now: select * from qq where js @>

Trouble matching a nested value in JSONB entries

2018-06-20 Thread Enrico Thierbach
Hi list, I have some trouble matching a value in a JSONB object against multiple potential matches. Lets say, I have a table with an id, and a metadata JSONB column, which holds data like the following 1 | {"group_id": 1} 2 | {“group_id": 1} 3 | {“group_id": 2} 4 |

Re: SELECT .. FOR UPDATE: find out who locked a row

2018-03-20 Thread Enrico Thierbach
-- me at github: https://github.com/radiospiel me at linked.in: https://www.linkedin.com/in/radiospiel ​You probably considered this but the queuing mechanism I use doesn't hold locks on records during processing. Workers claim tasks by locking them, setting a claimed flag of some sort,

Re: SELECT .. FOR UPDATE: find out who locked a row

2018-03-16 Thread Enrico Thierbach
Thanks Steven, Evidently my second email got lost somewhere along the way- what you're looking for is an extension called 'pgrowlocks': https://www.postgresql.org/docs/10/static/pgrowlocks.html My prior email on that subject is here:

Re: SELECT .. FOR UPDATE: find out who locked a row

2018-03-15 Thread Enrico Thierbach
https://www.linkedin.com/in/radiospiel On 15 Mar 2018, at 22:12, Melvin Davidson wrote: On Thu, Mar 15, 2018 at 4:48 PM, Stephen Frost <sfr...@snowman.net> wrote: Greetings, * Enrico Thierbach (e...@open-lab.org) wrote: I am using `SELECT * FROM queue ... FOR UPDATE SKIP LOCKED` t

SELECT .. FOR UPDATE: find out who locked a row

2018-03-15 Thread Enrico Thierbach
Hello, I am using `SELECT * FROM queue ... FOR UPDATE SKIP LOCKED` to implement a queueing system. Now I wonder if it is possible, given the id of one of the locked rows in the queue table, to find out which connection/which transaction owns the lock. Any help is greatly appreciated.