Junior — Middle
Do you have experience working with PostgreSQL database management system?
sobes.tech AI
Answer from AI
Yes, I have experience working with PostgreSQL. It is a powerful object-relational database management system with advanced features such as transactions, indexes, full-text search, and JSONB.
In PHP, extensions like PDO or pg_connect are commonly used to work with PostgreSQL. An example of connecting and executing a query using PDO:
$dsn = 'pgsql:host=localhost;port=5432;dbname=testdb;';
$user = 'username';
$password = 'password';
try {
$pdo = new PDO($dsn, $user, $password);
$stmt = $pdo->query('SELECT * FROM users');
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
print_r($row);
}
} catch (PDOException $e) {
echo 'Connection error: ' . $e->getMessage();
}
I am also familiar with basic configuration, query optimization, and transaction usage in PostgreSQL.