This worked for me on postgresql 9.1... db = DAL('%s%s' % (dal_connection, app_database)) rname = db._adapter.__class__.QUOTE_TEMPLATE % 'ALL' db.define_table('test', Field('whatever', rname=rname))
Note that I used "ALL" rather than "position" as position is not a reserved word on postgresql On Monday, July 21, 2014 6:14:05 PM UTC+12, Simon Ashley wrote: > > Thanks. I could, but need to check this for postgres. Seems a little bit > strange when I have a look at the sql.log file: > > timestamp: 2014-07-21T15:57:35.749000 >> CREATE TABLE auth_cas( >> id INTEGER PRIMARY KEY AUTOINCREMENT, >> user_id INTEGER REFERENCES auth_user (id) ON DELETE CASCADE, >> created_on TIMESTAMP, >> service CHAR(512), >> ticket CHAR(512), >> renew CHAR(1) >> ); >> success! >> timestamp: 2014-07-21T15:59:39.060000 >> CREATE TABLE "this_is_the_easy_name_table"( >> id INTEGER PRIMARY KEY AUTOINCREMENT, >> "this_is_the_field_name" CHAR(512) >> ); >> success! > > > and when I look at the table generated, I get this: > > (dp1 >> S'position1' >> p2 >> (dp3 >> S'length' >> p4 >> I512 >> sS'unique' >> p5 >> I00 > > > Note that I've changed* position* to *position1* to escape the error and > generate the table. I would have thought that it would have generated the > rname. I might try a fresh dal.py source. > > -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.