You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
seems that table needs to have PRIMARY KEY in order to fulfill INSERT statement without throwing an Error
setup:
Windows machine
Postgres 9.6
PHP 7.4.3 Development Server
SQLSTATE[55000]: Object not in prerequisite state: 7 ERROR: lastval is not yet defined in this session [\workspace\domain.com\devtracks\vendor\bcosca\fatfree-core\db\sql.php:524]
[/workspace/domain.com/_sub/devtracks/vendor/bcosca/fatfree-core/db/sql.php:524] call_user_func_array()
[/workspace/domain.com/_sub/devtracks/vendor/bcosca/fatfree-core/db/sql/mapper.php:489] DB\SQL->__call()
[/workspace/domain.com/_sub/devtracks/vendor/bcosca/fatfree-core/db/cursor.php:245] DB\SQL\Mapper->insert()
[/workspace/domain.com/_sub/devtracks/app/MVC/Controller/MainController.php:58] DB\Cursor->save()
[/workspace/domain.com/_sub/devtracks/vendor/bcosca/fatfree/lib/base.php:1960] MainController->locusTrackerNoResponse()
[/workspace/domain.com/_sub/devtracks/vendor/bcosca/fatfree/lib/base.php:1759] Base->call()
[/workspace/domain.com/_sub/devtracks/index.php:41] Base->run()
PS: the silly part is that it actually successfully inserts such row and only hint is in the log file.
The text was updated successfully, but these errors were encountered:
Yes the mapper is trying to reload the inserted record to obtain default values from the table, but without a returning pkey, that's not possible, hence the error.
fatfree/lib/db/sql.php
Line 524 in 62f40d8
https://stackoverflow.com/questions/32991564/how-to-check-in-postgres-that-lastval-is-defined
seems that table needs to have PRIMARY KEY in order to fulfill INSERT statement without throwing an Error
setup:
Windows machine
Postgres 9.6
PHP 7.4.3 Development Server
PS: the silly part is that it actually successfully inserts such row and only hint is in the log file.
The text was updated successfully, but these errors were encountered: