Navigation Menu

Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Commit

Permalink
Always add parenthesis, even if there is no columns
Browse files Browse the repository at this point in the history
The CREATE TABLE statement should always have parenthesis, even if there is no
column or option between them.
  • Loading branch information
gleu committed Jul 22, 2011
1 parent 6a71362 commit a387554
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions pgadmin/schema/pgTable.cpp
Expand Up @@ -290,7 +290,6 @@ wxString pgTable::GetSql(ctlTree *browser)
wxString colDetails, conDetails;
wxString prevComment;
wxString cols_sql = wxEmptyString;
bool showparens = false;

wxString columnPrivileges;

Expand Down Expand Up @@ -361,7 +360,6 @@ wxString pgTable::GetSql(ctlTree *browser)
{
cols_sql += wxString::Format(wxT("-- %s "), _("Inherited"))
+ wxT("from table ") + column->GetInheritedTableName() + wxT(":");
showparens = true;
}
}

Expand All @@ -377,14 +375,12 @@ wxString pgTable::GetSql(ctlTree *browser)
{
cols_sql += wxT(" ") + column->GetQuotedIdentifier() + wxT(" WITH OPTIONS ")
+ column->GetDefinition();
showparens = true;
}
}
else
{
cols_sql += wxT(" ") + column->GetQuotedIdentifier() + wxT(" ")
+ column->GetDefinition();
showparens = true;
}

prevComment = column->GetComment();
Expand Down Expand Up @@ -455,10 +451,7 @@ wxString pgTable::GetSql(ctlTree *browser)
if (!prevComment.IsEmpty())
cols_sql += wxT(" -- ") + firstLineOnly(prevComment);

if (showparens)
sql += wxT("\n(\n") + cols_sql + wxT("\n)");
else
sql += wxT("\n-- (\n") + cols_sql + wxT("\n-- )");
sql += wxT("\n(\n") + cols_sql + wxT("\n)");

if (GetInheritedTableCount())
{
Expand Down

0 comments on commit a387554

Please sign in to comment.