Statement timeout

Поиск
Список
Период
Сортировка
От Edson Richter
Тема Statement timeout
Дата
Msg-id BLU436-SMTP2276AADCE7695969FDFF006CFDB0@phx.gbl
обсуждение исходный текст
Ответы Re: Statement timeout
Список pgsql-general
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



В списке pgsql-general по дате отправления:

Предыдущее
От: "Maeldron T."
Дата:
Сообщение: BSD initdb without ICU support and switch later
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: apt.postgresql.org ubtuntu trusty missing libpq version