currval, lastval, nextvar?
| От | Carol Walter |
|---|---|
| Тема | currval, lastval, nextvar? |
| Дата | |
| Msg-id | E38AF20C-A2CB-4E7C-8CDA-AD06C35E61D0@indiana.edu обсуждение исходный текст |
| Ответы |
Re: currval, lastval, nextvar?
Re: currval, lastval, nextvar? |
| Список | pgsql-novice |
Hello, I want write a query that will insert a record in a person table, insert a record in a presentation table, and then insert a record into a bridge table that contains the keys of both of the newly created records from the other two tables. According to the documentation, takes the next number in the sequence and reports it. Both currval and lastval report the last value that was taken from the sequence, but both will produce errors if a "nextval" was not called in the current session. Does writing a record that automatically updates a sequence count as calling nextval? Thanks, Carol Walter
В списке pgsql-novice по дате отправления: