mirror of
https://github.com/PostgreSQL-For-Wordpress/postgresql-for-wordpress.git
synced 2025-07-30 17:57:13 +02:00
Partially revert 650f768
Although calling wpsql_select_db from wpsql_connect did set the connection globally, it also caused early clearing of the connection string when WP_INSTALLING is defined and ran queued early SQL commands before select is called by external code (which was dubious). Revert it, but keep using the best guess at the database name, since this often saves a connection. Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
This commit is contained in:
@ -82,7 +82,7 @@
|
||||
// PostgreSQL must connect to a specific database (unlike MySQL)
|
||||
// Guess at one here and reconnect as required in wpsql_select_db
|
||||
$dbname = defined('DB_NAME') && DB_NAME ? DB_NAME : 'template1';
|
||||
return wpsql_select_db( $dbname);
|
||||
return pg_connect( $GLOBALS['pg4wp_connstr'].' dbname='.$dbname);
|
||||
}
|
||||
|
||||
// The effective connection happens here
|
||||
|
Reference in New Issue
Block a user