@Johann you missed this in the book "Note that currently this is only available for DB2, MS-SQL, Ingres and Informix, but others can be easily added."
but even if Postgres was supported you still could not reference regular tables from keyed ones and viceversa, as specified in http://groups.google.com/group/web2py/msg/c9848792a8999c5f 1) primarykey is a list of the field names that make up the primary key 2) all primarykey fields will have NOT NULL set even if not specified 3) references are to other keyed tables only 4) references must use tablename.fieldname format, as shown above 5) update_record function is not available 6) web2py rev.1354 (or higher) has appadmin support for keyed tables. Denes. On Nov 25, 9:51 am, Johann Spies <johann.sp...@gmail.com> wrote: > Hallo Richard, > > On 25 November 2010 16:26, Richard Vézina <ml.richard.vez...@gmail.com>wrote: > > > I think it cover in as keyed table in the book > > > I am not sure how that will solve my problem. > > It creates new problems: > > signature = db.Table(db, 'signature', > Field('created_on', 'datetime', default=request.now, > readable = False, writable = False), > Field('created_by', db.auth_user, default=auth.user_id, > readable = False, writable = False), > Field('updated_on', 'datetime', default=request.now, > readable = False, writable = False), > Field('updated_by', db.auth_user, update=auth.user_id, > readable = False, writable = False) > ) > > db.define_table('journal', > Field('ouid','integer'), > Field('journal',unique=True), > Field('issn', length=10), > Field('notes', type='text'), > signature, > primarykey = ['ouid'], > format=lambda r: r.journal, > migrate = False > ) > > Traceback (most recent call last): > File "/home/js/web2py/gluon/restricted.py", line 188, in restricted > exec ccode in environment > File "/home/js/web2py/applications/init/models/kb4.py" > <http://localhost:8000/admin/default/edit/init/models/kb4.py>, line > 36, in <module> > migrate = False > File "/home/js/web2py/gluon/sql.py", line 1375, in define_table > t._create_references() > File "/home/js/web2py/gluon/sql.py", line 2303, in _create_references > raise SyntaxError, 'invalid reference: %s' %ref > SyntaxError: invalid reference: auth_user > > Regards > Johann > -- > May grace and peace be yours in abundance through the full knowledge of God > and of Jesus our Lord! His divine power has given us everything we need for > life and godliness through the full knowledge of the one who called us by > his own glory and excellence. > 2 Pet. 1:2b,3a