Re: [GENERAL] Function not inserting rows
От | David G. Johnston |
---|---|
Тема | Re: [GENERAL] Function not inserting rows |
Дата | |
Msg-id | CAKFQuwawVk7ZauoTeYrm7eaW0+5PGdZ2UCQs6zPOzhxfh1kx_g@mail.gmail.com обсуждение исходный текст |
Ответ на | [GENERAL] Function not inserting rows (Frank Foerster <ivaypoint@gmail.com>) |
Список | pgsql-general |
sql = "select * from api_dev.add_texts_to_item( %s, %s ); x x"i get the following python-error:psycopg2.ProgrammingError: FEHLER: Syntaxfehler bei »s«LINE 1: ...dd_texts_to_item( 1234, ARRAY['PSYCOPG1', 'PSYCOPG2'] ); s sBut the created statement looks syntax-wise identical to the pgadmin-statement (except for the forced error of course):select * from api_dev.add_texts_to_item( 444, array['PGADM1', 'PGADM2'] );
Try adding the following to your function to see what your function sees as being the value of the p_item_texts argument.
RAISE ERROR '%', p_item_texts;
I'm assuming that:
self.cur_.execute( sql, (doc_id, isins, ) )
performs dynamic string substitution as opposed to generating a prepared statement. The placeholder values supplied to a prepared statement are treated as literals.
You may also want turn on statement logging in the server.
David J.
В списке pgsql-general по дате отправления: