Unable to cast object of type 'System.Byte[]' to type 'System.IConvertible'.Couldn't store <System.Byte[]> in relexternid Column. Expected type is Int32

Issue:

Select * from pg_class results in the below error:

Unable to cast object of type 'System.Byte[]' to type 'System.IConvertible'.Couldn't store <System.Byte[]> in relexternid Column. Expected type is Int32

 

Workaround:

Use the below query instead:

SELECT relname
      , relnamespace
      , reltype
      , relowner
      , relam
      , relfilenode
      , reltablespace
      , relpages
      , reltuples
      , reltoastrelid
      , reltoastidxid
      , relhasindex
      , relisshared
      , relkind
      , relnatts
      , relexternid::BIGINT
      , relisreplicated
      , relispinned
      , reldiststyle
      , relprojbaseid
      , relchecks
      , reltriggers
      , relukeys
      , relfkeys
      , relrefs
      , relhasoids
      , relhaspkey
      , relhasrules
      , relhassubclass
      , relacl
 FROM pg_class;

 

Have more questions? Submit a request

1 Comments

  • 0
    Avatar
    Nathan Griffiths

    This is still an issue as of June 2017...

Please sign in to leave a comment.
Powered by Zendesk