SnowConvert AI - PostgreSQL - CREATE VIEW¶
Translation from PostgreSQL to Snowflake
Applies to¶
- PostgreSQL
- Greenplum
- Netezza
Description¶
This command creates a view in a database, which is run every time the view is referenced in a query.
For more information, please refer to CREATE VIEW documentation.
Grammar Syntax¶
Code Examples¶
[OR REPLACE] [TEMP | TEMPORARY] [RECURSIVE]¶
Note
:class: tip This syntax is fully supported in Snowflake.
Input Code:¶
PostgreSQL¶
Output Code:¶
Snowflake¶
WITH CHECK CLAUSE¶
This WITH CHECK CLAUSE clause on a view enforces that any data inserted or updated through the view must satisfy the view’s defining conditions. LOCAL checks only the current view’s conditions, while CASCADED checks conditions of the view and all underlying views. It prevents creating rows that are invisible through the view and cannot be used with recursive views.
Danger
This syntax is not supported in Snowflake.
Input Code:¶
PostgreSQL¶
Output Code:¶
Snowflake¶
WITH PARAMETERS OPTIONS¶
This WITH PARAMETERS OPTIONS allows setting optional properties for the view, such as how modifications through the view are checked (check_option) and whether to enforce row-level security (security_barrier).
Danger
This syntax is not supported in Snowflake.
Input Code:¶
PostgreSQL¶
Output Code:¶
Snowflake¶
VALUES OPTION¶
Note
:class: tip This syntax is fully supported in Snowflake.