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

Quote fields with spaces #233

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions src/main/java/cz/startnet/utils/pgdiff/PgDiffUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ public class PgDiffUtils {
"XMLVALIDATE",
"YEAR",
"ZONE"};

/**
* Determine if use CREATE IF NOT EXISTS OR DROP IF EXISTS where is possible
*/
Expand All @@ -500,7 +500,7 @@ public static String getQuotedName(final String name,
for (int i = 0; i < name.length(); i++) {
final char chr = name.charAt(i);

if (Character.isUpperCase(chr)) {
if (Character.isUpperCase(chr) || Character.isSpaceChar(chr)) {
return '"' + name + '"';
}
}
Expand Down Expand Up @@ -532,7 +532,7 @@ public static String getQuotedName(final String name,
public static String getQuotedName(final String name) {
return getQuotedName(name, false);
}

/**
* IF useIfExists is true return DROP IF NOT EXISTS
*
Expand All @@ -546,7 +546,7 @@ public static String getDropIfExists() {
}
return "";
}

/**
* IF useIfExists is true return IF NOT EXISTS
*
Expand Down