On Thursday 25 November 2004 05:32 pm, Adriano Monteiro wrote:
> I'm having some trobles with INSERT and psycopg...
> I don't know why it doesn't work.
>
> My code:
>
> sql = "INSERT INTO operario ( operario_id, nome,
> status, secao ) VALUES ( '3', 'Test', 'ATIVO', 'ENCASTOAMENTO' )"
> cursor_insert = self.conexao.cursor()
> cursor_insert.execute ( sql )
> cursor_insert.commit ()
>
> And I got the error:
>
> Traceback (most recent call last):
> File "producao/python/operario.py", line 159, in adicionar
> cursor_insert.commit ( )
> psycopg.Error: serialized connection: cannot commit on this cursor
when you create the cursor, set serialize=0
or do
self.conexao.commit()
kg
|