org.postgresql.util.PSQLException

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

Try downgrading PostgresSQL server to 9.5 or update your PostgresSQL driver to 9.4-1211 with the following command: 9.4.1211

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • Error with beef-strike and Armitage
    via GitHub by rayluch
    ,
  • I have an application that invokes Liquibase.update(Contexts contexts, Writer output). I want it to only show the changes and not risk making any changes, hence I set the connection to be read-only: {code} def liquibaseConnection = new JdbcConnection(connection) liquibaseConnection.setReadOnly(true) def liquibase = new Liquibase("my-changelog.xml", resourceAccessor, liquibaseConnection) def contexts = new Contexts() liquibase.update(contexts, getOutputWriter()) {code} However, even though if I instantiate Liquibase with a read-only connection, it still attempts to perform a database update to release the lock: {code} org.postgresql.util.PSQLException: ERROR: cannot execute UPDATE in a read-only transaction at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:302) at liquibase.executor.jvm.JdbcExecutor$1UpdateStatementCallback.doInStatement(JdbcExecutor.java:231) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) at liquibase.executor.jvm.JdbcExecutor.update(JdbcExecutor.java:240) at liquibase.executor.jvm.JdbcExecutor.update(JdbcExecutor.java:214) at liquibase.lockservice.StandardLockService.releaseLock(StandardLockService.java:232) at liquibase.Liquibase.update(Liquibase.java:264) at liquibase.Liquibase.update(Liquibase.java:240) {code} Note that the error only occurs after the updateSQL operation was completed successfully. Even lock acquisition seems to work (probably by not touching the database). For some reason that is unclear to me, it seems that only the release part is failing to work properly with a read-only connection.
    via by Rafael Chaves,
  • Migration from HSQLDB to Postgres may fail with the following exception: {noformat} 2011-10-20 13:56:29,581 ERROR [ThreadPool1 ] fisheye.app com.atlassian.crucible.actions.admin.database.DBEditHelper-doGet - Database migration failed: com.cenqua.crucible.hibernate.CruDBException: Problem with create tables script D:\Atlassian\Fisheye\sql\HSQL\schema\tables_75.sql com.cenqua.crucible.hibernate.CruDBException: Problem with create tables script D:\Atlassian\Fisheye\sql\HSQL\schema\tables_75.sql at com.cenqua.crucible.hibernate.DefaultDBControl.createTables(DefaultDBControl.java:292) at com.atlassian.crucible.migration.item.DBImporter.importData(DBImporter.java:138) at com.atlassian.crucible.actions.admin.database.DBEditHelper$ImportRunner.call(DBEditHelper.java:91) at com.atlassian.crucible.actions.admin.database.DBEditHelper$ImportRunner.call(DBEditHelper.java:73) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: com.cenqua.crucible.hibernate.CruDBException: SQL script error on line 1: "create table cru_base_star_model (cru_star_id integer not null, cru_item_type varchar(80) not null, cru_string_key1 varchar(255), cru_string_key2 varchar(255), cru_string_key3 varchar(255), cru_string_key4 varchar(255), cru_string_key5 varchar(255), cru_int_key1 integer, cru_int_key2 integer, cru_int_key3 integer, cru_int_key4 integer, cru_int_key5 integer, cru_text_key1 longvarchar, cru_text_key2 longvarchar, cru_user_name varchar(255), cru_date_created bigint, cru_label varchar(255), primary key (cru_star_id));" (ERROR: type "longvarchar" does not exist Position: 375), please contact http://www.atlassian.com/support/ at com.cenqua.crucible.hibernate.DefaultDBControl.executeScript(DefaultDBControl.java:483) at com.cenqua.crucible.hibernate.DefaultDBControl.executeScript(DefaultDBControl.java:414) at com.cenqua.crucible.hibernate.DefaultDBControl.createTables(DefaultDBControl.java:286) ... 10 more Caused by: org.postgresql.util.PSQLException: ERROR: type "longvarchar" does not exist Position: 375 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:302) at com.cenqua.crucible.hibernate.DefaultDBControl.executeScript(DefaultDBControl.java:455) ... 12 more {noformat} on some browsers as the "Database Type" field is blanked out in the UI, when updating the JDBC connection URL. The problem has been reported on IE9 and Chrome. But Chrome 14 appears to work correctly for a customer. Unsure about which version of Chrome is failing. FireFox appears to be working as expected. Postgres versions reported on 8.2.20 and 8.4
    via by Gurleen Anand [Atlassian],
  • I have an application that invokes Liquibase.update(Contexts contexts, Writer output). I want it to only show the changes and not risk making any changes, hence I set the connection to be read-only: {code} def liquibaseConnection = new JdbcConnection(connection) liquibaseConnection.setReadOnly(true) def liquibase = new Liquibase("my-changelog.xml", resourceAccessor, liquibaseConnection) def contexts = new Contexts() liquibase.update(contexts, getOutputWriter()) {code} However, even though if I instantiate Liquibase with a read-only connection, it still attempts to perform a database update to release the lock: {code} org.postgresql.util.PSQLException: ERROR: cannot execute UPDATE in a read-only transaction at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:302) at liquibase.executor.jvm.JdbcExecutor$1UpdateStatementCallback.doInStatement(JdbcExecutor.java:231) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) at liquibase.executor.jvm.JdbcExecutor.update(JdbcExecutor.java:240) at liquibase.executor.jvm.JdbcExecutor.update(JdbcExecutor.java:214) at liquibase.lockservice.StandardLockService.releaseLock(StandardLockService.java:232) at liquibase.Liquibase.update(Liquibase.java:264) at liquibase.Liquibase.update(Liquibase.java:240) {code} Note that the error only occurs after the updateSQL operation was completed successfully. Even lock acquisition seems to work (probably by not touching the database). For some reason that is unclear to me, it seems that only the release part is failing to work properly with a read-only connection.
    via by Rafael Chaves,
  • Migration from HSQLDB to Postgres may fail with the following exception: {noformat} 2011-10-20 13:56:29,581 ERROR [ThreadPool1 ] fisheye.app com.atlassian.crucible.actions.admin.database.DBEditHelper-doGet - Database migration failed: com.cenqua.crucible.hibernate.CruDBException: Problem with create tables script D:\Atlassian\Fisheye\sql\HSQL\schema\tables_75.sql com.cenqua.crucible.hibernate.CruDBException: Problem with create tables script D:\Atlassian\Fisheye\sql\HSQL\schema\tables_75.sql at com.cenqua.crucible.hibernate.DefaultDBControl.createTables(DefaultDBControl.java:292) at com.atlassian.crucible.migration.item.DBImporter.importData(DBImporter.java:138) at com.atlassian.crucible.actions.admin.database.DBEditHelper$ImportRunner.call(DBEditHelper.java:91) at com.atlassian.crucible.actions.admin.database.DBEditHelper$ImportRunner.call(DBEditHelper.java:73) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: com.cenqua.crucible.hibernate.CruDBException: SQL script error on line 1: "create table cru_base_star_model (cru_star_id integer not null, cru_item_type varchar(80) not null, cru_string_key1 varchar(255), cru_string_key2 varchar(255), cru_string_key3 varchar(255), cru_string_key4 varchar(255), cru_string_key5 varchar(255), cru_int_key1 integer, cru_int_key2 integer, cru_int_key3 integer, cru_int_key4 integer, cru_int_key5 integer, cru_text_key1 longvarchar, cru_text_key2 longvarchar, cru_user_name varchar(255), cru_date_created bigint, cru_label varchar(255), primary key (cru_star_id));" (ERROR: type "longvarchar" does not exist Position: 375), please contact http://www.atlassian.com/support/ at com.cenqua.crucible.hibernate.DefaultDBControl.executeScript(DefaultDBControl.java:483) at com.cenqua.crucible.hibernate.DefaultDBControl.executeScript(DefaultDBControl.java:414) at com.cenqua.crucible.hibernate.DefaultDBControl.createTables(DefaultDBControl.java:286) ... 10 more Caused by: org.postgresql.util.PSQLException: ERROR: type "longvarchar" does not exist Position: 375 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:302) at com.cenqua.crucible.hibernate.DefaultDBControl.executeScript(DefaultDBControl.java:455) ... 12 more {noformat} on some browsers as the "Database Type" field is blanked out in the UI, when updating the JDBC connection URL. The problem has been reported on IE9 and Chrome. But Chrome 14 appears to work correctly for a customer. Unsure about which version of Chrome is failing. FireFox appears to be working as expected. Postgres versions reported on 8.2.20 and 8.4
    via by Gurleen Anand [Atlassian],
    • org.postgresql.util.PSQLException: ERROR: invalid input syntax for type inet: "null" at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:302) at msf.DatabaseImpl.executeUpdate(DatabaseImpl.java:109) at msf.DatabaseImpl.execute(DatabaseImpl.java:594) at msf.RpcConnectionImpl.execute(RpcConnectionImpl.java:140) at msf.RpcQueue.processRequest(RpcQueue.java:33) at msf.RpcQueue.run(RpcQueue.java:83) at java.lang.Thread.run(Thread.java:745)

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    jokesterjokester
    2 times, last one,
    silexsilex
    5 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    92 more bugmates