Create the table with one column, your id. Then insert one row setting id to its initial value. All of that is initialisation for your app. Then when you come to use it, just do: update file_number set num = num + 1 returning num;
Create the table with one column, your id. Then insert one row setting id to its initial value. All of that is initialisation for your app. Then when you come to use it, just do: update file_number set num = num + 1 returning num;