 pgadmin/schema/pgView.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pgadmin/schema/pgView.cpp b/pgadmin/schema/pgView.cpp
index d5db0aa..1784ce9 100644
--- a/pgadmin/schema/pgView.cpp
+++ b/pgadmin/schema/pgView.cpp
@@ -151,7 +151,8 @@ wxString pgView::GetSql(ctlTree *browser)
                     withoptions += wxT(", ");
 				withoptions = wxT("check_option=") + GetCheckOption();
             }
-			sql += wxT(" WITH (") + withoptions + wxT(")");
+			if (withoptions.Length() > 0)
+				sql += wxT(" WITH (") + withoptions + wxT(")");
 		}
 		else
 		{
