Looking for a JavaEE Architect or Potential Tech Co-Founder?
Please don't hesitate to contact me.

How to alter the sequence value in postgresql

This script will change the value of the sequence value, for example we have a table EMPLOYEE and sequence EMPLOYEE_SEQ:
DROP SEQUENCE EMPLOYEE_SEQ_SEQ;
CREATE SEQUENCE EMPLOYEE_SEQ_SEQ start with 2 increment by 1;
The script will set the sequence to 2 and to be incremented by 1.

To alter a table:
alter table EMPLOYEE alter column money type NUMERIC(23, 2);

To alter a table and set a default value:
alter table CRM_PROVIDER alter column RATING_ROUNDING set default 2;
How to alter the sequence value in postgresql How to alter the sequence value in postgresql Reviewed by Edward Legaspi on Thursday, May 30, 2013 Rating: 5

No comments:

Powered by Blogger.