

 Amazon Redshift は、パッチ 198 以降、新しい Python UDF の作成をサポートしなくなります。既存の Python UDF は、2026 年 6 月 30 日まで引き続き機能します。詳細については、[ブログ記事](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/)を参照してください。

# enable\_case\_sensitive\_identifier
<a name="r_enable_case_sensitive_identifier"></a>

## 値 (デフォルトは太字）
<a name="r_enable_case_sensitive_identifier-values"></a>

true、**false**

## 説明
<a name="r_enable_case_sensitive_identifier-description"></a>

データベース、スキーマ、テーブル、および列の名前識別子が大文字と小文字を区別するかどうかを決定する設定値。識別子を二重引用符で囲み、`enable_case_sensitive_identifier` を `true` に設定すると、名前識別子の大文字と小文字が保持されます。識別子を二重引用符で囲まない場合、または `enable_case_sensitive_identifier` を `false` に設定した場合、名前識別子の大文字と小文字は保持されず、代わりに小文字に変換されます。

二重引用符で囲まれた*ユーザーネーム*の大文字と小文字は、`enable_case_sensitive_identifier`設定オプションの設定にかかわらず、常に保持されます。

## 例
<a name="w2aac61c49b7"></a>

次の例は、テーブル名と列名で大文字と小文字を区別する識別子を作成して使用する方法を示しています。

```
-- To create and use case sensitive identifiers
SET enable_case_sensitive_identifier TO true;
        
-- Create tables and columns with case sensitive identifiers
CREATE TABLE public."MixedCasedTable" ("MixedCasedColumn" int);
            
INSERT INTO public."MixedCasedTable" VALUES (1);
INSERT INTO public."MixedCasedTable" VALUES (2);
INSERT INTO public."MixedCasedTable" VALUES (3);
INSERT INTO public."MixedCasedTable" VALUES (4);
INSERT INTO public."MixedCasedTable" VALUES (5);

-- Now query with case sensitive identifiers
SELECT "MixedCasedColumn" FROM public."MixedCasedTable";           

MixedCasedColumn
------------------
1
2
3
4
5

(5 rows)

            
SELECT * FROM public."MixedCasedTable" WHERE "MixedCasedColumn" = 1;            

mixedcasedcolumn
------------------
1

(1 row)
```

次の例では、識別子の大文字と小文字が保持されない場合を示しています。

```
-- To not use case sensitive identifiers
RESET enable_case_sensitive_identifier;

-- Mixed case identifiers are lowercased despite double quotation marks

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)
```

## 使用に関する注意事項
<a name="r_enable_case_sensitive_identifier-usage-notes"></a>
+  マテリアライズドビューに自動更新を使用している場合は、クラスターまたはワークグループのパラメータグループで `enable_case_sensitive_identifier` 値を設定することをお勧めします。これにより、マテリアライズドビューが更新されても、`enable_case_sensitive_identifier` は一定に保たれます。マテリアライズドビューの自動更新については、「[マテリアライズドビューの更新](materialized-view-refresh.md)」を参照してください。パラメータグループの構成値の設定については、*Amazon Redshift 管理ガイド*の「[Amazon Redshift パラメータグループ](https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html)」を参照してください。
+  行レベルのセキュリティ機能や動的データマスキング機能を使用している場合、クラスターまたはワークグループのパラメータグループに `enable_case_sensitive_identifier` 値を設定することをお勧めします。これにより、ポリシーを作成してアタッチし、ポリシーが適用されたリレーションをクエリするまでの間、`enable_case_sensitive_identifier` の一貫性が保たれます。行レベルのセキュリティの詳細については、「[行レベルのセキュリティ](t_rls.md)」を参照してください。動的データマスキングの詳細については、「[動的データマスキング](t_ddm.md)」を参照してください。
+  `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 設定を使用することをお勧めします。行レベルのセキュリティの詳細については、「[行レベルのセキュリティ](t_rls.md)」を参照してください。動的データマスキングの詳細については、「[動的データマスキング](t_ddm.md)」を参照してください。
+ 大文字と小文字が混在する識別子をドット表記で参照するには、大文字と小文字を区別する各識別子を二重引用符で囲みます。例えば、`public."MixedCasedTable"."MixedCasedColumn"`。