Re: [GENERAL] id and ID in CREATE TABLE

Поиск
Список
Период
Сортировка
Искать

Re: [GENERAL] id and ID in CREATE TABLE

От:
stefan@extum.com
Дата:

Thanks all for comments. In Oracle and DB2 as far as I know the upper case 
column names are used when you have no columns quoted.. Indeed it is 
recommended to use lower cases to 
avoid mistakes and confusion during porting. Is that right ?

But anyway this is not so important, but why upper cases are bad ?
Why then Oracle , IBM is using them and why the SQL standard is not 
changed ?

stefan





On Fri, 19 Jul 2002, Martijn van Oosterhout wrote:

> On Sat, Jul 20, 2002 at 10:39:52AM +0300, stefan@extum.com wrote:
> > 
> > I forgot about "" Sorry. So if I would use names quoted then my questions 
> > are obsolete. Except one:
> > 
> > So actually the only strange part would be PostgreSQL is folding to lower 
> > cases a column name ...
> 
> [snip]
> 
> > Why is like this ? Why not letting them upper case if they are not quoted 
> > ?
> 
> I think it's because many people think that uppercase column names suck. And
> I agree with them. If you follow the given advice (either always quote
> column names or never) then not only will your program work, it's will be
> completely portable.
> 
> So, if you'd used your CREATE TABLE statememnt below, you wouldn't have had
> this problem.
> 
> > > CREATE TABLE ttt (
> > > 
> > > 	ID int2,
> > > 	name text );
> 

Re: [GENERAL] id and ID in CREATE TABLE

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
stefan@extum.com writes:
> But anyway this is not so important, but why upper cases are bad ?

It's well established that all-lower-case text is more readable than
all-upper-case ... at least in English; but I think the same would be
true of any language using an approximately Roman alphabet.  The problem
with upper case is there's less variation in the overall letter shape.
If you don't care to dig in the academic literature about it, here's a
simple experiment: which of the following paragraphs do you find more
readable?

	it's well established that all-lower-case text is more readable
	than all-upper-case ... at least in english; but i think the
	same would be true of any language using an approximately roman
	alphabet.  the problem with upper case is there's less variation
	in the overall letter shape.  if you don't care to dig in the
	academic literature about it, here's a simple experiment: which
	of the following paragraphs do you find more readable?

	IT'S WELL ESTABLISHED THAT ALL-LOWER-CASE TEXT IS MORE READABLE
	THAN ALL-UPPER-CASE ... AT LEAST IN ENGLISH; BUT I THINK THE
	SAME WOULD BE TRUE OF ANY LANGUAGE USING AN APPROXIMATELY ROMAN
	ALPHABET.  THE PROBLEM WITH UPPER CASE IS THERE'S LESS VARIATION
	IN THE OVERALL LETTER SHAPE. IF YOU DON'T CARE TO DIG IN THE
	ACADEMIC LITERATURE ABOUT IT, HERE'S A SIMPLE EXPERIMENT: WHICH
	OF THE FOLLOWING PARAGRAPHS DO YOU FIND MORE READABLE?

For me, at least, the second version takes noticeably more time to read
and is certainly less pleasant.  (I suppose that for a non-native
speaker of English, mental translation might slow you down to the point
where you don't notice a difference.  If so, try it on a random
paragraph in your own language.)

For PostgreSQL there is also a backwards compatibility issue: if we
change this decision now, we'd cause all kinds of problems for existing
code and databases.

> Why then Oracle , IBM is using them and why the SQL standard is not 
> changed ?

The SQL standard's choice in this matter is prehistoric; undoubtedly
it falls out of the days when computer printers only had one type case.
IBM probably still has a residual fondness for those days ;-).  But
the rest of the industry figured out that lower case was better
somewhere around 1960, cf Algol-60 which was the first language to spell
its keywords preferentially in lower case.

			regards, tom lane

Re: [GENERAL] id and ID in CREATE TABLE

От:
Thomas Swan <tswan@idigx.com>
Дата:
 Tom Lane wrote:
stefan@extum.com writes: 
But anyway this is not so important, but why upper cases are bad ?   
It's well established that all-lower-case text is more readable than
all-upper-case ... at least in English; but I think the same would be
true of any language using an approximately Roman alphabet.  The problem
with upper case is there's less variation in the overall letter shape.
If you don't care to dig in the academic literature about it, here's a
simple experiment: which of the following paragraphs do you find more
readable?
it's well established that all-lower-case text is more readablethan all-upper-case ... at least in english; but i think thesame would be true of any language using an approximately romanalphabet.  the problem with upper case is there's less variationin the overall letter shape.  if you don't care to dig in theacademic literature about it, here's a simple experiment: whichof the following paragraphs do you find more readable?
IT'S WELL ESTABLISHED THAT ALL-LOWER-CASE TEXT IS MORE READABLETHAN ALL-UPPER-CASE ... AT LEAST IN ENGLISH; BUT I THINK THESAME WOULD BE TRUE OF ANY LANGUAGE USING AN APPROXIMATELY ROMANALPHABET.  THE PROBLEM WITH UPPER CASE IS THERE'S LESS VARIATIONIN THE OVERALL LETTER SHAPE. IF YOU DON'T CARE TO DIG IN THEACADEMIC LITERATURE ABOUT IT, HERE'S A SIMPLE EXPERIMENT: WHICHOF THE FOLLOWING PARAGRAPHS DO YOU FIND MORE READABLE?

For me, at least, the second version takes noticeably more time to read
and is certainly less pleasant.  (I suppose that for a non-native
speaker of English, mental translation might slow you down to the point
where you don't notice a difference.  If so, try it on a random
paragraph in your own language.)
It's a pattern recognition issue.   Taken in context with your reading experience and the general constructs of the English language in addition common usage, you encounter far more lower case letters than upper case letters.  It makes sense that it would be easier to recognize the words in all lower case.  Secondly, your brain expects lower case letters behind the leading upper case letter for the word.   So in a sense you backtrack just a little because it doesn't match what you expect.   I'm not discounting the statements you made, but this is one additional observation.

[ In the previous paragraph there were 6 capital letters to the 471 non-capital letters. ]

For PostgreSQL there is also a backwards compatibility issue: if we
change this decision now, we'd cause all kinds of problems for existing
code and databases.
 
Why then Oracle , IBM is using them and why the SQL standard is not 
changed ?   
The SQL standard's choice in this matter is prehistoric; undoubtedly
it falls out of the days when computer printers only had one type case.
IBM probably still has a residual fondness for those days ;-).  But
the rest of the industry figured out that lower case was better
somewhere around 1960, cf Algol-60 which was the first language to spell
its keywords preferentially in lower case.
		regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html 


Re: [GENERAL] id and ID in CREATE TABLE

От:
"scott.marlowe" <scott.marlowe@ihs.com>
Дата:
On Fri, 19 Jul 2002, Tom Lane wrote:

> stefan@extum.com writes:
> > But anyway this is not so important, but why upper cases are bad ?
> 
> It's well established that all-lower-case text is more readable than
> all-upper-case ... 

Agreed.  Absolutely.  But, since the SQL standard says upper case, 
wouldn't it be useful to at least have a switch (run time, initdb time, 
or ./configure time???) called something like FOLDTOUPPER (in upper case 
of course :-)

If it's an easy win I'd be willing to do it.  I'm not the world's greatest 
C hacker, but I still remember enough of it to be competant.

FAQ