I'm trying to connect to a different schema in postgres Database
Actually i'm connecting succesfully to the 'public' one using this code in a file named
dbconfig.php that i will include in my other php web pages
<?php
// Informations de connection
$host = 'vm-XXXX-XXXX';
$port = '5432';
$dbname2 = 'myData';
$user = 'postgres';
$password = 'postgres';
// Connecion to the database
$dbconn = pg_connect("host=$host port=$port dbname=$dbname2 user=$user password=$password")
or die('impossible Connexion : ' . pg_last_error());
?>
Now , i'm facing a problem to connect to a specific Schema named MyDataBaseSchema
I searched how to achieve that and i 've seen that there is a way out using :
SET search_path TO myschema
But i don't know how to use that in my code ?
Note that , i don't want to use the specific schema using this way
select * from MyDataBaseSchema.tableName