lastInsertId nie działa w Postgresql
Używam Postgresql, gdy chcę użyć PDO do pobrania najnowszego identyfikatora wstawienia, mam problem. Oto mój kod:
$db->lastInsertId('columnName');
Komunikat o błędzie mówi
SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "columnName" does not exist
Myślę, że mam pewne nieporozumienie dotyczące „obiektu sekwencji” określonego w podręczniku PHP.
Note:
Returns the ID of the last inserted row, or the last value from a sequence object,
depending on the underlying driver. For example, PDO_PGSQL() requires you to specify the
name of a sequence object for the name parameter.
Obecnie „nazwa_kolumny” jest ciągiem tego atrybutu z automatyczną inkrementacją. Czy ktoś może wskazać, gdzie poszedłem źle? Dzięki.