@@ -5405,8 +5405,10 @@ impl<'a> Parser<'a> {
54055405 self.parse_create_policy().map(Into::into)
54065406 } else if self.parse_keyword(Keyword::EXTERNAL) {
54075407 self.parse_create_external_table(or_replace).map(Into::into)
5408+ } else if self.parse_keywords(&[Keyword::SECURE, Keyword::FUNCTION]) {
5409+ self.parse_create_function(or_alter, or_replace, temporary, true)
54085410 } else if self.parse_keyword(Keyword::FUNCTION) {
5409- self.parse_create_function(or_alter, or_replace, temporary)
5411+ self.parse_create_function(or_alter, or_replace, temporary, false )
54105412 } else if self.parse_keyword(Keyword::DOMAIN) {
54115413 self.parse_create_domain().map(Into::into)
54125414 } else if self.parse_keyword(Keyword::TRIGGER) {
@@ -5938,12 +5940,13 @@ impl<'a> Parser<'a> {
59385940 or_alter: bool,
59395941 or_replace: bool,
59405942 temporary: bool,
5943+ secure: bool,
59415944 ) -> Result<Statement, ParserError> {
59425945 if dialect_of!(self is HiveDialect) {
59435946 self.parse_hive_create_function(or_replace, temporary)
59445947 .map(Into::into)
59455948 } else if dialect_of!(self is PostgreSqlDialect | GenericDialect | SnowflakeDialect) {
5946- self.parse_postgres_create_function(or_replace, temporary)
5949+ self.parse_postgres_create_function(or_replace, temporary, secure )
59475950 .map(Into::into)
59485951 } else if dialect_of!(self is DuckDbDialect) {
59495952 self.parse_create_macro(or_replace, temporary)
@@ -5966,6 +5969,7 @@ impl<'a> Parser<'a> {
59665969 &mut self,
59675970 or_replace: bool,
59685971 temporary: bool,
5972+ secure: bool,
59695973 ) -> Result<CreateFunction, ParserError> {
59705974 let name = self.parse_object_name(false)?;
59715975
@@ -6105,6 +6109,7 @@ impl<'a> Parser<'a> {
61056109 or_alter: false,
61066110 or_replace,
61076111 temporary,
6112+ secure,
61086113 name,
61096114 args: Some(args),
61106115 return_type,
@@ -6141,6 +6146,7 @@ impl<'a> Parser<'a> {
61416146 or_alter: false,
61426147 or_replace,
61436148 temporary,
6149+ secure: false,
61446150 name,
61456151 function_body: Some(body),
61466152 using,
@@ -6221,6 +6227,7 @@ impl<'a> Parser<'a> {
62216227 or_alter: false,
62226228 or_replace,
62236229 temporary,
6230+ secure: false,
62246231 if_not_exists,
62256232 name,
62266233 args: Some(args),
@@ -6312,6 +6319,7 @@ impl<'a> Parser<'a> {
63126319 or_alter,
63136320 or_replace,
63146321 temporary,
6322+ secure: false,
63156323 if_not_exists: false,
63166324 name,
63176325 args: Some(args),
0 commit comments