This commit is contained in:
Sergey Olontsev 2025-06-30 08:16:17 +03:00
parent 2e5f3562f0
commit d9cc504c32
No known key found for this signature in database
GPG key ID: 67DDC06CA52E8A39
2 changed files with 8 additions and 6 deletions

View file

@ -5193,24 +5193,24 @@ impl fmt::Display for Statement {
server_type,
version,
fdw_name,
options
options,
} => {
write!(
f,
"CREATE SERVER {if_not_exists}{name} ",
if_not_exists = if *if_not_exists { "IF NOT EXISTS " } else { "" },
)?;
if let Some(st) = server_type {
write!(f, "TYPE {st} ")?;
}
if let Some(v) = version {
write!(f, "VERSION {v} ")?;
}
write!(f, "FOREIGN DATA WRAPPER {fdw_name}")?;
if let Some(o) = options {
write!(f, " OPTIONS ({o})", o = display_comma_separated(o))?;
}

View file

@ -4662,7 +4662,9 @@ impl<'a> Parser<'a> {
self.parse_create_procedure(or_alter)
} else if self.parse_keyword(Keyword::CONNECTOR) {
self.parse_create_connector()
} else if self.parse_keyword(Keyword::SERVER) && dialect_of!(self is PostgreSqlDialect | GenericDialect) {
} else if self.parse_keyword(Keyword::SERVER)
&& dialect_of!(self is PostgreSqlDialect | GenericDialect)
{
self.parse_pg_create_server()
} else {
self.expected("an object type after CREATE", self.peek_token())