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:
<code>$db->lastInsertId('columnName'); </code>
Komunikat o błędzie mówi
<code>SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "columnName" does not exist </code>
Myślę, że mam pewne nieporozumienie dotyczące „obiektu sekwencji” określonego w podręczniku PHP.
<code>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. </code>
Obecnie „nazwa_kolumny” jest ciągiem tego atrybutu z automatyczną inkrementacją. Czy ktoś może wskazać, gdzie poszedłem źle? Dzięki.