diff --git a/postgresql-async/src/main/scala/com/github/mauricio/async/db/postgresql/column/ColumnTypes.scala b/postgresql-async/src/main/scala/com/github/mauricio/async/db/postgresql/column/ColumnTypes.scala index 945b3019..e9a5e042 100644 --- a/postgresql-async/src/main/scala/com/github/mauricio/async/db/postgresql/column/ColumnTypes.scala +++ b/postgresql-async/src/main/scala/com/github/mauricio/async/db/postgresql/column/ColumnTypes.scala @@ -55,11 +55,12 @@ object ColumnTypes { final val IntervalArray = 1187 final val Boolean = 16 final val BooleanArray = 1000 + final val OID = 26 + final val OIDArray = 1028 final val ByteA = 17 final val ByteA_Array = 1001 - final val OIDArray = 1028 final val MoneyArray = 791 final val NameArray = 1003 final val UUIDArray = 2951 diff --git a/postgresql-async/src/main/scala/com/github/mauricio/async/db/postgresql/column/PostgreSQLColumnDecoderRegistry.scala b/postgresql-async/src/main/scala/com/github/mauricio/async/db/postgresql/column/PostgreSQLColumnDecoderRegistry.scala index 6b6ea7dd..734c0902 100644 --- a/postgresql-async/src/main/scala/com/github/mauricio/async/db/postgresql/column/PostgreSQLColumnDecoderRegistry.scala +++ b/postgresql-async/src/main/scala/com/github/mauricio/async/db/postgresql/column/PostgreSQLColumnDecoderRegistry.scala @@ -67,6 +67,9 @@ class PostgreSQLColumnDecoderRegistry( charset : Charset = CharsetUtil.UTF_8 ) e case ColumnTypes.Integer => IntegerEncoderDecoder case IntegerArray => this.integerArrayDecoder + case OID => LongEncoderDecoder + case OIDArray => this.longArrayDecoder + case ColumnTypes.Numeric => BigDecimalEncoderDecoder case NumericArray => this.bigDecimalArrayDecoder @@ -103,7 +106,6 @@ class PostgreSQLColumnDecoderRegistry( charset : Charset = CharsetUtil.UTF_8 ) e case Interval => PostgreSQLIntervalEncoderDecoder case IntervalArray => this.intervalArrayDecoder - case OIDArray => this.stringArrayDecoder case MoneyArray => this.stringArrayDecoder case NameArray => this.stringArrayDecoder case UUIDArray => this.stringArrayDecoder diff --git a/postgresql-async/src/test/scala/com/github/mauricio/async/db/postgresql/PostgreSQLConnectionSpec.scala b/postgresql-async/src/test/scala/com/github/mauricio/async/db/postgresql/PostgreSQLConnectionSpec.scala index d1681586..47724a24 100644 --- a/postgresql-async/src/test/scala/com/github/mauricio/async/db/postgresql/PostgreSQLConnectionSpec.scala +++ b/postgresql-async/src/test/scala/com/github/mauricio/async/db/postgresql/PostgreSQLConnectionSpec.scala @@ -53,7 +53,7 @@ class PostgreSQLConnectionSpec extends Specification with DatabaseTestHelper { time_column time, boolean_column boolean, constraint bigserial_column_pkey primary key (bigserial_column) - )""" + ) with oids""" val insert = """insert into type_test_table ( smallint_column, @@ -83,7 +83,7 @@ class PostgreSQLConnectionSpec extends Specification with DatabaseTestHelper { ) """ - val select = "select * from type_test_table" + val select = "select *, oid from type_test_table" val preparedStatementCreate = """create temp table prepared_statement_test ( id bigserial not null, @@ -151,6 +151,8 @@ class PostgreSQLConnectionSpec extends Specification with DatabaseTestHelper { row(10) === DateEncoderDecoder.decode("1984-08-06") row(11) === TimeEncoderDecoder.Instance.decode("22:13:45.888888") row(12) === true + row(13) must beAnInstanceOf[java.lang.Long] + row(13).asInstanceOf[Long] must beGreaterThan(0L) }