Re: Overlapping timestamptz ranges with priority

2021-07-03 Thread Ray O'Donnell
On 03/07/2021 21:13, Adrian Klaver wrote: On 7/3/21 12:16 PM, Ray O'Donnell wrote: Yes, you're right - I realised that after I sent my last email. The inner loop in the function should have matched overlapping bookings by aircraft registration: -- For each booking, check whether there ar

Re: Overlapping timestamptz ranges with priority

2021-07-03 Thread Adrian Klaver
On 7/3/21 12:16 PM, Ray O'Donnell wrote: On 03/07/2021 18:59, Adrian Klaver wrote: The booking_id for aircraft B2CA with booking_time of  ["2021-07-03 11:00:00-07","2021-07-03 14:00:00-07"] is not accounted for. There is a step missing that accounts for bookings being assigned to a particul

Re: Overlapping timestamptz ranges with priority

2021-07-03 Thread Ray O'Donnell
On 03/07/2021 18:59, Adrian Klaver wrote: I'm not sure this is doing what you think it is; [...]  select * from get_visible_bookings();  booking_id | aircraft_reg | type_code | booking_time | owner_uid | owner_name +--+---+--

Re: Overlapping timestamptz ranges with priority

2021-07-03 Thread Adrian Klaver
On 7/3/21 9:32 AM, Ray O'Donnell wrote: On 27/06/2021 23:41, Ray O'Donnell wrote: Hi all, I'm playing with timestamptz ranges for a hobby project. I have a table with a tstzrange column, in which the timestamps can overlap; where they do, rows with a higher priority (derived from a bigint prima

Re: Doubt on pgbouncer

2021-07-03 Thread Ben Chobot
Rama Krishnan wrote on 7/3/21 8:35 AM: Hi Team, How can I split read and write queries using pgbouncer You do it with your application. Make a pgbouncer database for read/write queries and point it at your postgresql primary, and then make a second pgbouncer database for read-only queries a

Re: Doubt on pgbouncer

2021-07-03 Thread Rama Krishnan
Hi Bruce Thank you for the clarification. Can you pls share any links or docs about my doubt that can be helpful for me further information On Sat, 3 Jul, 2021, 21:21 Bruce Momjian, wrote: > On Sat, Jul 3, 2021 at 09:05:58PM +0530, Rama Krishnan wrote: > > > > Hi Team, > > > > How can I split

Re: Overlapping timestamptz ranges with priority

2021-07-03 Thread Ray O'Donnell
On 27/06/2021 23:41, Ray O'Donnell wrote: Hi all, I'm playing with timestamptz ranges for a hobby project. I have a table with a tstzrange column, in which the timestamps can overlap; where they do, rows with a higher priority (derived from a bigint primary key column) should be picked. What I'

Re: Doubt on pgbouncer

2021-07-03 Thread Bruce Momjian
On Sat, Jul 3, 2021 at 09:05:58PM +0530, Rama Krishnan wrote: > > Hi Team, > > How can I split read and write queries using pgbouncer No. I think only PgPool can do that because it parses the SQL. -- Bruce Momjian https://momjian.us EDB https

Doubt on pgbouncer

2021-07-03 Thread Rama Krishnan
Hi Team, How can I split read and write queries using pgbouncer Regards A.Rama Krishnan Virus-free. www.avast.com

Re: Overlapping timestamptz ranges with priority

2021-07-03 Thread Ray O'Donnell
On 29/06/2021 22:49, Adrian Klaver wrote: If I'm following correctly then: 1) Under old system there where preset two hour slots over a day period, where the period was say 8:00 to 16:00 2) You now want to allow user defined two hour slots over the same period, where a slot can't start befor