Postgres - ERROR: 42601: cannot insert multiple commands into a prepared statement
628 views
Skip to first unread message
wibber
unread,
Feb 22, 2011, 3:39:02 PM2/22/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nhusers
NH-2267 updated NpgsqlDriver to use prepared statements.
Unfortunately, this means that I can't get the identity generator to
work. Anybody got a good work-around for this yet? I'm thinking
about extending the postgres dialect to use the "returning [id]". I'm
not sure where to get the "id" inside the IdentitySelectString method.
Exception:
NHibernate.Exceptions.GenericADOException: could not insert:
[Entity.Test][SQL: INSERT INTO public."Test" ("Name") VALUES (?);
select lastval()] ---> Npgsql.NpgsqlException: ERROR: 42601: cannot
insert multiple commands into a prepared statement
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nhu...@googlegroups.com, wibber
On 2011-02-22 21:39, wibber wrote: > NH-2267 updated NpgsqlDriver to use prepared statements. > Unfortunately, this means that I can't get the identity generator to > work. Anybody got a good work-around for this yet? I'm thinking > about extending the postgres dialect to use the "returning [id]". I'm > not sure where to get the "id" inside the IdentitySelectString method.
As a work around: Consider using HiLo generator. Unless for some reason you really have to use DB-generated keys, HiLo is the best choice for integer PKs. You might want to stick with it even after the issue gets resolved.
Filip Zawada
wibber
unread,
Feb 23, 2011, 8:27:49 AM2/23/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nhusers
Would love to, but DBAs won't budge. If someone can tell me how to
get the name of the identity column from inside the
IdentitySelectString method, then I can solve the identity problem.
That's the last piece of the puzzle and I'll have an updated Postgres
dialect that works.