database/postgres_ppas

PostgreSQL 테이블의 컬럼정보조회

공간사랑 2016. 5. 27. 17:01
반응형


[postgresql]테이블의 컬럼정보 조회

http://acpi.tistory.com/113



-- information_schema.columns 테이블 조회.
-- postgresql 자체가 소문자로 저장되기 때문에 조건절의 테이블명은 반드시 소문자로 해야합니다.


select table_name,column_name,data_type,character_maximum_length,is_nullable
from   information_schema.columns
where  table_name = '테이블명'
order by ordinal_position;



반응형