메인 콘텐츠로 건너뛰기
INFORMATION_SCHEMA(또는 information_schema)는 데이터베이스 객체의 메타데이터에 대해 (어느 정도) 표준화된 DBMS 비종속적 뷰를 제공하는 system 데이터베이스입니다. INFORMATION_SCHEMA의 뷰는 일반적으로 일반 시스템 테이블보다 기능이 다소 제한적이지만, 도구에서 DBMS 전반에 걸쳐 기본 정보를 얻는 데 사용할 수 있습니다. INFORMATION_SCHEMA의 뷰 구조와 내용은 하위 호환성을 유지하는 방식으로 발전하도록 설계되어 있습니다. 즉, 새로운 기능만 추가되고 기존 기능은 변경되거나 제거되지 않습니다. 내부 구현 측면에서 INFORMATION_SCHEMA의 뷰는 일반적으로 system.columns, system.databases, system.tables와 같은 일반 시스템 테이블에 매핑됩니다.
SHOW TABLES FROM INFORMATION_SCHEMA;

-- 또는:
SHOW TABLES FROM information_schema;
┌─name────────────────────┐
│ COLUMNS                 │
│ KEY_COLUMN_USAGE        │
│ REFERENTIAL_CONSTRAINTS │
│ SCHEMATA                │
| STATISTICS              |
│ TABLES                  │
│ VIEWS                   │
│ columns                 │
│ key_column_usage        │
│ referential_constraints │
│ schemata                │
| statistics              |
│ tables                  │
│ views                   │
└─────────────────────────┘
INFORMATION_SCHEMA에는 다음 VIEW가 포함되어 있습니다: 다른 데이터베이스와의 호환성을 위해 대소문자를 구분하지 않는 동등한 VIEW(예: INFORMATION_SCHEMA.columns)도 제공합니다. 이는 이러한 VIEW의 모든 컬럼에도 동일하게 적용되며, 소문자(예: table_name)와 대문자(TABLE_NAME) 형태를 모두 제공합니다.

COLUMNS

system.columns 시스템 테이블(system table)에서 읽은 컬럼과, ClickHouse에서 지원되지 않거나 의미가 없지만(항상 NULL) 표준상 반드시 포함되어야 하는 컬럼을 포함합니다. 컬럼:
  • table_catalog (String) — 현재는 사용되지 않습니다.
  • table_schema (String) — 현재는 사용되지 않습니다.
  • table_name (String) — 현재는 사용되지 않습니다.
  • non_unique (Int32) — 현재는 사용되지 않습니다.
  • index_schema (String) — 현재는 사용되지 않습니다.
  • index_name (Nullable(String)) — 현재는 사용되지 않습니다.
  • seq_in_index (UInt32) — 현재는 사용되지 않습니다.
  • column_name (Nullable(String)) — 현재는 사용되지 않습니다.
  • collation (Nullable(String)) — 현재는 사용되지 않습니다.
  • cardinality (Nullable(Int64)) — 현재는 사용되지 않습니다.
  • sub_part (Nullable(Int64)) — 현재는 사용되지 않습니다.
  • packed (Nullable(String)) — 현재는 사용되지 않습니다.
  • nullable (String) — 현재는 사용되지 않습니다.
  • index_type (String) — 현재는 사용되지 않습니다.
  • comment (String) — 현재는 사용되지 않습니다.
  • index_comment (String) — 현재는 사용되지 않습니다.
  • is_visible (String) — 현재는 사용되지 않습니다.
  • expression (Nullable(String)) — 현재는 사용되지 않습니다.
예시
Query
SELECT table_catalog,
       table_schema,
       table_name,
       column_name,
       ordinal_position,
       column_default,
       is_nullable,
       data_type,
       character_maximum_length,
       character_octet_length,
       numeric_precision,
       numeric_precision_radix,
       numeric_scale,
       datetime_precision,
       character_set_catalog,
       character_set_schema,
       character_set_name,
       collation_catalog,
       collation_schema,
       collation_name,
       domain_catalog,
       domain_schema,
       domain_name,
       column_comment,
       column_type
FROM INFORMATION_SCHEMA.COLUMNS
WHERE (table_schema = currentDatabase() OR table_schema = '')
  AND table_name NOT LIKE '%inner%' 
LIMIT 1 
FORMAT Vertical;
Response
Row 1:
──────
table_catalog:            default
table_schema:             default
table_name:               describe_example
column_name:              id
ordinal_position:         1
column_default:
is_nullable:              0
data_type:                UInt64
character_maximum_length: ᴺᵁᴸᴸ
character_octet_length:   ᴺᵁᴸᴸ
numeric_precision:        64
numeric_precision_radix:  2
numeric_scale:            0
datetime_precision:       ᴺᵁᴸᴸ
character_set_catalog:    ᴺᵁᴸᴸ
character_set_schema:     ᴺᵁᴸᴸ
character_set_name:       ᴺᵁᴸᴸ
collation_catalog:        ᴺᵁᴸᴸ
collation_schema:         ᴺᵁᴸᴸ
collation_name:           ᴺᵁᴸᴸ
domain_catalog:           ᴺᵁᴸᴸ
domain_schema:            ᴺᵁᴸᴸ
domain_name:              ᴺᵁᴸᴸ

