Re: Does pgAdmin have to double-quote table and

Поиск
Список
Период
Сортировка
От novnov
Тема Re: Does pgAdmin have to double-quote table and
Дата
Msg-id 7191015.post@talk.nabble.com
обсуждение исходный текст
Ответ на Re: Does pgAdmin have to double-quote table and  (Dave Page <dpage@postgresql.org>)
Ответы Re: Does pgAdmin have to double-quote table and  (Erwin Brandstetter <brsaweda@gmail.com>)
Список pgadmin-support
Thanks again.

Is there anything like SOP for pgsql devs then? Do most stick to lowercase
everywhere, and skip the issues, or do they keep the namestyles like
"ItemName" and just accomodate the need to double quote when it arises? I am
sure good devs could go either way, but curious if you or other have any
impressions re common practice. I'd guess most decide to use the "ItemName"
style, since double quoting would only be an issue under some circumstances
(like writing sprocs), and double quotes aren't a heavy burden anyways.



Dave Page-3 wrote:
> 
> 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.
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
> 
> 

-- 
View this message in context:
http://www.nabble.com/Does-pgAdmin-have-to-double-quote-table-and-field-names--tf2574512.html#a7191015
Sent from the PostgreSQL - pgadmin support mailing list archive at Nabble.com.



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

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