Review of the pg_sequences view.

This seems like a useful addition to me, making life easier for administrators and monitoring tools. While there is already a view in information_schema it is missing cache_size and last_value.

= Functional review

- The patch applies and passes the test suite without any issue.

- A worry is that it might get a bit confusing to have both the future catalog pg_sequence and the view pg_sequences.

- I think it would be useful to include is_cycled in the view.

- When creating a temporary sequences and then running "SELECT * FROM pg_sequences" in another session I get the following error.

ERROR:  cannot access temporary tables of other sessions

- Shouldn't last_value be NULL directly after we have created the sequence but nobody has called nextval() yet?

- I noticed that last_value includes the cached values, but that also seems to me like the correct thing to do.

- I do not like the name of the new function, lastval(regclass). I think like you suggested it would be better with something more verbose. sequence_lastval()? sequence_last_value()?

= Code

- There is an XXX comment still in the code. It is about the name of the lastval1() function.

= Documentation

- The documentation does not mention the last_value column.

- The extra empty line after "</table>" does not fit with the formatting of the rest of the SGML file.


Sent via pgsql-hackers mailing list (
To make changes to your subscription:

Reply via email to