반응형
250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- codepipeline
- JavaScript
- PostgreSQL
- Flux
- COALESCE
- Airflow
- chart.js
- or some instances in your deployment group are experiencing problems.
- codebuild
- IntelliJ
- Spring Error
- codedeploy
- Python
- bootstrap
- Kafka
- codedeploy error
- java bigdecimal
- docker
- aws
- Spring
- 도커
- redis
- kubeflow
- Jenkins
- AWS CI/CD 구축하기
- VPN
- chartjs
- SQL
- node
- aws cicd
Archives
- Today
- Total
Small Asteroid Blog
postgresql id자동증가 - sequence 만들기 본문
728x90
DB에서 자동 증가를 생성하려고한다.
Postgresql , Oracle 은 Sequence 의 독릭 오브젝트를 사용하고
MySQL은 컬럼에 AUTO_INCREMENT 를 사용한다.
sequence 만들기
create sequence seq_tablename;
drop sequence seq_tablename;
CREATE TABLE gtcktest.tablename (
id int8 DEFAULT nextval('seq_tablename'),
dominant float8 NULL,
contribution float8 NULL,
topic text NULL,
docid int8 NULL,
CONSTRAINT topictab_pk PRIMARY KEY (id)
);
728x90
반응형
'백엔드 > DB' 카테고리의 다른 글
[PostgreSQL] if the message is not readable, please check database logs and/or host, port, dbname, user, password, pg_hba.conf (0) | 2021.12.22 |
---|---|
postgresql sequence 시퀀스 만들기 (0) | 2021.12.07 |
postgresql 최대 동시 접속자 수를 초과했습니다 해결 (2) | 2021.11.18 |
[postgresql] dt did not find any relations (0) | 2021.11.15 |
postgresql 테이블 데이터 모두 삭제 (truncate) (0) | 2021.11.15 |