Hi Anthony,
Yes web2py PG driver works fine, except it is too old, doesn't support
Postgres v10.2
-Rob

On Mar 1, 2018 3:53 PM, "Anthony" <[email protected]> wrote:

> Looks like it's finding the psycopg2 driver just fine -- the problem is
> that it is not finding a database named booster_i. You might need to
> specify the port in the connection string (e.g., "localhost:5432").
>
> Anthony
>
> On Thursday, March 1, 2018 at 3:32:14 PM UTC-5, Rob Paire wrote:
>>
>> Hi Richard,
>> Thank you for your helpful reply. I am running the latest version of
>> web2py 2_16_1. In order to query the version of psycpg2 which web2py is
>> running put the following code into a view:
>> {{import psycopg2}}
>> {{=psycopg2.__version__}}
>>
>> This show web2py is running version  2.5.4 (dt dec pq3 ext)
>>
>>
>> I used PIP to install the latest version of psycpg2: 2.7.4 into my local
>> Python2.7 directory and I can talk to the database as expected. I am
>> wondering how to get the latest version of Psycpg into web2py.
>>
>> Error message below:.. note changing "localhost" to a server running
>> postgres 9.3 everythings works fine.
>>
>> Ticket ID
>>
>> 192.168.1.45.2018-03-01.15-25-12.2fa3bdd3-d668-4487-874a-3ca86557ad66
>> <type 'exceptions.RuntimeError'> Failure to connect, tried 5 times:
>> Traceback (most recent call last): File 
>> "C:\web2py_2_16_1\gluon\packages\dal\pydal\base.py",
>> line 454, in __init__ self._adapter = adapter(**kwargs) File
>> "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", line
>> 25, in __call__ return AdapterMeta.__call__(cls, *args, **kwargs) File
>> "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\__init__.py", line
>> 40, in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>> File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py",
>> line 48, in __init__ driver_args, adapter_args, do_connect,
>> after_connection) File "C:\web2py_2_16_1\gluon\packag
>> es\dal\pydal\adapters\base.py", line 368, in __init__ super(SQLAdapter,
>> self).__init__(*args, **kwargs) File "C:\web2py_2_16_1\gluon\packag
>> es\dal\pydal\adapters\base.py", line 52, in __init__ self.reconnect()
>> File "C:\web2py_2_16_1\gluon\packages\dal\pydal\helpers\classes.py",
>> line 181, in _reconnect_and_configure self._connection_reconnect() File
>> "C:\web2py_2_16_1\gluon\packages\dal\pydal\connection.py", line 172, in
>> reconnect self.connection = self.connector() File
>> "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", line
>> 105, in connector return self.driver.connect(**self.driver_args) File
>> "psycopg2/__init__.py", line 164, in connect OperationalError: FATAL:
>> database "booster_i" does not existVersion
>> web2py™ Version 2.16.1-stable+timestamp.2017.11.14.05.54.25Traceback
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> 13.
>> 14.
>> 15.
>> 16.
>> 17.
>> 18.
>> 19.
>> 20.
>> 21.
>> 22.
>> 23.
>> 24.
>> 25.
>> 26.
>> 27.
>> 28.
>> 29.
>> 30.
>> 31.
>> 32.
>> 33.
>> 34.
>>
>> Traceback (most recent call last):
>>   File "C:\web2py_2_16_1\gluon\restricted.py", line 219, in restricted
>>     exec(ccode, environment)
>>   File "C:/web2py_2_16_1/applications/Booster_I/models/db.py" 
>> <https://192.168.1.45:8000/admin/default/edit/Booster_I/models/db.py>, line 
>> 20, in <module>
>>     db = 
>> DAL('postgres://username:password@localhost/booster_i',pool_size=1,check_reserved=['all'],migrate_enabled=False)
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\base.py", line 169, in 
>> __call__
>>     obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\base.py", line 474, in 
>> __init__
>>     "Failure to connect, tried %d times:\n%s" % (attempts, tb)
>> RuntimeError: Failure to connect, tried 5 times:
>> Traceback (most recent call last):
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\base.py", line 454, in 
>> __init__
>>     self._adapter = adapter(**kwargs)
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", 
>> line 25, in __call__
>>     return AdapterMeta.__call__(cls, *args, **kwargs)
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\__init__.py", 
>> line 40, in __call__
>>     obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", 
>> line 48, in __init__
>>     driver_args, adapter_args, do_connect, after_connection)
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\base.py", line 
>> 368, in __init__
>>     super(SQLAdapter, self).__init__(*args, **kwargs)
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\base.py", line 
>> 52, in __init__
>>     self.reconnect()
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\helpers\classes.py", line 
>> 181, in _reconnect_and_configure
>>     self._connection_reconnect()
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\connection.py", line 172, 
>> in reconnect
>>     self.connection = self.connector()
>>   File "C:\web2py_2_16_1\gluon\packages\dal\pydal\adapters\postgres.py", 
>> line 105, in connector
>>     return self.driver.connect(**self.driver_args)
>>   File "psycopg2/__init__.py", line 164, in connect
>> OperationalError: FATAL:  database "booster_i" does not exist
>>
>>
>> In file: C:\web2py_2_16_1\applications\Booster_I\models\db.py
>>
>> 1.
>>
>> <code object <module> at 0C8CBA40, file 
>> "C:\web2py_2_16_1\applications\Booster_I\models\db.py", line 12>
>>
>>
>>
>>
>> On Thursday, March 1, 2018 at 2:39:18 PM UTC-5, Rob Paire wrote:
>>>
>>> Hello web2py community!
>>>
>>> I am in the process of moving a 4 year old web2py application to a new
>>> server and I am having trouble getting the application to connect to
>>> PostgreSQL 10.2.  I am guessing because the version of psycopg2 driver in
>>> web2py is: 2.5.4 (dt dec pq3 ext)
>>>
>>> I installed the latest version of psycopg2 to my local Python
>>> installation and I can talk to the database, but how do I make web2py use
>>> the latest drivers? It is necessary to run from source to do this?
>>>
>>> Comments are appreciated.
>>>
>>> Thank you for your help!
>>> -Rob
>>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/YiXdSPqiiTo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to