Re: last comma inside "CREATE TABLE ()" statements - Mailing list pgsql-general

From Rod Taylor
Subject Re: last comma inside "CREATE TABLE ()" statements
Date
Msg-id 016f01c0ce5e$996625f0$1600a8c0@jester
Whole thread Raw
In response to last comma inside "CREATE TABLE ()" statements  (Louis-David Mitterrand <vindex@apartia.ch>)
Responses Re: last comma inside "CREATE TABLE ()" statements
List 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@serensoft.com>
To: <pgsql-general@postgresql.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@serensoft.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@postgresql.org so that your
> message can get through to the mailing list cleanly
>


pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: configure on a P4?
Next
From: jdassen@cistron.nl (J.H.M. Dassen (Ray))
Date:
Subject: Re: Why Size Of Data Backed Up Varies Significantly In SQL 6.5?