Skip to content
New issue

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

Insert: lastval is not yet defined #317

Closed
JardaMoravec opened this issue Jul 7, 2021 · 1 comment
Closed

Insert: lastval is not yet defined #317

JardaMoravec opened this issue Jul 7, 2021 · 1 comment

Comments

@JardaMoravec
Copy link

It is not possible to insert into a table without id! For example, if the table has a composite primary key without auto increment.

Error:
SQLSTATE [55000]: Object not in prerequisite state: 7 ERROR: lastval is not yet defined in this session.

Environment:
PHP 7.3, PostgreSQL 11, fluentpdo 2.2.2

@cbornhoft
Copy link
Member

Hey @JardaMoravec, this is a late answer, but if you need to work with a table with no/composite PK, you can specify that in a new Structure instance. The custom instance can then be passed to the FluentPDO\Query constructor.

If you find yourself working with a mixture of both, I'd suggest using two instances of Query, which you could then flip between depending the structure you're working with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants