OK... looked through all of the Q&A's on PostgreSQL and PDO, but no luck answering my question... same problem finding the answer through Google.
Thus I lay my query at the feet of the masters.
I am just getting started with PostgreSQL, coming from a MySQL background. I am using PDO to connect to it, and pgAdminIII to manage the database itself.
How do I connect to a table which has been stuck in a defined tablespace?
$db = new PDO("pgsql:host=127.0.0.1;user=pageserver;password=myPassword;dbname=pageserver;");
is resulting in:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[08006] [7] FATAL: database "pageserver" does not exist' in ~stacktrace~
Before anyone mentions, sure, I should be using try/catch, and I will as this gets further along... but for now the error is helpful.
This database does exist, but all of the databases that i am working with on this project are placed in a tablespace to keep the databases within specific subfolders.
I am assuming this is where my problem is coming in; so far, I have seen no references on tablespaces anywhere through the PDO documentation.
The documentation for PostgreSQL obviously goes into great length on tablespaces, but doesn't reference PDO syntax for connecting to them.
I am hoping it is something simple like:
$db = new PDO("pgsql:host=127.0.0.1;tablespace=system;user=pageserver;password=MyPassword;dbname=pageserver;");
But this results in:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[08006] [7] invalid connection option "tablespace"' in ~stacktrace~
@Igor
Well, I just spent about half an hour running further tests, and exploring the structure, and ensuring that the roles, schemas, tablespaces, and tables were all in line...
They were all in order, and actually set up correctly.
I tried using schema.database name as you recommended, but it didn't work.
Then I discovered the problem that had been plaguing me this entire time.
Apparently, after having setting up the databases, then close to 40 tables, including all of the indexes... my problem wasn't even PostgreSQL.
It was an evil combination of PgAdminIII and my complete lack of sleep.
Apparently, all of these tables got set up under the db 'postgres' instead of under the db's they were meant to be placed within.
My apologies for my idiocy, and thank you for seeing it clearly.
Marked as correct.