Repository navigation
Conversation
|
|
An easier approach might be to use |
|
I made |
|
Great! When it comes to handling them in code, note that crystal/grafast/dataplan-pg/src/executor.ts Lines 105 to 109 in 65f5704 |
| pool.on("error", (error) => console.error(error)); | ||
| pool.on("connect", (client) => { | ||
| client.on("error", (error) => console.error(error)); | ||
| client.on("notice", (msg) => console.dir(msg)); |
There was a problem hiding this comment.
I'd recommend making these console statements more useful - include more context. Having random objects output without context can be confusing and hard to debug.
There was a problem hiding this comment.
Done in ce361cc. Each handler now logs a label, and a notice prints as PostgreSQL NOTICE: <message> (<where>). I also point to notices on PgClientResult first, since it does not depend on the adaptor.
Add a PostgreSQL notice example to
postgraphile/website/postgraphile/debugging.md.The example shows how to see
raise noticemessages from PL/pgSQL functionson the server. It attaches a
noticelistener to each new pool client andpasses the pool to
makePgService.It also handles pool and client connection errors.
The warning tells the caller to release the pool.
When the caller supplies a pool,
makePgServiceignores connection options.PostgreSQL connection termination checks failed without the error handlers and
passed with both handlers.
Fixes #3040.