SCHEMATA

system.databases 시스템 테이블에서 읽어온 컬럼과, ClickHouse에서 지원되지 않거나 의미가 없지만(항상 NULL) 표준상 반드시 포함되어야 하는 컬럼을 포함합니다. 컬럼:
  • catalog_name (String) — 데이터베이스 이름입니다.
  • schema_name (String) — 데이터베이스 이름입니다.
  • schema_owner (String) — 스키마 소유자 이름이며, 항상 'default'입니다.
  • default_character_set_catalog (Nullable(String)) — NULL이며, 지원되지 않습니다.
  • default_character_set_schema (Nullable(String)) — NULL이며, 지원되지 않습니다.
  • default_character_set_name (Nullable(String)) — NULL이며, 지원되지 않습니다.
  • sql_path (Nullable(String)) — NULL이며, 지원되지 않습니다.
예시
Query
SELECT catalog_name,
       schema_name,
       schema_owner,
       default_character_set_catalog,
       default_character_set_schema,
       default_character_set_name,
       sql_path
FROM information_schema.schemata
WHERE schema_name ILIKE 'information_schema' 
LIMIT 1 
FORMAT Vertical;
Response
Row 1:
──────
catalog_name:                  INFORMATION_SCHEMA
schema_name:                   INFORMATION_SCHEMA
schema_owner:                  default
default_character_set_catalog: ᴺᵁᴸᴸ
default_character_set_schema:  ᴺᵁᴸᴸ
default_character_set_name:    ᴺᵁᴸᴸ
sql_path:                      ᴺᵁᴸᴸ

TABLES

system.tables 시스템 테이블에서 읽어 온 컬럼을 포함합니다. 컬럼:
  • table_catalog (String) — 테이블이 위치한 데이터베이스의 이름입니다.
  • table_schema (String) — 테이블이 위치한 데이터베이스의 이름입니다.
  • table_name (String) — 테이블 이름입니다.
  • table_type (String) — 테이블 유형입니다. 가능한 값:
    • BASE TABLE
    • VIEW
    • FOREIGN TABLE
    • LOCAL TEMPORARY
    • SYSTEM VIEW
  • table_rows (Nullable(UInt64)) — 전체 행 수입니다. 확인할 수 없는 경우 NULL입니다.
  • data_length (Nullable(UInt64)) — 디스크에 저장된 데이터 크기입니다. 확인할 수 없는 경우 NULL입니다.
  • index_length (Nullable(UInt64)) — 프라이머리 키, 보조 인덱스, 그리고 모든 마크의 전체 크기입니다.
  • table_collation (Nullable(String)) — 테이블의 기본 콜레이션입니다. 항상 utf8mb4_0900_ai_ci입니다.
  • table_comment (Nullable(String)) — 테이블 생성 시 사용된 설명입니다.
예시
Query
SELECT table_catalog, 
       table_schema, 
       table_name, 
       table_type, 
       table_collation, 
       table_comment
FROM INFORMATION_SCHEMA.TABLES
WHERE (table_schema = currentDatabase() OR table_schema = '')
  AND table_name NOT LIKE '%inner%'
LIMIT 1 
FORMAT Vertical;
Response
Row 1:
──────
table_catalog:   default
table_schema:    default
table_name:      describe_example
table_type:      BASE TABLE
table_collation: utf8mb4_0900_ai_ci
table_comment:   

VIEWS

테이블 엔진 View을 사용하는 경우 system.tables 시스템 테이블에서 읽어온 컬럼이 포함됩니다. 컬럼:
  • table_catalog (String) — 테이블이 위치한 데이터베이스의 이름입니다.
  • table_schema (String) — 테이블이 위치한 데이터베이스의 이름입니다.
  • table_name (String) — 테이블 이름입니다.
  • view_definition (String) — 뷰의 SELECT 쿼리입니다.
  • check_option (String) — NONE, 검사를 수행하지 않음을 의미합니다.
  • is_updatable (Enum8) — NO, 뷰는 업데이트되지 않습니다.
  • is_insertable_into (Enum8) — 생성된 뷰가 구체화된 뷰(Materialized View)인지 여부를 나타냅니다. 가능한 값은 다음과 같습니다:
    • NO — 생성된 뷰는 구체화된 뷰가 아닙니다.
    • YES — 생성된 뷰는 구체화된 뷰입니다.
  • is_trigger_updatable (Enum8) — NO, 트리거는 업데이트되지 않습니다.
  • is_trigger_deletable (Enum8) — NO, 트리거는 삭제되지 않습니다.
  • is_trigger_insertable_into (Enum8) — NO, 트리거에 데이터가 삽입되지 않습니다.
