Hi,
I faced with issue that driver dont know what to do with warnings that postgres backend throws during connection. Psql works fine, nothing shows and with pgx I'm having trouble to connect at all.
pgconn.go line 326 was changed to this
default:
pgConn.conn.Close()
fmt.Printf("%+v,%T", msg, msg)
return nil, &connectError{config: config, msg: "received unexpected message", err: err}
When i changed code to print what is going on, i received such message
results
&{Severity:WARNING SeverityUnlocalized:WARNING Code:01000 Message:1 temporary files and directories not closed at end-of-transaction Detail: Hint: Position:0 InternalPosition:0 InternalQuery: Where: SchemaName: TableName: ColumnName: DataTypeName: ConstraintName: File:fd.c Line:3021 Routine:CleanupTempFiles UnknownFields:map[]},*pgproto3.NoticeResponseUnable to connect to database: failed to connect to `host=/var/run/postgresql user=postgres database=postgres`: received unexpected message
Can it be handled without error from pgx side?
It can be repsoduced if postgresql parameter will be changed to client_min_messages = debug5 , every connect to db will fail with such error : received unexpected message
example of response with config changed to debug5
results
{"Severity":"DEBUG","SeverityUnlocalized":"DEBUG","Code":"00000","Message":"CommitTransaction(1) name: unnamed; blockState: STARTED; state: INPROGRESS, xid/subid/cid: 0/1/0","Detail":"","Hint":"","Position":0,"InternalPosition":0,"InternalQuery":"","Where":"","SchemaName":"","TableName":"","ColumnName":"","DataTypeName":"","ConstraintName":"","File":"xact.c","Line":5182,"Routine":"ShowTransactionStateRec","UnknownFields":null}
Hi,
I faced with issue that driver dont know what to do with warnings that postgres backend throws during connection. Psql works fine, nothing shows and with pgx I'm having trouble to connect at all.
pgconn.go line 326 was changed to this
When i changed code to print what is going on, i received such message
results&{Severity:WARNING SeverityUnlocalized:WARNING Code:01000 Message:1 temporary files and directories not closed at end-of-transaction Detail: Hint: Position:0 InternalPosition:0 InternalQuery: Where: SchemaName: TableName: ColumnName: DataTypeName: ConstraintName: File:fd.c Line:3021 Routine:CleanupTempFiles UnknownFields:map[]},*pgproto3.NoticeResponseUnable to connect to database: failed to connect to `host=/var/run/postgresql user=postgres database=postgres`: received unexpected messageCan it be handled without error from pgx side?
It can be repsoduced if postgresql parameter will be changed to client_min_messages = debug5 , every connect to db will fail with such error :
received unexpected messageexample of response with config changed to debug5
results{"Severity":"DEBUG","SeverityUnlocalized":"DEBUG","Code":"00000","Message":"CommitTransaction(1) name: unnamed; blockState: STARTED; state: INPROGRESS, xid/subid/cid: 0/1/0","Detail":"","Hint":"","Position":0,"InternalPosition":0,"InternalQuery":"","Where":"","SchemaName":"","TableName":"","ColumnName":"","DataTypeName":"","ConstraintName":"","File":"xact.c","Line":5182,"Routine":"ShowTransactionStateRec","UnknownFields":null}