【Snowflake】I Tried Working Around the Error That Occurs in Shared Views with QUOTED_IDENTIFIERS_IGNORE_CASE

【Snowflake】I Tried Working Around the Error That Occurs in Shared Views with QUOTED_IDENTIFIERS_IGNORE_CASE

Setting QUOTED_IDENTIFIERS_IGNORE_CASE to TRUE in the consumer's session caused errors in a shared secure view. This post shows how I worked around it by setting FALSE on the source schema.
2026.12.02

This page has been translated by machine translation. View original

Introduction

This is kasama from the Data Business Division.

When I ran a SELECT on a secure view shared between Snowflake accounts, it sometimes resulted in an error. This happened when the source account had QUOTED_IDENTIFIERS_IGNORE_CASE set to its default value of FALSE, while the consumer's session had it set to TRUE.

In this post, I reproduce this error using two accounts in the same organization, and then work around it by setting the parameter on the source schema.

Prerequisites

What is QUOTED_IDENTIFIERS_IGNORE_CASE?

QUOTED_IDENTIFIERS_IGNORE_CASE is a parameter that determines whether names enclosed in double quotes are case-sensitive. Breaking the name down by its English meaning, QUOTED_IDENTIFIERS means "identifiers (names of tables and columns) enclosed in double quotes", and IGNORE_CASE means "ignore the difference between uppercase and lowercase". In other words, it is a parameter that determines whether to ignore case differences for identifiers enclosed in double quotes.

  • When TRUE
    • Case differences are ignored, and names enclosed in double quotes are also stored and searched as uppercase.
    • "orders" is treated as ORDERS.
  • When FALSE (default)
    • Differences are not ignored, and names enclosed in double quotes are stored and searched with the exact case in which they were written.
    • "orders" and "ORDERS" are different names.

https://docs.snowflake.com/en/sql-reference/parameters#quoted_identifiers_ignore_case

The Description in the official documentation says the following about setting it on a table, schema, or database.

When set on a table, schema, or database, the setting only affects the evaluation of table names in the bodies of views and user-defined functions (UDFs).

The value set on a table, schema, or database is used only when evaluating table names in the body of a view or UDF. The same Description continues with an explanation about sharing between accounts.

If your account uses double-quoted identifiers that should be treated as case-insensitive and you plan to share a view or UDF with an account that treats double-quoted identifiers as case-sensitive, you can set this on the view or UDF that you plan to share. This allows the other account to resolve the table names in the view or UDF correctly.

When sharing a view or UDF from an account that does not distinguish case in double-quoted names to an account that does, you can set this parameter on the view or UDF being shared. Then the consumer account can correctly resolve the table names inside the view or UDF. This time it is the opposite direction: sharing from a source that distinguishes case (FALSE) to a consumer that does not (TRUE).

Verification setup

I used two accounts in the same organization as the source and the consumer. In both accounts, this parameter is at its default value of FALSE. On the consumer side, I set TRUE with ALTER SESSION.

Setup before applying the setting

The parameter is not set on the source schema SHARE_LAYER. In this case, the names in the view body are considered to be evaluated with the consumer session's value, TRUE. The "raw_app"."orders" in the body is read as uppercase RAW_APP.ORDERS, and since there is no matching table, the SELECT results in an error.

Setup after applying the setting

I set QUOTED_IDENTIFIERS_IGNORE_CASE = FALSE on the source schema SHARE_LAYER. As mentioned in the prerequisites, the value set on the schema is used to evaluate table names in the view body. The "raw_app"."orders" in the body is evaluated with FALSE and read in lowercase as is, so the SELECT returns one row even when the consumer session remains TRUE.

Trying it out

The SQL used for the verification is stored on GitHub.

https://github.com/cm-yoshikikasama/blog_code/tree/main/76_snowflake_share_quoted_identifiers

Sharing a secure view from the source

On the source side, I created a schema and a table with lowercase names and referenced them from a secure view. The view name is uppercase, but the view body references lowercase "raw_app"."orders".

CREATE SECURE VIEW CM_KASAMA_QI_DB.SHARE_LAYER.ORDERS AS
SELECT
    "id" AS "ID",
    "order_no"
