Can I request AWS Redshift with the PHP PDO Postgres driver?

I can not find information about this on the Amazon website, but is this possible?

+4
source share
2 answers

Of course you can,

I am using PHP PostgreSQL to query AWS Redshift

+7
source

For those looking for examples:

$connection = new PDO(
    'pgsql:dbname=<db_name>;host=<redshift_cluster_host>;port=5439',
    '<master_user_name>', 
    '<master_user_password>'
);

$statement = $connection->prepare('<your_query>');
$statement->execute();
$result = $statement->fetch();

Also, make sure that you correctly configured the cluster security groups (on the Security tab in the AWS Redshift administrator).

+5
source

Source: https://habr.com/ru/post/1568060/


All Articles