Bad state: PostgreSQLSeverity.error : Specified parameter types do not match column parameter types in query SELECT to_regclass(@tableName:text)

395

You’ll get this error if you are running postgresql 9.5 or earlier. Upgrade to 9.6.

Aqueduct keeps a table to track your database migration history and current version. It uses a function introduced in pg9.6 to check if that table exists.

Share:
395
Gabriel Pacheco
Author by

Gabriel Pacheco

Updated on December 06, 2022

Comments

  • Gabriel Pacheco
    Gabriel Pacheco over 1 year

    I was following the Aqueduct (dart's web service framework) tutorial (https://aqueduct.io/docs/tut/executing-queries/) and then when i tried to run this command

    aqueduct db upgrade --connect postgres://heroes_user:password@localhost:5432/heroes
    

    i got an error:

    PostgreSQL connecting, heroes_user@localhost:5432/heroes.
    *** Uncaught error
        Bad state: PostgreSQLSeverity.error : Specified parameter types do not match column parameter types in query SELECT to_regclass(@tableName:text) 
      **** Stacktrace
      * #0      __TransactionProxy&Object&_PostgreSQLExecutionContextMixin._enqueue (package:postgres/src/connection.dart:400:24)
      * <asynchronous suspension>
      * #1      __TransactionProxy&Object&_PostgreSQLExecutionContextMixin.query (package:postgres/src/connection.dart:316:12)
      * <asynchronous suspension>
      * #2      PostgreSQLPersistentStore._createVersionTableIfNecessary (package:aqueduct/src/db/postgresql/postgresql_persistent_store.dart:335:34)
      * <asynchronous suspension>
      * #3      PostgreSQLPersistentStore.upgrade.<anonymous closure> (package:aqueduct/src/db/postgresql/postgresql_persistent_store.dart:231:13)
      * <asynchronous suspension>
      * #4      _TransactionProxy.startTransaction (file:///home/gabriel/.pub-cache/hosted/pub.dartlang.org/postgres-1.0.0/lib/src/transaction_proxy.dart:36:22)
      * <asynchronous suspension>
      * #5      _RootZone.runUnary (dart:async/zone.dart:1379:54)
      * #6      _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
      * #7      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
      * #8      Future._propagateToListeners (dart:async/future_impl.dart:671:32)
      * #9      Future._propagateToListeners (dart:async/future_impl.dart:569:9)
      * #10     Future._complete (dart:async/future_impl.dart:476:7)
      * #11     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
      * #12     Query.complete (package:postgres/src/query.dart:140:19)
      * #13     _PostgreSQLConnectionStateBusy.onMessage (file:///home/gabriel/.pub-cache/hosted/pub.dartlang.org/postgres-1.0.0/lib/src/connection_fsm.dart:246:15)
      * #14     PostgreSQLConnection._readData (package:postgres/src/connection.dart:230:47)
      * #15     _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
      * #16     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
      * #17     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
      * #18     _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
      * #19     _StreamController._add (dart:async/stream_controller.dart:639:7)
      * #20     _StreamController.add (dart:async/stream_controller.dart:585:5)
      * #21     _Socket._onData (dart:io/runtime/binsocket_patch.dart:1714:41)
      * #22     _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
      * #23     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
      * #24     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
      * #25     _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
      * #26     _StreamController._add (dart:async/stream_controller.dart:639:7)
      * #27     _StreamController.add (dart:async/stream_controller.dart:585:5)
      * #28     new _RawSocket.<anonymous closure> (dart:io/runtime/binsocket_patch.dart:1276:33)
      * #29     _NativeSocket.issueReadEvent.issue (dart:io/runtime/binsocket_patch.dart:819:14)
      * #30     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
      * #31     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
      * #32     _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:113:13)
      * #33     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:166:5)
    

    I can't understand whats going on, can someone help me? Thanks.