본문 바로가기

[Database]/PostgreSQL

pg_dump schema (MySQL : show create table tablename)

PostgreSQL 스키마 알아보기.

MySQL에서 사용하던 show create table [테이블이름] 을 지원하지 않는다.

그리하여

pg_dump --schema-only -t tablename

이명령을 써야 한다.

 

pg_dump [DB이름] -U [접속계정] --schema-only -t [Table이름] > dump.sql

 

이렇게 하면 'dump.sql' 파일에 내용이 담긴다.

 

끝.

'[Database] > PostgreSQL' 카테고리의 다른 글

NULL 체크 및 문자열 합치기  (0) 2015.06.08
CSV 백업파일 생성  (0) 2015.04.06
psql 테이블 백업파일 insert  (0) 2015.03.20
pg_dump insert 구문  (0) 2014.11.13
Start / 기본 명령어  (0) 2014.10.22