Peter B

Results 19 comments of Peter B

You need to await, or return your promises: ```js await db.pgTest({}).then (/* ... */) return db.any(sql).then (/* ... */) ```

For what it worth, the parsed `Date` object returns the expected values for `.getFullYear()`, `.getMonth()` and `.getDate()`. Unfortunately, that doesn't matter, if the value is serialized to string before using...

Alternatively you could create a new pool for every request, and clean it up every time. This makes the error handling somewhat easier. Did you handle errors on `client.connect()` in...

Btw, there is no concurrent client sharing in this case (and the `poolUsageCount` would always be 0 at the end of @sehrope's handler), because the AWS Lambda will only send...

If the library would expose the [`types` parameter](https://github.com/brianc/node-postgres/issues/2219#issuecomment-629416234) for prepared statements, there might be a way to do conditional serialization based on the type. The API could look something like...

The workaround provided in https://github.com/brianc/node-postgres/issues/2012#issuecomment-607463882 only works for them, because they do not use any SQL array inputs. The `jsonb ?| text[] → boolean` [operator](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSONB-OP-TABLE) expects an SQL `text` array...

For listen/notify connections I use this pattern: ```js function randomBetween(min, max) { return Math.floor(Math.random() * (max - min + 1) + min); } function *backoff() { let sleep = initialDelay;...

I'm not sure, what changes in the library would have surfaced this issue. Could it be, that there were other changes (different OS) in your environment? This sounds to me,...

@OTooleMichael It seems OK to me. (Disclaimer: I'm not an expert; these are just my thoughts on the topic.) Related discussions: [pgsql-odbc](https://www.postgresql.org/message-id/flat/OF33DF00A3.D6444835-ON432582C3.003EA7C5-432582C3.0045562B%40iba.by), [pgsql-hackers/1](https://www.postgresql.org/message-id/flat/OF4C8A68CE.A350F319-ON432582D0.0028A5FF-432582D0.002FEE28%40iba.by), [pgsql-hackers/2](https://www.postgresql.org/message-id/flat/EDA4195584F5064680D8130B1CA91C45367328%40G01JPEXMBYT04) TLDR: it's not a solved problem,...

I don't think postgres supports canceling / aborting a specific query. Is the best we can do is to tell postgres to try to cancel whatever query is being executed...