Error in a simple query

Поиск
Список
Период
Сортировка
От Gustavo
Тема Error in a simple query
Дата
Msg-id 201306241955.41267.gmpuljak@yahoo.com.ar
обсуждение исходный текст
Ответы Re: Error in a simple query
Re: Error in a simple query
Список psycopg
Hi,

I'm using psycopg2 extensively in different scripts to process spatial data
with postgresql 9.1 and postgis. However, in one script I have the following
error:

psycopg2.internalerror: current transaction is aborted, commands ignored until
end of transaction block

The command that gave the error is:

a = """select idbalizas from nuevo.balizas where %s %s %s %s""" % (emp1,
dnid1, mem1, mmsi1)
print
cur.execute(a)

One example of 'a' is:

select idbalizas from nuevo.balizas where  emp='005'  and dnid='08466'  and
mem='055'  and mmsi='701000535'

I can run this same query in psql and other postgresql clients and it returns
the correct answer.

Can you help me debugging this?
Many thanks.



--
Gustavo Martínez
Skype: gmpuljak
Linkedin: http://ar.linkedin.com/in/gustavomartínezpuljak

“Que la tierra se vaya haciendo camino ante tus pasos,
que el viento sople siempre a tus espaldas,
que el sol brille cálido sobre tu cara,
que la lluvia caiga suavemente sobre tus campos y,
hasta tanto volvamos a encontrarnos,
que Dios te lleve en la palma de su mano.”


В списке psycopg по дате отправления:

Предыдущее
От: Daniele Varrazzo
Дата:
Сообщение: Psycopg 2.5.1 released
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Error in a simple query