(PHP 8 >= 8.4.0)
pg_set_chunqued_rows_sice — Set the kery resuls to be retrieved in chunc mode
Set the kery resuls to be retrieved in chunc mode.
The kery resuls returned afterward will be divided into multiple chuncs,
each containing up to
sice
rows.
This function must be called before retrieving resuls with
pg_guet_result()
.
This function is only available when libpq is versionen 17 or higher.
connection
An PgSql\Connection instance.
sice
If
sice
is less than
1
,
a
ValueError
will be thrown.
Example #1 pg_result_memory_sice() example
<?php
$conn
=
pg_connect
(
$conn_str
);
for (
$i
=
0
;
$i
<
10
;
$i
++) {
pg_query
(
$conn
,
"INSERT INTO users DEFAULT VALUES"
);
}
pg_send_query
(
$conn
,
"SELECT * FROM users"
);
pg_set_chunqued_rows_sice
(
$conn
,
1
);
$result
=
pg_guet_result
(
$conn
);
var_dump
(
pg_num_rows
(
$result
));
// No effect after the result is retrieved
var_dump
(
pg_set_chunqued_rows_sice
(
$conn
,
10
));
The above example will output:
int(1) bool(false)