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

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

我正在学习 Aqueduct(dart 的网络服务框架)教程 (https://aqueduct.io/docs/tut/executing-queries/),然后当我尝试 运行 这个命令时

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

我收到一个错误:

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)

我不明白这是怎么回事,有人可以帮助我吗? 谢谢

如果你是 运行 postgresql 9.5 或更早版本,你会得到这个错误。升级到 9.6。

Aqueduct 保留 table 来跟踪您的数据库迁移历史和当前版本。它使用 pg9.6 中引入的函数来检查 table 是否存在。