Skip to content

Error swallowing when lc_messages on PostgreSQL server is not English #52

@walczakp

Description

@walczakp

Steps to reproduce:

  • set eg. lc_messages = 'Polish_Poland.1250' in postgresql.conf
  • do a tx.querySet with SQL query that generates error on PostgreSQL server side (I tested with foreign key violation)
  • resulting Observable does not emit any error and even tx.commit works fine

After changing lc_messages to lc_messages = 'en_US.UTF-8', Observable emits error just fine. I'm attaching a Wireshark dump with exchange, that was not parsed as an error message (while it should be, see packet 6 - there is an information about error):
pl_no_errors.zip.

Actually, while debugging through library code, I found something that maps error level from answer to some kind of enum. While this can work for English locale, it doesn't for all others: java.lang.IllegalArgumentException: No enum constant com.github.pgasync.impl.message.ErrorResponse.Level.BŁĄD

From what I see, there's no easy way to get non-localized error level for postgres (maybe by mapping SQLCODES), but could your library be changed to at least not swallow the exception?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions