Skip site navigation (1) Skip section navigation (2)

SVN Commit by dpage: r4817 - in trunk/pgadmin3: . src/dlg

From: svn(at)pgadmin(dot)org
To: pgadmin-hackers(at)postgresql(dot)org
Subject: SVN Commit by dpage: r4817 - in trunk/pgadmin3: . src/dlg
Date: 2005-12-09 11:02:49
Message-ID: 200512091102.jB9B2nC5023741@developer.pgadmin.org (view raw or flat)
Thread:
Lists: pgadmin-hackers
Author: dpage
Date: 2005-12-09 11:02:49 +0000 (Fri, 09 Dec 2005)
New Revision: 4817

Modified:
   trunk/pgadmin3/CHANGELOG.txt
   trunk/pgadmin3/src/dlg/dlgDatabase.cpp
Log:
Default the encoding of new databases to the cluster encoding, per Peter Eisentraut.

Modified: trunk/pgadmin3/CHANGELOG.txt
===================================================================
--- trunk/pgadmin3/CHANGELOG.txt	2005-12-09 11:02:28 UTC (rev 4816)
+++ trunk/pgadmin3/CHANGELOG.txt	2005-12-09 11:02:49 UTC (rev 4817)
@@ -18,6 +18,7 @@
 </ul>
 <br>
 <ul>
+    <li>2005-12-09 DP  1.4.1  Default the encoding of new databases to the cluster encoding, per Peter Eisentraut.
     <li>2005-12-09 DP  1.4.1  Sort encoding names in dlgDatabase, per Peter Eisentraut.
     <li>2005-12-06 AP  1.4.1  store UTF8 connect info in pgpass.conf if necessary
     <li>2005-12-03 AP  1.4.1  Major fix for wx2.6.2 API changes (comboboxes)

Modified: trunk/pgadmin3/src/dlg/dlgDatabase.cpp
===================================================================
--- trunk/pgadmin3/src/dlg/dlgDatabase.cpp	2005-12-09 11:02:28 UTC (rev 4816)
+++ trunk/pgadmin3/src/dlg/dlgDatabase.cpp	2005-12-09 11:02:49 UTC (rev 4817)
@@ -195,13 +195,20 @@
         }
         while (!encStr.IsEmpty());
 
+        encStr=connection->ExecuteScalar(wxT("SELECT pg_encoding_to_char(encoding) FROM pg_database WHERE datname = 'template0'"));
+        encNo=cbEncoding->FindString(encStr);
+
+        if (encNo < 0) 
+        {
 #if wxUSE_UNICODE
-        encNo=cbEncoding->FindString(wxT("UNICODE"));
-        if (encNo < 0)
-            encNo=cbEncoding->FindString(wxT("UTF8"));
+            encNo=cbEncoding->FindString(wxT("UNICODE"));
+            if (encNo < 0)
+                encNo=cbEncoding->FindString(wxT("UTF8"));
 #else
-        encNo=cbEncoding->FindString(wxT("SQL_ASCII"));
+            encNo=cbEncoding->FindString(wxT("SQL_ASCII"));
 #endif
+        }
+
         if (encNo >= 0)
             cbEncoding->SetSelection(encNo);
 


pgadmin-hackers by date

Next:From: Dave PageDate: 2005-12-09 11:04:57
Subject: Re: Default encoding for new databases
Previous:From: svnDate: 2005-12-09 11:02:28
Subject: SVN Commit by dpage: r4816 - in branches/REL-1_4_0_PATCHES/pgadmin3: . src/dlg

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group