Re: PGAdmin for PostgreSQL 9.3 creates tables with double quotes embedded in the name

Поиск
Список
Период
Сортировка
От Darren Duncan
Тема Re: PGAdmin for PostgreSQL 9.3 creates tables with double quotes embedded in the name
Дата
Msg-id 5388F6AF.8010605@darrenduncan.net
обсуждение исходный текст
Ответ на Re: PGAdmin for PostgreSQL 9.3 creates tables with double quotes embedded in the name  (Rob Richardson <RDRichardson@rad-con.com>)
Ответы Re: PGAdmin for PostgreSQL 9.3 creates tables with double quotes embedded in the name  (Rob Richardson <RDRichardson@rad-con.com>)
Список pgadmin-support
Rob, this is what you do.

Either:

1. Use plain lowercase for all of your tablevar and other entity names, meaning 
it will work both quoted and unquoted in all contexts.

2. If you use any uppercase, then if writing SQL you use double-quotes around 
said entity nmes everywhere they appear.

See, SQL entities are case-sensitive in the general case of being quoted, but in 
the special case of not quoting the names in SQL, they are folded to lowercase 
before being matched.

If this is all complicated to you, then just use straight lowercase everywhere 
and it will just work.

-- Darren Duncan

On 2014-05-30, 1:56 PM, Rob Richardson wrote:
> Thank you for your reply.  You said, in part:
>
>     What's happening in your case is that the table must have been created like this:
>
>           create table "Log" [.....]
>
> But the whole point of my message is that that is not how this table was created.  I did not open an SQL window and
typein the CREATE TABLE command manually.  I selected the database in PGAdmin, went down to the Tables list (which said
Ihad 0 table), right clicked on the word "Tables", and selected "New table".  In the new table dialog I entered the
tablename as Log (no quotes), I defined its columns and its primary key, and I clicked OK.  After I did all that, I
thenfound that "select * from Log" (no quotes around Log) failed, claiming there was no relation named "Log".  I then
foundthat "select * from "Log" " (quotes around Log) worked.  I then concluded that the table was being created with
thedouble quotes included in the table name.
 
>
> I did find one place where I actually saw the name referred to as '"Log"'.  That's the word Log, surrounded by double
quotes,and then surrounded again by single quotes.  Unfortunately, I do not now remember where that was.
 
>
> RobR





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

Предыдущее
От: Rob Richardson
Дата:
Сообщение: Re: PGAdmin for PostgreSQL 9.3 creates tables with double quotes embedded in the name
Следующее
От: David G Johnston
Дата:
Сообщение: Re: PGAdmin for PostgreSQL 9.3 creates tables with double quotes embedded in the name