I want a sequence to start with AP0000001 and get incremented by 1 so the next value will be AP0000002 and so on
So following are the queries I tried for
Creating sequence Create sequence patient_no_seq Start with 0000001 Increment by 1;
Creating a table Create table patient( id serial not null primary key, patient_no text not null default('AP' || nextval('patient_no_seq'));
When I try inserting the patient_no is incrementing in AP1, AP2... in this manner but I want it to get incremented as AP0000001, AP0000002... and so on