Dear Oleg Broytmann,

     well, this is the result of the debug:
     this is too complicated to me, please help me, what i should
     check

 1/QueryAll:
        SELECT pg_catalog.pg_get_constraintdef(oid) as condef
        FROM pg_catalog.pg_constraint r
        WHERE r.conrelid = 'ps_schema.knowladgebase'::regclass AND r.contype = 
'f'
 1/QueryR  :  
        SELECT pg_catalog.pg_get_constraintdef(oid) as condef
        FROM pg_catalog.pg_constraint r
        WHERE r.conrelid = 'ps_schema.knowladgebase'::regclass AND r.contype = 
'f'
 1/COMMIT  :  auto
 1/QueryAll:  
        SELECT pg_index.indisprimary,
            pg_catalog.pg_get_indexdef(pg_index.indexrelid)
        FROM pg_catalog.pg_class c, pg_catalog.pg_class c2,
            pg_catalog.pg_index AS pg_index
        WHERE c.relname = 'ps_schema.knowladgebase'
            AND c.oid = pg_index.indrelid
            AND pg_index.indexrelid = c2.oid
            AND pg_index.indisprimary
        
 1/QueryR  :  
        SELECT pg_index.indisprimary,
            pg_catalog.pg_get_indexdef(pg_index.indexrelid)
        FROM pg_catalog.pg_class c, pg_catalog.pg_class c2,
            pg_catalog.pg_index AS pg_index
        WHERE c.relname = 'ps_schema.knowladgebase'
            AND c.oid = pg_index.indrelid
            AND pg_index.indexrelid = c2.oid
            AND pg_index.indisprimary
        
 1/COMMIT  :  auto
Traceback (most recent call last):
  File "C:\Python24\Lib\SITE-P~1\PYTHON~1\pywin\framework\scriptutils.py", line 
310, in RunScript
    exec codeObject in __main__.__dict__
  File "D:\Ivan Documents\dev\python\sqlobject_try.py", line 12, in ?
    class KB(sqlobject.SQLObject):
  File 
"c:\python24\lib\site-packages\SQLObject-0.7.0-py2.4.egg\sqlobject\declarative.py",
 line 94, in __new__
    cls.__classinit__(cls, new_attrs)
  File 
"c:\python24\lib\site-packages\SQLObject-0.7.0-py2.4.egg\sqlobject\main.py", 
line 770, in __classinit__
    cls.sqlmeta.addColumnsFromDatabase()
  File 
"c:\python24\lib\site-packages\SQLObject-0.7.0-py2.4.egg\sqlobject\main.py", 
line 421, in addColumnsFromDatabase
    for columnDef in conn.columnsFromSchema(sqlmeta.table, soClass):
  File 
"c:\python24\lib\site-packages\SQLObject-0.7.0-py2.4.egg\sqlobject\postgres\pgconnection.py",
 line 217, in columnsFromSchema
    assert primaryKey, "No primary key found in table %r" % tableName
AssertionError: No primary key found in table 'ps_schema.knowladgebase'


Tuesday, March 28, 2006, 4:47:44 PM, you wrote:

OB> On Tue, Mar 28, 2006 at 04:13:52PM +0200, Ivan Horvath wrote:
>>   when i try connect to this existing database i receive always a
>>   "No primary key found in table ..." message

OB>    Add "?debug=1" to the connection URI
OB> (postgres:/db?debug=1). This makes
OB> SQLObject prints all SQL queries. Look at the debug output. Is there
OB> anything wrong?

OB> Oleg.



-- 
Best regards,
 Ivan Horvath
 Chief Programmer


Anyone who has never made a mistake has never tried anything new.

/Albert Einstein/ 



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to