Bug regarding SQL identifiers

Поиск
Список
Период
Сортировка
От Alexander Borkowski
Тема Bug regarding SQL identifiers
Дата
Msg-id 41DCFB74.5050501@abri.une.edu.au
обсуждение исходный текст
Ответы Re: Bug regarding SQL identifiers  (Andreas Pflug <pgadmin@pse-consulting.de>)
Список pgadmin-hackers
Dear all,

I tried to look at some tables created by another tool whose name starts
with a number (e.g. 100_something) with pgAdmin III 1.2.0. Doing this
raises a PostgreSQL syntax error. I traced the cause to the needsQuoting
function in src/utils/misc.cpp. According to the PostgreSQL
documentation SQL identifiers are to be quoted if they don't start with
a-z or an underbar, in particular numbers as first characters are not
allowed. Attached you will find a patch which fixes this.

Cheers,

Alex
--- src/utils/misc.cpp.orig    2005-01-06 19:29:42.000000000 +1100
+++ src/utils/misc.cpp    2005-01-06 19:31:23.000000000 +1100
@@ -282,7 +282,7 @@
         while (pos < (int)value.length())
         {
             wxChar c=value.GetChar(pos);
-            if (!(c >= '0' && c <= '9') &&
+            if (!((pos > 0) && (c >= '0' && c <= '9')) &&
                 !(c >= 'a' && c  <= 'z') &&
                 !(c == '_'))
             {

В списке pgadmin-hackers по дате отправления:

Предыдущее
От: Andreas Pflug
Дата:
Сообщение: Re: BUG: pgDomain.cpp
Следующее
От: cvs@developer.pgadmin.org
Дата:
Сообщение: CVS Commit by andreas: fix quoting identifiers starting with numbers