Re: last comma inside "CREATE TABLE ()" statements

From: "Rod Taylor" <rod(dot)taylor(at)inquent(dot)com>
To: "will trillich" <will(at)serensoft(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: last comma inside "CREATE TABLE ()" statements
Date: 2001-04-26 14:38:42
Message-ID: 016f01c0ce5e$996625f0$1600a8c0@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Gah.. just put comma's at the beginning...

SELECT bleah
, blah
, otherthing
FROM arghh
, feh
, fah
WHERE ( blah in ('1'
, '2'
, '3')
OR otherthing IS TRUE
)
OR bleah IS FALSE

Oh, and indent nicer. You can remove virtually any line (except the
ones with commands in them) without any issues.

--
Rod Taylor

There are always four sides to every story: your side, their side, the
truth, and what really happened.
----- Original Message -----
From: "will trillich" <will(at)serensoft(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Sent: Thursday, April 26, 2001 10:12 AM
Subject: Re: [GENERAL] last comma inside "CREATE TABLE ()" statements

> the original request was to allow extra commas such as perl does
> -- for example:
>
> create table xyz (
> f1 int4,
> t1 text,
> -- v1 varchar(25),
> s1 serial, -- note extra trailing comma
> );
> select
> v.fld1,
> -- t.fld2,
> v.fldN, -- extra comma
> from
> tbl1 t,
> view1 v, -- extra comma
> where
> ...
>
> PLUSSES:
>
> 1 it's easier to cut & paste whole lines
>
> 2 it's easier to comment out any line
>
> 3 allows quicker munging of source code, saving precious
> programmer time (big, Big, BIG plus, in the long run)
>
> MINUSES:
>
> 1 requires some tweaks to postgres source code
>
> 2 nonstandard -- rubs philosophical purists the wrong way
>
> 3 increases iterations through code as extra commas are added
> or removed (when lines of sql code are moved around), eating
> up programmer time
>
> IMHO:
>
> let the purists code strict ISO if they like; we're not
> recommending that the current paradigm be CHANGED to allow extra
> commas, only that a new one be ADDED to allow extra commas.
>
> regarding nonstandard -- we wouldn't ditch "create rule" or
> "inherits" just because the standards folk haven't learned to
> appreciate them yet, would we?
>
> i've secretly wanted this feature for months and months, but i
> didn't have the globs to ask for it. :)
>
> can we vote? (no florida jokes, please...)
>
> --
>
> note:
>
> in "CREATE TABLE" you can specify a primary key at the end of
> your field defs, to accomplish just about the same effect:
>
> create table thisway (
> code char(6),
> name varchar(20),
> amt float8,
> other int4, -- pseudo extra comma
>
> PRIMARY KEY( code )
> );
>
> of course, this approach works only for table creation.
>
> --
> don't visit this page. it's bad for you. take my expert word for it.
> http://www.salon.com/people/col/pagl/2001/03/21/spring/index1.html
>
> will(at)serensoft(dot)com
> http://sourceforge.net/projects/newbiedoc -- we need your brain!
> http://www.dontUthink.com/ -- your brain needs us!
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2001-04-26 14:47:13 Re: configure on a P4?
Previous Message Gregory Wood 2001-04-26 14:37:01 Re: help with serial type