Please allow log_error_verbosity to = default instead of terse
The current setting for all neon databases is log_error_verbosity = terse. The problem with this is that a dev can't get info on the table that is causing the error amongst other pieces of info. We had to shut down our use of Neon because of this. I can see why it's not set to verbose since that outputs too much info but terse outputs too little. Please consider going to "default" for this setting.
10 Replies
xenial-black•10mo ago
@algads i'm curious, where are you seeing the logs right now?
i'm going to bring this back to the team but want some more info.
unwilling-turquoiseOP•10mo ago
Actually, its not so much the logs that I am interested in but rather the output on error messages when running a query that fails. Postgres can output a lot more than just an error message - ie: COLUMN, CONSTRAINT, DATATYPE, TABLE, SCHEMA among other useful tidbits. Our code actually dives into errors, pulls info from the additional fields, and then looks up appropriate information to generate more specific error info for the dev. With log_error_verbosity set to terse, none of that useful info appears in these properties. With it set to default, the info gets populated. The next level also generates line numbers, etc. but those I do not think you want to expose. See https://www.postgresql.org/docs/current/plpgsql-errors-and-messages.html.
xenial-black•10mo ago
Ah, interesting! Thanks for your reply. I understand better now. Lemme see what I can find.
Ok, we can make this configurable. It can't be configured by the client right now but we can change that and allow this to be configured.
unwilling-turquoiseOP•10mo ago
Awesome!
xenial-black•10mo ago
@algads am i gonna get you back as a customer? 👼
unwilling-turquoiseOP•10mo ago
This was the only reason we moved off for this project, so absolutely!
xenial-black•10mo ago
this seems to be the value that needs to be changed according to our team
support can bump this up to
LOG
(higher level than notice) for you while we rollout the change to make it user configurable.unwilling-turquoiseOP•10mo ago
I just recreated the database. Should I open a ticket with support?
xenial-black•10mo ago
if you run this command:
SET client_min_messages = 'log';
it will change the value for the curren session
and if you run this command: ALTER ROLE neondb_owner SET client_min_messages = 'log'
it will change the value for any session
can you tell me if that works?
The support team is telling me were got mixed up between client_min_messages
and log_error_verbosity
. You can't change error verbosity but that goes to Postgres logging and isn't what you need for your case, you need min_messagesunwilling-turquoiseOP•10mo ago
Now it works exactly like I would expect, BUT it does not look like client_min_messages is doing it. If, for example, I set client_min_messages TO 'error', I still get what I need (see the constraint, schema and table values). I am NOT complaining 😉
error: duplicate key value violates unique constraint "test_pkey" at C:\temp\pgtest\node_modules\pg\lib\client.js:535:17 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async file:///C:/temp/pgtest/index.js:25:16 { length: 177, severity: 'ERROR', code: '23505', detail: 'Key (id)=(1) already exists.', hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: 'public', table: 'test', column: undefined, dataType: undefined, constraint: 'test_pkey', file: 'nbtinsert.c', line: '666', routine: '_bt_check_unique' } Just to be safe, I checked log_error_verbosity and that is set to TERSE. Just to double check, if I run 'SHOW client_min_messages ;" just before I execute the query that outputs the above error: it outputs 'notice'. I also tried it with and without the pooler and same thing. I now get the data even if the client_min_messages is set to notice, or error, or warning.
error: duplicate key value violates unique constraint "test_pkey" at C:\temp\pgtest\node_modules\pg\lib\client.js:535:17 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async file:///C:/temp/pgtest/index.js:25:16 { length: 177, severity: 'ERROR', code: '23505', detail: 'Key (id)=(1) already exists.', hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: 'public', table: 'test', column: undefined, dataType: undefined, constraint: 'test_pkey', file: 'nbtinsert.c', line: '666', routine: '_bt_check_unique' } Just to be safe, I checked log_error_verbosity and that is set to TERSE. Just to double check, if I run 'SHOW client_min_messages ;" just before I execute the query that outputs the above error: it outputs 'notice'. I also tried it with and without the pooler and same thing. I now get the data even if the client_min_messages is set to notice, or error, or warning.