[sqlalchemy] Re: problem with join, count on 0.5.0rc3

2008-11-09 Thread Cito
On 8 Nov., 22:03, Michael Bayer [EMAIL PROTECTED] wrote: oh sorry, also count() is meant to count instances of a single kind of   object.  So in fact you should be saying: session.query(UserRss).join(Rss, item).count() This question is actually coming from the TurboGears group. The problem

[sqlalchemy] Re: problem with join, count on 0.5.0rc3

2008-11-09 Thread Michael Bayer
On Nov 9, 2008, at 4:46 AM, Cito wrote: On 8 Nov., 22:03, Michael Bayer [EMAIL PROTECTED] wrote: oh sorry, also count() is meant to count instances of a single kind of object. So in fact you should be saying: session.query(UserRss).join(Rss, item).count() This question is actually

[sqlalchemy] Re: problem with join, count on 0.5.0rc3

2008-11-09 Thread Michael Bayer
On Nov 9, 2008, at 9:39 AM, Michael Bayer wrote: On Nov 9, 2008, at 4:46 AM, Cito wrote: On 8 Nov., 22:03, Michael Bayer [EMAIL PROTECTED] wrote: oh sorry, also count() is meant to count instances of a single kind of object. So in fact you should be saying:

[sqlalchemy] Re: Postgres - Backup - Restore

2008-11-09 Thread Petr Kobalíček
Thank you Michael. 2008/11/9 Michael Bayer [EMAIL PROTECTED]: you need to call ALTER SEQUENCE on your sequences such that they begin with an integer identifier greater than that of the table they are being used with. On Nov 9, 2008, at 1:22 PM, Petr Kobalíček wrote: I have found some

[sqlalchemy] Re: schema inspection api

2008-11-09 Thread Michael Bayer
You're on the right track. The reflection methods are always called with a Connection that is not shared among any other thread (connections aren't considered to be threadsafe in any case) so threadsafety is not a concern. I think you should look at the mysql dialect sooner rather than

[sqlalchemy] Postgres - Backup - Restore

2008-11-09 Thread Petr Kobalíček
Hi devs, I have postgres related problem. I'm normally developing with sqlite, but we are using postgres on the server. The problem is that sqlalchemy probably remembers primary keys and after database restore it will start in all tables from 1. The error is (IntegrityError) duplicate key

[sqlalchemy] Python 2.6 includes sqlite3 2.4.1

2008-11-09 Thread Eric Ongerth
To whom it may concern: I noticed the following thread in this group (the only thing that came up when I searched for sqlite3 python 2.6): http://groups.google.com/group/sqlalchemy/browse_thread/thread/d6d691b53e93b5e5/78a57bae1aefd59d And then I found the following on the page for What's New

[sqlalchemy] Re: Postgres - Backup - Restore

2008-11-09 Thread Michael Bayer
you need to call ALTER SEQUENCE on your sequences such that they begin with an integer identifier greater than that of the table they are being used with. On Nov 9, 2008, at 1:22 PM, Petr Kobalíček wrote: I have found some material about this and this is called 'sequences' in postgres

[sqlalchemy] Re: Postgres - Backup - Restore

2008-11-09 Thread Petr Kobalíček
I have found some material about this and this is called 'sequences' in postgres terminology. So I know the problem, but I don't know how to synchronize sequences using sqlalchemy. Cheers - Petr 2008/11/9 Petr Kobalíček [EMAIL PROTECTED]: Hi devs, I have postgres related problem. I'm