예시
Query
CREATE VIEW v (n Nullable(Int32), f Float64) AS SELECT n, f FROM t;
CREATE MATERIALIZED VIEW mv ENGINE = Null AS SELECT * FROM system.one;
SELECT table_catalog,
       table_schema,
       table_name,
       view_definition,
       check_option,
       is_updatable,
       is_insertable_into,
       is_trigger_updatable,
       is_trigger_deletable,
       is_trigger_insertable_into
FROM information_schema.views
WHERE table_schema = currentDatabase() 
LIMIT 1
FORMAT Vertical;
Response
Row 1:
──────
table_catalog:              default
table_schema:               default
table_name:                 mv
view_definition:            SELECT * FROM system.one
check_option:               NONE
is_updatable:               NO
is_insertable_into:         YES
is_trigger_updatable:       NO
is_trigger_deletable:       NO
is_trigger_insertable_into: NO

KEY_COLUMN_USAGE

제약 조건이 적용된 system.tables 시스템 테이블의 컬럼을 포함합니다. 컬럼:
  • constraint_catalog (String) — 현재 사용되지 않습니다. 항상 def입니다.
  • constraint_schema (String) — 제약 조건이 속한 스키마(데이터베이스)의 이름입니다.
  • constraint_name (Nullable(String)) — 제약 조건의 이름입니다.
  • table_catalog (String) — 현재 사용되지 않습니다. 항상 def입니다.
  • table_schema (String) — 테이블이 속한 스키마(데이터베이스)의 이름입니다.
  • table_name (String) — 제약 조건이 적용된 테이블의 이름입니다.
  • column_name (Nullable(String)) — 제약 조건이 적용된 컬럼의 이름입니다.
  • ordinal_position (UInt32) — 현재 사용되지 않습니다. 항상 1입니다.
  • position_in_unique_constraint (Nullable(UInt32)) — 현재 사용되지 않습니다. 항상 NULL입니다.
  • referenced_table_schema (Nullable(String)) — 현재 사용되지 않습니다. 항상 NULL입니다.
  • referenced_table_name (Nullable(String)) — 현재 사용되지 않습니다. 항상 NULL입니다.
  • referenced_column_name (Nullable(String)) — 현재 사용되지 않습니다. 항상 NULL입니다.
예시
Query
CREATE TABLE test (i UInt32, s String) ENGINE MergeTree ORDER BY i;
SELECT constraint_catalog,
       constraint_schema,
       constraint_name,
       table_catalog,
       table_schema,
       table_name,
       column_name,
       ordinal_position,
       position_in_unique_constraint,
       referenced_table_schema,
       referenced_table_name,
       referenced_column_name
FROM information_schema.key_column_usage 
WHERE table_name = 'test' 
FORMAT Vertical;
Response
Row 1:
──────
constraint_catalog:            def
constraint_schema:             default
constraint_name:               PRIMARY
table_catalog:                 def
table_schema:                  default
table_name:                    test
column_name:                   i
ordinal_position:              1
position_in_unique_constraint: ᴺᵁᴸᴸ
referenced_table_schema:       ᴺᵁᴸᴸ
referenced_table_name:         ᴺᵁᴸᴸ
referenced_column_name:        ᴺᵁᴸᴸ

REFERENTIAL_CONSTRAINTS

외래 키에 대한 정보를 포함합니다. 현재는 빈 결과(행 없음)만 반환하며, 이는 Tableau Online과 같은 타사 도구와의 호환성을 제공하는 데 필요한 최소한의 수준입니다. 컬럼:
  • constraint_catalog (String) — 현재 사용되지 않습니다.
  • constraint_schema (String) — 현재 사용되지 않습니다.
  • constraint_name (Nullable(String)) — 현재 사용되지 않습니다.
  • unique_constraint_catalog (String) — 현재 사용되지 않습니다.
  • unique_constraint_schema (String) — 현재 사용되지 않습니다.
  • unique_constraint_name (Nullable(String)) — 현재 사용되지 않습니다.
  • match_option (String) — 현재 사용되지 않습니다.
  • update_rule (String) — 현재 사용되지 않습니다.
  • delete_rule (String) — 현재 사용되지 않습니다.
  • table_name (String) — 현재 사용되지 않습니다.
  • referenced_table_name (String) — 현재 사용되지 않습니다.

STATISTICS

테이블 인덱스에 대한 정보를 제공합니다. 현재는 빈 결과(행 없음)만 반환하며, Tableau Online과 같은 타사 도구와의 호환성을 유지하는 데 필요한 최소한의 수준만 제공합니다.
마지막 수정일 2026년 6월 10일