Re: Return rows in input array's order?

2023-05-09 Thread David Wheeler
>> It was only used for small arrays but never noticed any performance issues > > Hmmm, sounds like this would be quadratic though... True, but it’s cpu time not io, which tends to be orders of magnitude slower > I wonder whether the int[] can be turned into a pseudo table with a ROWNUM > ext

Re: Return rows in input array's order?

2023-05-09 Thread David Wheeler
> Hi. With an integer identity primary key table, > we fetch a number of rows with WHERE id = ANY($1), > with $1 an int[] array. The API using that query must return > rows in the input int[] array order, and uses a client-side > mapping to achieve that currently. > > Is it possible to maintain

Re: what happens if a failed transaction is not rolled back?

2023-04-24 Thread David Wheeler
> On 25 Apr 2023, at 1:47 am, David G. Johnston > wrote: > > There isn't anything special about a failed transaction compared to any other > transaction that you leave open. Now I’m curious. Does it have the same impact on performance that an idle in transaction connection has? Eg does it p

IS as a binary operator

2023-02-25 Thread david wheeler
t for `IS` as basically an alias for `IS NOT DISTINCT FROM`? (and `IS NOT` for `IS DISTINCT FROM`) TIA David Wheeler [1] https://github.com/cashapp/sqldelight/issues/3863

Re: How to avoid Trigger ping/pong / infinite loop

2023-02-16 Thread David Wheeler
>> Are there techniques for situations like this? Just have two triggers, one for each column, and ensure that if your trigger doesn’t change the value then it doesn’t do an update on the other column. Each time you do update both triggers will run but only one will make a change, so that will

Re: Permission inconsistency with views that call functions

2021-02-23 Thread David Wheeler
id On 24/2/21, 2:41 am, "Joe Conway" wrote: On 2/22/21 10:32 PM, David Wheeler wrote: > I’m seeing some inconsistency with how permissions are enforced within views. > In > particular, if the view accesses a table directly, then the table is > accessible, > however if the vi

Permission inconsistency with views that call functions

2021-02-23 Thread David Wheeler
possible) or granting access to the “hidden” schema? Thanks in advance! Best regards, David Wheeler, Inomial Architect E. dwhee...@dgitsystems.com<mailto:dwhee...@dgitsystems.com> 313 La Trobe Street, Victoria 3000, Australia +61 3 8820 5200 MELBOURNE . DENPASAR . AUCKLAND WWW.DGITSYSTEMS.COM&

Re: Connection terminated but client didn't realise

2019-12-02 Thread David Wheeler
3h), so I think the next step is to try to identify the connection at the OS level with netstat to see what state it's in. Thanks for your help. Regards, David On 2/12/19, 11:17 pm, "Tom Lane" wrote: David Wheeler writes: > We have a query that our system r

Materialized view breaks pg_restore

2019-03-21 Thread David Wheeler
part of our disaster recovery process, so if we find this problem during restore it will mean more downtime. PG version 9.5.14. I’m attempting to find out now if it’s an issue in more recent versions also. TIA David Wheeler Software developer [cid:2C4D0888-9F8B-463F-BD54-2B60A322210C] E dwhe

Re: Deadlock with 2 processes waiting on transactionids and locking unrelated tables

2018-02-19 Thread David Wheeler
her than one of them being a row lock. Thanks for your help! Cheers, -- David <http://www.inomial.com/> <http://www.inomial.com/>David Wheeler • software engineer Inomial Pty Ltd • Automatic Billing <http://www.inomial.com/> p +61 3 9663 3554 <http://www.linkedin.com

Re: Deadlock with 2 processes waiting on transactionids and locking unrelated tables

2018-02-19 Thread David Wheeler
mmitted > Do the updates run in a transaction among other read / write operations > within the same transaction ? Yes they will both have many reads and writes before running the deadlocking query. Cheers, -- David <http://www.inomial.com/> <http://www.inomial.com/&g

Deadlock with 2 processes waiting on transactionids and locking unrelated tables

2018-02-18 Thread David Wheeler
(7 rows) TIA Cheers, -- David <http://www.inomial.com/> <http://www.inomial.com/>David Wheeler • software engineer Inomial Pty Ltd • Automatic Billing <http://www.inomial.com/> p +61 3 9663 3554 <http://www.linkedin.com/company/inomial-pty-ltd> <https://www.facebook.com/Inomial> <https://twitter.com/inomial> <https://twitter.com/inomial>