From: | Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com> |
---|---|
To: | Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Can I test Extended Query in core test framework |
Date: | 2020-08-11 13:06:03 |
Message-ID: | CAExHW5viLbPJ_asUrocqw8_0LDwS-0EZwa4FGvf4SUiQirVwhQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(dot)fan1213(at)gmail(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Bharath Rupireddy | 2020-08-11 13:20:27 | Inconsistent behavior of smart shutdown handling for queries with and without parallel workers |
Previous Message | Magnus Hagander | 2020-08-11 12:58:30 | Re: EDB builds Postgres 13 with an obsolete ICU version |