Re: Does pgAdmin have to double-quote (now

Поиск
Список
Период
Сортировка
От novnov
Тема Re: Does pgAdmin have to double-quote (now
Дата
Msg-id 7243176.post@talk.nabble.com
обсуждение исходный текст
Ответ на Re: Does pgAdmin have to double-quote table and  (Erwin Brandstetter <brsaweda@gmail.com>)
Список pgadmin-support
I will be asking this on the pgsql general list too but if lowercase is best,
I'll have to change some habits I've developed over the years, want to glean
whatever collective wisdom I can here from experienced pgsql devs.

I've been using namestyles with mixed case like OrgID. That is much more
readable than orgid. I know many would use org_id. That change I can live
with.

But another issue is the way that I've been naming foreign key references. I
tend to prefix field names with a table based acryonym. So names like
OrgName, OrgCity. Foreign key fields incorporate the ref'd pk. So, if I have
a table tblEmployee, fk to the org table would be like EmpOrgID. I know many
would simply use OrgID as the fk in tblEmployee, but I have liked
compounding the names because is results in completly unambiguous field
names throughout the db. If I'm giving up the mixed case naming, I could use
emp_fname, emp_lname, emp_org_id, but I'm not sure if that's best.

I am very curious to hear the various conventions folks here have arrived
at. I don't expect there to be consensus, but the various rationales might
help me arrive at an approach that works well for me.



brsaweda wrote:
> 
> novnov wrote:
>> 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.
>>
> 
> 
> I would generally stick to lower case names. Just like I would generally 
> avoid non-ASCII characters in names. I certainly do, I think most do. 
> Makes your life easier.
> 
> 
> Regards
> Erwin
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
> 
>                http://www.postgresql.org/docs/faq
> 
> 

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



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

Предыдущее
От: Erwin Brandstetter
Дата:
Сообщение: Re: Edit grid: quirk in boolean fields
Следующее
От: Erwin Brandstetter
Дата:
Сообщение: edit grid: issues involving marking, selecting, inserting, undoing