enable_case_sensitive_identifier - Amazon Redshift

enable_case_sensitive_identifier

값(기본값은 굵은 글꼴로 표시)

true, false

설명

데이터베이스, 테이블 및 열의 이름 식별자가 대/소문자를 구분하는지 여부를 결정하는 구성 값입니다. 이름 식별자의 대/소문자는 큰따옴표로 묶인 경우 유지됩니다. enable_case_sensitive_identifiertrue로 설정하면 이름 식별자의 대/소문자가 유지됩니다. enable_case_sensitive_identifierfalse로 설정하면 이름 식별자의 대/소문자가 유지되지 않습니다.

큰따옴표로 묶여 있는 사용자 이름의 대/소문자는 enable_case_sensitive_identifier 구성 옵션 설정과 관계없이 항상 유지됩니다.

다음 예에서는 테이블 및 열 이름에 대한 대/소문자 구분 식별자를 생성하고 사용하는 방법을 보여줍니다.

-- To create and use case sensitive identifiers SET enable_case_sensitive_identifier TO true; -- Create tables and columns with case sensitive identifiers CREATE TABLE "MixedCasedTable" ("MixedCasedColumn" int); CREATE TABLE MixedCasedTable (MixedCasedColumn int); -- Now query with case sensitive identifiers SELECT "MixedCasedColumn" FROM "MixedCasedTable"; MixedCasedColumn ------------------ (0 rows) SELECT MixedCasedColumn FROM MixedCasedTable; mixedcasedcolumn ------------------ (0 rows)

다음 예에서는 식별자의 대/소문자가 유지되지 않는 경우를 보여줍니다.

-- To not use case sensitive identifiers RESET enable_case_sensitive_identifier; -- Mixed case identifiers are lowercased CREATE TABLE "MixedCasedTable2" ("MixedCasedColumn" int); CREATE TABLE MixedCasedTable2 (MixedCasedColumn int); ERROR: Relation "mixedcasedtable2" already exists SELECT "MixedCasedColumn" FROM "MixedCasedTable2"; mixedcasedcolumn ------------------ (0 rows) SELECT MixedCasedColumn FROM MixedCasedTable2; mixedcasedcolumn ------------------ (0 rows)

사용 관련 참고 사항

  • 구체화된 뷰에 자동 새로 고침을 사용하는 경우 클러스터 또는 작업 그룹의 파라미터 그룹에서 enable_case_sensitive_identifier 값을 설정하는 것이 좋습니다. 이렇게 하면 구체화된 뷰가 새로 고쳐질 때 enable_case_sensitive_identifier가 일정하게 유지됩니다. 구체화된 뷰의 자동 새로 고침에 대한 자세한 내용은 구체화된 뷰 새로 고침 섹션을 참조하세요. 파라미터 그룹에서 구성 값을 설정하는 방법에 대한 자세한 내용은 Amazon Redshift 관리 안내서Amazon Redshift 파라미터 그룹을 참조하세요.

  • 행 수준 보안 또는 동적 데이터 마스킹 기능을 사용하는 경우 클러스터 또는 워크그룹의 파라미터 그룹에서 enable_case_sensitive_identifier 값을 설정하는 것이 좋습니다. 이렇게 하면 정책을 만들고 연결한 다음 정책이 적용된 관계를 쿼리하는 동안 enable_case_sensitive_identifier가 일정하게 유지됩니다. 행 수준 보안에 대한 자세한 내용은 행 수준 보안 섹션을 참조하세요. 동적 데이터 마스킹에 대한 자세한 내용은 동적 데이터 마스킹 섹션을 참조하세요.

  • enable_case_sensitive_identifier를 켬으로 설정하고 테이블을 만들 때 대소문자를 구분하는 열 이름을 설정할 수 있습니다. enable_case_sensitive_identifier를 끔으로 설정하고 테이블을 쿼리하면 열 이름이 소문자가 됩니다. 이렇게 하면 enable_case_sensitive_identifier를 켰을 때 다른 쿼리 결과가 생성될 수 있습니다. 다음 예제를 검토하십시오.

    SET enable_case_sensitive_identifier TO on; --Amazon Redshift preserves case for column names and other identifiers. --Create a table with two columns that are identical except for the case. CREATE TABLE t ("c" int, "C" int); INSERT INTO t VALUES (1, 2); SELECT * FROM t; c | C ---+--- 1 | 2 (1 row) SET enable_case_sensitive_identifier TO off; --Amazon Redshift no longer preserves case for column names and other identifiers. SELECT * FROM t; c | c ---+--- 1 | 1 (1 row)
  • 동적 데이터 마스킹 또는 행 수준 보안 정책이 첨부된 테이블을 쿼리하는 일반 사용자는 기본 enable_case_sensitive_identifier 설정을 사용하는 것이 좋습니다. 행 수준 보안에 대한 자세한 내용은 행 수준 보안 섹션을 참조하세요. 동적 데이터 마스킹에 대한 자세한 내용은 동적 데이터 마스킹 섹션을 참조하세요.