Search Postgresql Archives

Statement timeout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've set statement timeout in postgresql.conf to 300s.
Now, I have a schema update procedure at application startup I would like to run without timeout, or with significant larger timeout (let's say, 10000s).

It is possible to change statement timeout at runtime before issuing the command (for one connection only) without changing postgresql.conf?

I'm using JDBC, and I've imagined something like


java.sql.Connection cn = getConnection(); // this is a function that returns a connection form the connection's pool.
java.sql.Statement st = cn.createStatement();
cn.setAutoCommit(false);
st.executeQuery("set statement_timeout = 10000s");
st.executeUpdate("update table XYZ set value_non_zero = 1 where value_non_zero is null or value_non_zero = 0"); st.executeUpdate("alter table XYZ modify value_non_zero not null default 1");
cn.commit();

Something like that (I know sql syntax is wrong, this is just a lazy example)...

--
Atenciosamente,

Edson Carlos Ericksson Richter



--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux