PostgreSQL next value of the sequences?

后端 未结 7 1655
天命终不由人
天命终不由人 2020-12-01 14:20

I am using PostgreSQL for my Codeigniter website. I am using grocery crud for add, edit and delete operations. While doing an edit or add, I want to rename an uploaded file

相关标签:
7条回答
  • 2020-12-01 14:45

    I stumbled upon this question b/c I was trying to find the next sequence value by table. This didn't answer my question however this is how its done, and it may help those looking for the sequence value not by name but by table:

    SELECT nextval(pg_get_serial_sequence('<your_table>', 'id')) AS new_id; 
    

    Hope it helps :)

    0 讨论(0)
提交回复
热议问题