loopbackio/loopback-connector-postgresql

varchar[] doesn't work

etodanik opened this issue · 1 comments

Steps to reproduce

  1. Set up a model with a varchar[] field:
  @property({
    type: 'array',
    itemType: 'string',
    postgresql: {
      columnName: "roles",
      dataType: "varchar[]",
      nullable: "YES"
    }
  })
  roles?: string[];
  1. Try to save something.

Current Behavior

Unhandled error in POST /users: 500 error: malformed array literal: "["customer"]"
    at Connection.parseE (/Users/danny/src/ecommin-api/node_modules/pg/lib/connection.js:581:48)
    at Connection.parseMessage (/Users/danny/src/ecommin-api/node_modules/pg/lib/connection.js:380:19)
    at Socket.<anonymous> (/Users/danny/src/ecommin-api/node_modules/pg/lib/connection.js:116:22)
    at Socket.emit (events.js:198:13)
    at addChunk (_stream_readable.js:288:12)
    at readableAddChunk (_stream_readable.js:269:11)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

Expected Behavior

Supposed to save an array of strings

Related Issues

Could this be related?
#428

This should be fixed in #428. The patched has been released in version 5.0.1. Thanks!