Re: capitalized sql (was: Re: Changing the default valu e of an inherited column)

Started by Zeugswetter Andreas SBalmost 25 years ago3 messages
#1Zeugswetter Andreas SB
ZeugswetterA@wien.spardat.at

will get dumped as:

CREATE TABLE "c5" (
"f1" integer NOT NULL,
"f3" integer
)
inherits ("p3_def1");

As an aside answer without considerable importance:

Why do people tend to write SQL keywords in all capitals ?
PostgreSQL converts everything to lower case (which I like).
So why not output lowercase ? Above example even mixes
case, why ?

Andreas

#2Noname
darcy@druid.net
In reply to: Zeugswetter Andreas SB (#1)
Re: capitalized sql (was: Re: Changing the default valu e of an inherited column)

Thus spake Zeugswetter Andreas SB

will get dumped as:

CREATE TABLE "c5" (
"f1" integer NOT NULL,
"f3" integer
)
inherits ("p3_def1");

As an aside answer without considerable importance:

Why do people tend to write SQL keywords in all capitals ?
PostgreSQL converts everything to lower case (which I like).
So why not output lowercase ? Above example even mixes
case, why ?

I do it for maintenance purposes. All of my code uses caps for keywords
so that I can find them without getting them confused with language
constructs and variables.

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.
#3Philip Warner
pjw@rhyme.com.au
In reply to: Zeugswetter Andreas SB (#1)
Re: capitalized sql (was: Re: Changing the default value of an inherited column)

At 12:04 3/04/01 +0200, Zeugswetter Andreas SB wrote:

will get dumped as:

CREATE TABLE "c5" (
"f1" integer NOT NULL,
"f3" integer
)
inherits ("p3_def1");

As an aside answer without considerable importance:

Why do people tend to write SQL keywords in all capitals ?

It's just one of those things that people do; some people find it easier to
read (I actually prefer proper case keywords for SQL, unquoted upper case
for names etc):

Create Table C5 (
F1 Integer Not Null,
F3 Integer
)
Inherits (P3_DEF1);

As to why it's in pg_dump, I think it reflects the many & varied
contributors as opposed to careful design. There is some proper-case stuff
in there now (from me), which I will try to remember to remove. The upper
case stuff is there since 6.x at least, and I'm not sure why INHERITS is in
lower case. Type names are now formatted (mostly) using formatType (from
Peter E), so they will at least be consistent (and lower case).

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/