chr.pt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # Test status codes for the chr function
  2. # NOTE: Postgres does not send the RowDescription messages for these queries,
  3. # while we do. This is why we ignore all RowDescription messages.
  4. # NullCharacterNotPermitted maps to 54000
  5. send
  6. Query {"query": "SELECT chr(0)"}
  7. ----
  8. until ignore=RowDescription
  9. ReadyForQuery
  10. ----
  11. ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"54000"},{"typ":"M","value":"null character not permitted"}]}
  12. ReadyForQuery {"status":"I"}
  13. # CharacterNotValidForEncoding maps to 54000
  14. send
  15. Query {"query": "SELECT chr(55296)"}
  16. ----
  17. until ignore=RowDescription
  18. ReadyForQuery
  19. ----
  20. ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"54000"},{"typ":"M","value":"requested character not valid for encoding: 55296"}]}
  21. ReadyForQuery {"status":"I"}
  22. # CharacterTooLargeForEncoding maps to 54000
  23. send
  24. Query {"query": "SELECT chr(1114112)"}
  25. ----
  26. until ignore=RowDescription
  27. ReadyForQuery
  28. ----
  29. ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"54000"},{"typ":"M","value":"requested character too large for encoding: 1114112"}]}
  30. ReadyForQuery {"status":"I"}