fix(pg): fix binary format buffer handling by faulpeltz · Pull Request #3496 · brianc/node-postgres

@faulpeltz

- change Parser.parseDataRowMessage() to produce a buffer slice instead of a string
- change Result.parseRow() and _parseRowAsArray() to create the string from the buffer slice if not in binary mode

@hjr3

@hjr3

DataRowMessage.fields may now be either a string or a buffer slice
depending on the field format.

this relies on some assumption:

- fieldDescriptions is accurate when parseDataRowmessage is called. we
  make a similar assumption in pg/lib/result.js, so this seems fine.

hjr3