Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid dumping COLLATE default for const clause #96

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/backend/utils/adt/ruleutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ static const char *query_getviewrule = "SELECT * FROM pg_catalog.pg_rewrite WHER
bool quote_all_identifiers = false;

print_pltsql_function_arguments_hook_type print_pltsql_function_arguments_hook = NULL;
get_tsql_const_collation_hook_type get_tsql_const_collation_hook = NULL;


/* ----------
Expand Down Expand Up @@ -10453,6 +10454,9 @@ get_const_collation(Const *constval, deparse_context *context)

if (constval->constcollid != typcollation)
{
if (get_tsql_const_collation_hook && !get_tsql_const_collation_hook(constval))
return;

appendStringInfo(buf, " COLLATE %s",
generate_collation_name(constval->constcollid));
}
Expand Down
3 changes: 3 additions & 0 deletions src/include/utils/ruleutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,7 @@ typedef int (*print_pltsql_function_arguments_hook_type) (StringInfo buf,
bool print_defaults);
extern PGDLLIMPORT print_pltsql_function_arguments_hook_type print_pltsql_function_arguments_hook;

typedef bool (*get_tsql_const_collation_hook_type) (Const *constval);
extern PGDLLIMPORT get_tsql_const_collation_hook_type get_tsql_const_collation_hook;

#endif /* RULEUTILS_H */