You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- 전체 데이터베이스 조회SELECT datname FROM pg_database;
-- 사용자가 생성한 데이터베이스만 조회(아래 두 개 동일)SELECT datname FROM pg_database WHERE datistemplate = false;
SELECT*FROM pg_tables WHERE schemaname ='public';
-- 전체 테이블 조회(show tables)SELECT tablename FROM pg_tables;
-- 사용자가 생성한 테이블만 조회(아래 두 개 동일)SELECT*FROM pg_tables WHERE schemaname ='public';
SELECT RELNAME AS TABLE_NAME FROM PG_STAT_USER_TABLES;
-- 컬럼 목록 조회(desc table명)SELECT*FROMINFORMATION_SCHEMA.COLUMNSWHERE TABLE_CATALOG ='yapp'AND TABLE_NAME ='folder'ORDER BY ORDINAL_POSITION;
SELECT*FROMinformation_schema.columnsWHERE table_schema ='public'AND table_name ='folder'ORDER BY ordinal_position;
-- 컬럼 디폴트값 설정ALTERTABLE folder ALTER COLUMN bookmark_count SET DEFAULT 0;
ALTERTABLE folder ALTER COLUMN created_at SET DEFAULT now();
-- id sequence(auto_increment) resetALTERSEQUENCE folder_id_seq RESTART WITH 7;
The text was updated successfully, but these errors were encountered:
PostgreSQL 문법 정리(pgAdmin 4 기반)
The text was updated successfully, but these errors were encountered: