Hi,
Attached is a patch which fixes #328. Currently if you change a
column's collation, it actually drops the column. This changes it so
that it issues an ALTER TYPE to adjust the collation instead.
Regards
--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/pgadmin/dlg/dlgColumn.cpp b/pgadmin/dlg/dlgColumn.cpp
index 9876d36..0f912b0 100644
--- a/pgadmin/dlg/dlgColumn.cpp
+++ b/pgadmin/dlg/dlgColumn.cpp
@@ -411,13 +411,14 @@ wxString dlgColumn::GetSql()
{
if ((cbDatatype->GetValue() != column->GetRawTypename() && !column->GetIsArray()) ||
(cbDatatype->GetValue() != column->GetRawTypename() + wxT("[]") && column->GetIsArray()) ||
+ (!cbCollation->GetValue().IsEmpty() && cbCollation->GetValue() != column->GetCollation()) ||
(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 ")
+ GetQuotedTypename(cbDatatype->GetGuessedSelection());
- if (!cbCollation->GetValue().IsEmpty() && cbCollation->GetValue() != wxT("pg_catalog.\"default\""))
+ if (!cbCollation->GetValue().IsEmpty() && cbCollation->GetValue() != column->GetCollation())
sql += wxT(" COLLATE ") + cbCollation->GetValue();
sql += wxT(";\n");
}
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers