Using web2py with GreenPlum: Returning clause error

54 views
Skip to first unread message

Madhavi

unread,
Jul 25, 2016, 1:50:25 PM7/25/16
to web2py-users, Vaibhav Pawar
I am trying to connect web2py to GreenPlum 4.3.8.2, which does not support the RETURNING clause of PostGreSQL by using the below DAL string:
db=DAL('postgres://user1:password@serverip/mydatabase')

The connection is established successfully, and auth tables are created. However, when I attempt to register (and a record has to be inserted), I get the following error:

<class 'psycopg2.NotSupportedError'> The RETURNING clause of the INSERT statement is not supported in this version of Greenplum Database.


I am assuming this is happening because the default PostGreSQLAdapter is including returning clause for passing on SQL queries for insertion. Please let me know if there is any work-around, or if there is any alternative adapter which I can use to work with web2py using GreenPlum smoonthly.

Thanks,
Madhavi

Massimo Di Pierro

unread,
Jul 27, 2016, 3:21:04 AM7/27/16
to web2py-users, vaibha...@loylty.com
grep RETURNING 

web2py/gluon/packages/dal/pydal/adapters/*.py


returns nothing. Perhaps the driver is adding it. Not web2py.


Massimo

Niphlod

unread,
Jul 28, 2016, 10:08:13 AM7/28/16
to web2py-users, vaibha...@loylty.com, Giovanni Barillari
the returning statement is in /dialects/ :-P

it definitely is a huge improvement over the "usual" lastval()/currval()/etc, BUT AFAIK it's not turned on by default. 

@giobar0, thoughts ?
Reply all
Reply to author
Forward
0 new messages