Re: Does pgAdmin have to double-quote table and

Поиск
Список
Период
Сортировка
От Dave Page
Тема Re: Does pgAdmin have to double-quote table and
Дата
Msg-id 454E4A04.4040605@postgresql.org
обсуждение исходный текст
Ответ на Re: Does pgAdmin have to double-quote table and  (novnov <novnovice@gmail.com>)
Ответы Re: Does pgAdmin have to double-quote table and  (novnov <novnovice@gmail.com>)
Список pgadmin-support
novnov wrote:
> Hi Dave and thanks for responding.
> 
> I have to worry about the SQL syntax because practically the first thing I
> did after using pgAdmin to create the tables was to try to write a stored
> proceedure with pgAdmin against the table. The stored proceedure wouldn't
> work until I manually added the double quotes. Naturally as a novice I
> didn't know about needing the double quotes. pgAdmin automatically adds the
> double quotes at table creation time but does not for the stored
> proceedures, and the error returned (ERROR relation "item" does not exist)
> doesn't exactly give one a clue that the issue is missing double quotes. The
> pgAdmin GUI I'm sure it not supposed to provide complete isolation from SQL
> syntax...it was an issue for me right away.
> 
> The second part of what you wrote adds to my confusion. You're saying that
> ultimately pgsql is strict about lowercase on everything unless double
> quoted, tho internally it is looser than that. Essentially then pgAdmin is
> automatically adding the double quotes to names like Item as a safety
> measure, knowing that eventually the double quotes will likely be important?

Anywhere you type raw SQL in pgAdmin, you need to quote manually. In 
other words, if you manually type SQL into the Query Tool, or in a 
function body. pgAdmin doesn't try to second guess what you've typed in 
these cases - to to so would likely cause more problems.

In the GUI elements of pgAdmin, quoting is always added if you use an 
identifier that requires it. In these cases it knows exasctly what you 
are typing because you've typed it into the 'name' textbox for example.

psql is essentially the same as the pgAdmin query tool in that you must 
do everything yourself.

> It's confusing because in the other mailing list I seem to have been told
> simply that the issue I ran into was due to a habit of pgAdmin. In a way you
> confirm, but clarify that pdAdmin is doing it for 'my own good'?

The point of a graphical interface is to simplify complex tasks for you. 
In this case that means giving you a set of textboxes, comboboxes and 
other widgets with which you specify the object you want to create. It 
shields you from the details of how that object is created, because in 
the vast majority of cases people don't care (in pgAdmin's case you 
actually can see the raw SQL if desired by looking at the SQL tab on the 
properties dialogues).

Regards, Dave.


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

Предыдущее
От: novnov
Дата:
Сообщение: Re: Does pgAdmin have to double-quote table and
Следующее
От: novnov
Дата:
Сообщение: Re: Does pgAdmin have to double-quote table and