I have a database table in postgres which is used to generate receipt numbers for the company.The table has a column named receipt_number which is inserted when a row is recorded after post, all i do is check the last receipt_number and increment it by 1 to get the next receipt number,the problem is that when let say two clients pay at the same time,there are two rows recorded but they have the same receipt number,otherwise everything is fine.
Any idea of what is the cause of this...As it happens only when multiple clients make payments at the same time..
Thanks in advance