Re: Can I test Extended Query in core test framework
От | Ashutosh Bapat |
---|---|
Тема | Re: Can I test Extended Query in core test framework |
Дата | |
Msg-id | CAExHW5viLbPJ_asUrocqw8_0LDwS-0EZwa4FGvf4SUiQirVwhQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Can I test Extended Query in core test framework (Andy Fan <zhihui.fan1213@gmail.com>) |
Ответы |
Re: Can I test Extended Query in core test framework
|
Список | pgsql-hackers |
You could run PREPARE and EXECUTE as SQL commands from psql. Please take a look at the documentation of those two commands. I haven't looked at TAP infrastructure, but you could open a psql session to a running server and send an arbitrary number of SQL queries through it. Said that a server starts caching plan only after it sees a certain number of EXECUTEs. So if you are testing cached plans, that's something to worry about. On Tue, Aug 11, 2020 at 8:13 AM Andy Fan <zhihui.fan1213@gmail.com> wrote: > > I want to write some test cases with extended query in core test system. basically it looks like > > PreparedStatement preparedStatement = conn.prepareStatement("select * from bigtable"); > preparedStatement.setFetchSize(4); > ResultSet rs = preparedStatement.executeQuery(); > while(rs.next()) > { > System.out.println(rs.getInt(1)); > // conn.commit(); > conn.rollback(); > } > > > However I don't find a way to do that after checking the example in src/test/xxx/t/xxx.pl > where most often used object is PostgresNode, which don't have such abilities. > > Can I do that in core system, I tried grep '\->prepare' and '\->execute' and get nothing. > am I miss something? > > > -- > Best Regards > Andy Fan -- Best Wishes, Ashutosh Bapat
В списке pgsql-hackers по дате отправления: