On 11/4/06, orestis <[EMAIL PROTECTED]> wrote:
...
>     cursor.execute("SET TIME ZONE %s", [settings.TIME_ZONE])
> ProgrammingError: ERROR:  current transaction is aborted, commands
> ignored until end of transaction block
>
> SET TIME ZONE 'Europe/Athens'
> }}}
...

This error is reported by postgres whenever 1) you're working in a
transaction, 2) an error occured previously in the transaction, and 3)
you continue issuing commands in that transaction without either
committing or rolling back.

The validity of the SET TIME ZONE statement has nothing to do with it;
"select 1" would fail similarly.

> However, this is completely random. Most of the time everything runs
> fine, then this will pop-up. hit refresh and everything is OK. I can't
> track this down. This has happened on a project using mostly flat
> pages, on requests that didn't save to the database, and on projects
> using save.

Your best bet is to find the query that broke.

A suggestion of how to do this:
1) turn on DEBUG
2) In django.core.handlers.base.get_response, add this line:
  from django.db.connection import queries
  (This puts the list of queries executed for the request into the
local context of get_response, which will definitely be in your
traceback stack, so that when you reproduce the error, you'll have the
list of queries to try.)
3) runserver and do requests until the error occurs.

Don't forget to take the line out of handlers.base.get_response when
you're done.

> I'm running postgres 7.4.13 psycopg 1.1.21, Centos 4.4

Hmm, I have no idea what the earliest supported postgres version is...

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to