FROM CM_KASAMA_QI_DB."raw_app"."orders";

I added the view to the share and created a database from the share on the consumer side.

Reproducing the error on the consumer

When the consumer session is FALSE, the shared view can be queried with SELECT.

ALTER SESSION SET QUOTED_IDENTIFIERS_IGNORE_CASE = FALSE;
SELECT * FROM CM_KASAMA_QI_SHARED.SHARE_LAYER.ORDERS;

When I change the session to TRUE and run the same SELECT, it results in an error.

ALTER SESSION SET QUOTED_IDENTIFIERS_IGNORE_CASE = TRUE;
SELECT * FROM CM_KASAMA_QI_SHARED.SHARE_LAYER.ORDERS;

SQL compilation error: Failure during expansion of shared view 'ORDERS' as view owner: Error in secure object

The only thing I changed between the two executions was the consumer session's value. Because it is a secure view, the error only displays Error in secure object, and the table name that could not be found is not shown.

Setting the parameter on the view at the source

The Description on the parameters page says this parameter can be set on a shared view. So I tried whether it can be set on the source view with ALTER VIEW.

ALTER SESSION SET QUOTED_IDENTIFIERS_IGNORE_CASE = FALSE;
ALTER VIEW CM_KASAMA_QI_DB.SHARE_LAYER.ORDERS SET QUOTED_IDENTIFIERS_IGNORE_CASE = FALSE;

SQL access control error: Insufficient privileges to operate on view 'ORDERS'.

The ACCOUNTADMIN I ran this with is the owner of this view, but it resulted in an insufficient privileges error. On the ALTER VIEW page, the properties that can be specified with SET are SECURE, CHANGE_TRACKING, CONTACT, and COMMENT, and this parameter is not listed. The Type row on the parameters page also lists Account, Database, Schema, and Table as the objects this parameter can be set on, and does not include views.

https://docs.snowflake.com/en/sql-reference/sql/alter-view

Setting the parameter on the schema at the source

Next, I set FALSE on the schema containing the view.

ALTER SCHEMA CM_KASAMA_QI_DB.SHARE_LAYER SET QUOTED_IDENTIFIERS_IGNORE_CASE = FALSE;
SHOW PARAMETERS LIKE 'QUOTED_IDENTIFIERS_IGNORE_CASE' IN SCHEMA CM_KASAMA_QI_DB.SHARE_LAYER;

The value is false, the same as before the setting, but the level is now SCHEMA, confirming that it was explicitly set on the schema. This parameter is not listed in the syntax on the ALTER SCHEMA page either, but the execution succeeded.

https://docs.snowflake.com/en/sql-reference/sql/alter-schema

Confirming the SELECT succeeds on the consumer

I ran the SELECT again with the consumer session left at TRUE.

ALTER SESSION SET QUOTED_IDENTIFIERS_IGNORE_CASE = TRUE;
SHOW PARAMETERS LIKE 'QUOTED_IDENTIFIERS_IGNORE_CASE' IN SESSION;
SELECT * FROM CM_KASAMA_QI_SHARED.SHARE_LAYER.ORDERS;
SELECT "order_no" FROM CM_KASAMA_QI_SHARED.SHARE_LAYER.ORDERS;

The next image is the result of the SELECT * on the third line. I confirmed that the session value is true from the result of the second line.

The SELECT specifying a lowercase column name, as on the fourth line, also succeeded. The column name in the result is displayed as uppercase ORDER_NO.

Conclusion

Without changing any settings on the consumer side, I was able to avoid the error just by setting the parameter on the source schema. If the consumer has this parameter set on the account or user, changing the value would also affect other SQL run by that account or user. Therefore, I think it is better to try this method, which is completed on the source side alone, first. Since this was a simple verification with only one view, please check the results with your target views in your actual environment before deciding. I hope this is helpful.


Snowflakeの導入支援はクラスメソッドに!

クラスメソッドでは Snowflake の導入を支援しております。
製品の詳細や支援の内容についてお気軽にお問い合わせください。

Snowflakeの詳細を見る

Share this article

AWSのお困り事はクラスメソッドへ