We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug I use Poco ActiveRecord with PostgreSQL 16.
I use ActiveRecord::lastInsertID(Poco::Data::Session& session) where Data::Session is a PostgreSQL Session.
In Data::Session, session.connector() returns "postgresql"
This method is used in ActiveRecord::lastInsertID and test with "if (session.connector() == "PostgreSQL")". This condition is not satisfied.
To Reproduce
m_pSession = Poco::SharedPtrPoco::Data::Session(new Session(PostgreSQL::Connector::KEY, dbConnString)); Context::Ptr pContext = new Context(*m_pSession);
Use this context with ActiveRecord
Expected behavior
Change test "if (session.connector() == "PostgreSQL")" by "if (session.connector() == "postgresql")" in ActiveRecord::lastInsertID
Logs No Logs
Screenshots No screenshots
Please add relevant environment information:
Additional context I use Postgres tables with INHERITANCE relationship between tables. I use "bigserial" id as primary key in tables
The text was updated successfully, but these errors were encountered:
The comparison should be case insensitive, as connector names are case insensitive as well (see SessionFactory). The canonical name is "postgresql".
Sorry, something went wrong.
Another improvement
In Postgres, the name of the sequence is autogenerated and is always tablename_columnname_seq.
So, the code below generates an exception: session << "SELECT currval('id_seq')", into(id), now;
Everything works for me with the following fixes: else if (session.connector() == "postgresql") { session << "SELECT lastval()", into(id), now; }
Sincerely yours
fix(ActiveRecord): Error between Poco::ActiveRecord and Poco::Data::P…
e428c4b
…ostgreSQL #4450
094a4e2
obiltschnig
No branches or pull requests
Describe the bug
I use Poco ActiveRecord with PostgreSQL 16.
I use ActiveRecord::lastInsertID(Poco::Data::Session& session) where Data::Session is a PostgreSQL Session.
In Data::Session, session.connector() returns "postgresql"
This method is used in ActiveRecord::lastInsertID and test with "if (session.connector() == "PostgreSQL")". This condition is not satisfied.
To Reproduce
m_pSession = Poco::SharedPtrPoco::Data::Session(new Session(PostgreSQL::Connector::KEY, dbConnString));
Context::Ptr pContext = new Context(*m_pSession);
Use this context with ActiveRecord
Expected behavior
Change test "if (session.connector() == "PostgreSQL")" by "if (session.connector() == "postgresql")" in ActiveRecord::lastInsertID
Logs
No Logs
Screenshots
No screenshots
Please add relevant environment information:
Additional context
I use Postgres tables with INHERITANCE relationship between tables.
I use "bigserial" id as primary key in tables
The text was updated successfully, but these errors were encountered: