Index: CHANGELOG.txt
===================================================================
RCS file: /projects/pgadmin3/CHANGELOG.txt,v
retrieving revision 1.156
retrieving revision 1.157
diff -LCHANGELOG.txt -LCHANGELOG.txt -u -w -r1.156 -r1.157
--- CHANGELOG.txt
+++ CHANGELOG.txt
@@ -17,6 +17,8 @@
+ - 2004-11-02 AP 1.2B4 Fix some type related issues (r: Alexander Borkowski)
+
- 2004-11-02 AP 1.2B4 Fix some owner change related issues (r: Alexander Borkowski)
- 2004-10-29 AP 1.2B4 full casting in utffile fixing some compilers
- 2004-10-27 AP 1.2B4 Workaround for wxGrid bug not returning selected rows
- 2004-10-27 AP 1.2B4 Fix user/group selection in privileges (r: Walter Haslbeck, Gary Doades)
Index: dlgProperty.h
===================================================================
RCS file: /projects/pgadmin3/src/include/dlgProperty.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -Lsrc/include/dlgProperty.h -Lsrc/include/dlgProperty.h -u -w -r1.40 -r1.41
--- src/include/dlgProperty.h
+++ src/include/dlgProperty.h
@@ -57,7 +57,7 @@
void CheckValid(bool &enable, const bool condition, const wxString &msg);
static dlgProperty *CreateDlg(frmMain *frame, pgObject *node, bool asNew, int type=-1);
void AppendNameChange(wxString &sql);
- void AppendOwnerChange(wxString &sql);
+ void AppendOwnerChange(wxString &sql, const wxString &objName=wxEmptyString);
void AppendOwnerNew(wxString &sql, const wxString &objname);
void AppendComment(wxString &sql, const wxString &objType, pgSchema *schema, pgObject *obj);
void AppendComment(wxString &sql, const wxString &objName, pgObject *obj);
Index: dlgTable.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/dlgTable.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -Lsrc/ui/dlgTable.cpp -Lsrc/ui/dlgTable.cpp -u -w -r1.45 -r1.46
--- src/ui/dlgTable.cpp
+++ src/ui/dlgTable.cpp
@@ -335,7 +335,7 @@
}
AppendNameChange(sql);
- AppendOwnerChange(sql);
+ AppendOwnerChange(sql, wxT("TABLE ") + tabname);
for (index=0 ; index < (int)tmpDef.GetCount() ; index++)
{
Index: dlgDomain.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/dlgDomain.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -Lsrc/ui/dlgDomain.cpp -Lsrc/ui/dlgDomain.cpp -u -w -r1.25 -r1.26
--- src/ui/dlgDomain.cpp
+++ src/ui/dlgDomain.cpp
@@ -181,7 +181,7 @@
else
sql += wxT(" SET DEFAULT ") + txtDefault->GetValue() + wxT(";\n");
}
- AppendOwnerChange(sql);
+ AppendOwnerChange(sql, wxT("DOMAIN ") + qtIdent(name));
}
else
{
Index: dlgProperty.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/dlgProperty.cpp,v
retrieving revision 1.103
retrieving revision 1.104
diff -Lsrc/ui/dlgProperty.cpp -Lsrc/ui/dlgProperty.cpp -u -w -r1.103 -r1.104
--- src/ui/dlgProperty.cpp
+++ src/ui/dlgProperty.cpp
@@ -260,14 +260,15 @@
}
-void dlgProperty::AppendOwnerChange(wxString &sql)
+void dlgProperty::AppendOwnerChange(wxString &sql, const wxString &objName)
{
if (GetObject()->GetOwner() != cbOwner->GetValue())
- sql += wxT("ALTER ") + GetObject()->GetTypeName()
- + wxT(" ") + qtIdent(GetName())
+ {
+ sql += wxT("ALTER ") + objName
+ wxT(" OWNER TO ") + qtIdent(cbOwner->GetValue())
+ wxT(";\n");
}
+}
void dlgProperty::AppendOwnerNew(wxString &sql, const wxString &objName)
Index: ctlComboBox.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/ctlComboBox.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -Lsrc/ui/ctlComboBox.cpp -Lsrc/ui/ctlComboBox.cpp -u -w -r1.4 -r1.5
--- src/ui/ctlComboBox.cpp
+++ src/ui/ctlComboBox.cpp
@@ -27,7 +27,7 @@
int ctlComboBox::GuessSelection()
{
- wxString str=GetValue();
+ wxString str=wxComboBox::GetValue();
if (str.Length())
{
long pos=GetInsertionPoint();
Index: dlgOperator.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/dlgOperator.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -Lsrc/ui/dlgOperator.cpp -Lsrc/ui/dlgOperator.cpp -u -w -r1.21 -r1.22
--- src/ui/dlgOperator.cpp
+++ src/ui/dlgOperator.cpp
@@ -130,6 +130,8 @@
cbProcedure->Disable();
cbLeftType->Disable();
cbRightType->Disable();
+ if (!connection->BackendMinimumVersion(8, 0))
+ cbOwner->Disable();
}
else
{
Index: dlgAggregate.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/dlgAggregate.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -Lsrc/ui/dlgAggregate.cpp -Lsrc/ui/dlgAggregate.cpp -u -w -r1.18 -r1.19
--- src/ui/dlgAggregate.cpp
+++ src/ui/dlgAggregate.cpp
@@ -208,7 +208,7 @@
{
// edit mode
AppendNameChange(sql);
- AppendOwnerChange(sql);
+ AppendOwnerChange(sql, wxT("AGGREGATE ") + schema->GetQuotedPrefix() + qtIdent(name));
}
else
{
Index: dlgColumn.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/dlgColumn.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -Lsrc/ui/dlgColumn.cpp -Lsrc/ui/dlgColumn.cpp -u -w -r1.33 -r1.34
--- src/ui/dlgColumn.cpp
+++ src/ui/dlgColumn.cpp
@@ -185,11 +185,19 @@
+ wxT(" TO ") + qtIdent(name)
+ wxT(";\n");
+ wxString len;
+ if (txtLength->IsEnabled())
+ len = txtLength->GetValue();
+
+ wxString prec;
+ if (txtPrecision->IsEnabled())
+ prec = txtPrecision->GetValue();
+
if (connection->BackendMinimumVersion(7, 5))
{
if (cbDatatype->GetValue() != column->GetRawTypename() ||
- (isVarLen && StrToLong(txtLength->GetValue()) != column->GetLength()) ||
- (isVarPrec && StrToLong(txtPrecision->GetValue()) != column->GetPrecision()))
+ (isVarLen && txtLength->IsEnabled() && StrToLong(len) != column->GetLength()) ||
+ (isVarPrec && txtPrecision->IsEnabled() && StrToLong(prec) != column->GetPrecision()))
{
sql += wxT("ALTER TABLE ") + table->GetQuotedFullIdentifier()
+ wxT(" ALTER ") + qtIdent(name) + wxT(" TYPE ")
@@ -205,10 +213,10 @@
if (!sqlPart.IsEmpty() ||
- (isVarLen && StrToLong(txtLength->GetValue()) != column->GetLength()) ||
- (isVarPrec && StrToLong(txtPrecision->GetValue()) != column->GetPrecision()))
+ (isVarLen && txtLength->IsEnabled() && StrToLong(prec) != column->GetLength()) ||
+ (isVarPrec && txtPrecision->IsEnabled() && StrToLong(prec) != column->GetPrecision()))
{
- long typmod = pgDatatype::GetTypmod(column->GetRawTypename(), txtLength->GetValue(), txtPrecision->GetValue());
+ long typmod = pgDatatype::GetTypmod(column->GetRawTypename(), len, prec);
if (!sqlPart.IsEmpty())
sqlPart += wxT(", ");
Index: dlgType.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/dlgType.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -Lsrc/ui/dlgType.cpp -Lsrc/ui/dlgType.cpp -u -w -r1.26 -r1.27
--- src/ui/dlgType.cpp
+++ src/ui/dlgType.cpp
@@ -215,6 +215,7 @@
CheckLenEnable();
txtLength->Enable(isVarLen);
CheckChange();
+ OnChangeMember(ev);
}
}
Index: dlgConversion.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/dlgConversion.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -Lsrc/ui/dlgConversion.cpp -Lsrc/ui/dlgConversion.cpp -u -w -r1.16 -r1.17
--- src/ui/dlgConversion.cpp
+++ src/ui/dlgConversion.cpp
@@ -172,7 +172,7 @@
// edit mode
AppendNameChange(sql);
- AppendOwnerChange(sql);
+ AppendOwnerChange(sql, wxT("CONVERSION ") + schema->GetQuotedPrefix() + qtIdent(name));
}
else
{
Index: dlgFunction.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/dlgFunction.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -Lsrc/ui/dlgFunction.cpp -Lsrc/ui/dlgFunction.cpp -u -w -r1.43 -r1.44
--- src/ui/dlgFunction.cpp
+++ src/ui/dlgFunction.cpp
@@ -440,10 +440,18 @@
args += lstArguments->GetText(i) + wxT(" ");
}
}
+ wxString typname=lstArguments->GetText(i, typeColNo);
+ wxString braces;
+ if (typname.Right(2) == wxT("[]"))
+ {
+ braces = wxT("[]");
+ typname = typname.Left(typname.Length()-2);
+ }
if (quoted)
- AppendQuoted(args, lstArguments->GetText(i, typeColNo));
+ AppendQuoted(args, typname);
else
- args += lstArguments->GetText(i, typeColNo);
+ args += typname;
+ args += braces;
}
return args;