Page 1 of 1

Passing queries on same persistent connection

Posted: Sun Dec 19, 2004 3:56 pm
by gite_ashish
Hello:


My sudo code goes something like this:

Code: Select all

<?php

// ...
// validate $schema1, $schema2 
// ...

$conn = pg_pconnect("... connection details ...");

$rs1 = pg_query($conn, "SET search_path TO $schema1, $schema2");
$rs2 = pg_query($conn, "SELECT * FROM table1");

// ...

?>

Since "search_path" is connection dependent setting it's important to have both queries executed in the same database connection.

I am using Persistent Connection, with this how to *confirm* that both of my above mentioned queries are being executed on the same connection ?

Thanks.