DataTables and Postgres
DataTables and Postgres
I just completed the arduous task of switching from MySQLQ to PostgresSQL.
I am getting the error "An error occurred while connecting to the database 'postgres'. The error reported by the server was: could not find driver".
What do I need to do?
From config.php:
$sql_details = array(
"type" => "Postgres", // Database type: "Mysql", "Postgres", "Sqlserver", "Sqlite" or "Oracle"
"user" => "postgres", // Database user name
"pass" => "", // Database password
"host" => "localhost", // Database host
"port" => "5432", // Database connection port (can be left empty for default)
"db" => "postgres", // Database name
"dsn" => "", // PHP DSN extra information. Set as charset=utf8mb4
if you are using MySQL
"pdoAttr" => array() // PHP PDO attributes array. See the PHP documentation for all options
This question has an accepted answers - jump to answer
Answers
I might be wrong since I don't use PHP but this thread shows how to determine if the driver is installed. If its not installed see if this SO thread helps to install it.
Kevin
Thank you. That was a problem, but I resolved.
I am reading my categories tables successfuly!
But the slightly more involved one is returning "error: "JSON encoding error: Type is not supported"
Solved!
Long story short--it looked rather difficult to migrate the blobs from MySQL to bytea in PostgreSQL, so I left them for later.
So the bytea fields were blnak rather than <null>
Fixed that!
Nice one - thanks for the update!
Allan
If you need to connect to PostgreSQL database, you can use this tool - unidac.
@NickEvans - spam, or does that actually relate to this thread other than that it mentions Postgres?
Allan