Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgreSql port and query statement #725

Closed
gmercey opened this issue Dec 11, 2012 · 3 comments
Closed

PostgreSql port and query statement #725

gmercey opened this issue Dec 11, 2012 · 3 comments
Labels

Comments

@gmercey
Copy link

gmercey commented Dec 11, 2012

Hi,

I try to use use a remote Postgre database with a specific port (not the default one 5432) and I have an error with all my query :

ERROR: prepared statement "pdo_stmt_0000000x" does not exist'

I don't have the problem if I use the defaut port 5432.
Is it a bug or is there an option to use a different port ?

Thanks

@nateabele
Copy link
Member

You should be able to use non-standard ports by putting 'host' => '<hostname>:<port>' in your connection config. Without more information on the configuration and the stack trace of the error, it's really hard to say what the problem is though.

If the above works for you, great. If not, please re-open the issue with more information.

@gmercey
Copy link
Author

gmercey commented Dec 11, 2012

I already use 'host' => '<hostname>:<port>' in my connection file.
The connection with the db is ok, but I have the statement error when I make a query.
I don't have the error if I use 'host' => '<hostname>: 5432';

There is my stack trace :

[11-Dec-2012 15:24:50 UTC] PHP Fatal error: Uncaught exception 'lithium\data\model\QueryException' with message 'SELECT name FROM public.user WHERE id = 5690: ERROR: prepared statement "pdo_stmt_00000001" does not exist' in /sites/admin/libraries/lithium/data/source/Database.php:1216
Stack trace:
#0 /sites/admin/libraries/lithium/core/Object.php(238): lithium\data\source\Database->lithium\data\source{closure}(Object(lithium\data\source\database\adapter\PostgreSql), Array, NULL)
#1 /sites/admin/libraries/lithium/data/source/Database.php(1217): lithium\core\Object->_filter('lithium\data\so...', Array, Object(Closure))
#2 /sites/admin/libraries/lithium/core/Object.php(167): lithium\data\source\Database->_error('SELECT fb_uid, ...')
#3 /sites/admin/libraries/lithium/data/source/database/adapter/PostgreSql.php(363): lithium\core\Object in /sites/admin/libraries/lithium/data/source/Database.php on line 1216

@nateabele nateabele reopened this Dec 11, 2012
@mariuswilms
Copy link
Member

This looks like a problem with PDO and check if you're using the correct format for the host string. The pasted example has one space too much: ´'host' => ': 5432'`. Feel free to reopen if the issue persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants