아직 postgreSQL을 설치하지 못하셨다면
https://sober-developer.tistory.com/36
[PostgreSQL] 설치하기
맥북M1 기준 PostgreSQL 설치를 해보겠습니다. 먼저 https://www.postgresql.org/ PostgreSQL The world's most advanced open source database. www.postgresql.org 해당 사이트에 접속해서 Download 버튼을 클릭합니다. 원하는 환경
sober-developer.tistory.com
아직 database, schema, table, sequence를 생성하지 않으셨다면
https://sober-developer.tistory.com/37
[PostgresSQL] Database, Schema, Table, Sequence 생성
설치를 아직 안 하셨다면 이전 포스팅 보고 설치 먼저 하고 오세요! https://sober-developer.tistory.com/36 [PostgreSQL] 설치하기 맥북M1 기준 PostgreSQL 설치를 해보겠습니다. 먼저 https://www.postgresql.org/ PostgreSQ
sober-developer.tistory.com
Query Tool 사용하기
[Schema 이름] 우클릭 > Query Tool 선택
테이블 조회 쿼리
SELECT * FROM "[스키마 명]"."[컬럼 명]";
작성 후 No Limit의 오른쪽 오른쪽에 있는 재생버튼을 클릭하면 실행됩니다.
Sequence의 현재 값 조회
SELECT LAST_VALUE FROM "[스키마 명]"."시퀀스 명]";
테이블에 시퀀스 이용해서 데이터 INSERT
INSERT INTO "[스키마 명]"."[테이블 명]"([시퀀스 들어갈 컬럼 명], 컬럼 명, ...) VALUES ( NEXTVAL('"[스키마 명]"."시퀀스 명"').'[들어갈 값]', '들어갈 값', ...);
고생하셨습니다.
문제 시 댓글 부탁드립니다.
바로 데이터베이스 백업으로 넘어갈게요
'DB & 클라우드 > PostgreSQL' 카테고리의 다른 글
[PostgreSQL] Database Backup (0) | 2023.06.27 |
---|---|
[PostgresSQL] Database, Schema, Table, Sequence 생성 (0) | 2023.06.27 |
[PostgreSQL] 설치하기 (0) | 2023.06.27 |