Re: RE : full featured alter table?

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: RE : full featured alter table?
Date: 2003-06-16 21:18:01
Message-ID: Pine.LNX.4.33.0306161516060.2361-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 16 Jun 2003, Jim C. Nasby wrote:

> On Sat, Jun 14, 2003 at 06:55:36PM +0200, Bruno BAGUETTE wrote:
> > Hello everybody,
> >
> > > The one thing we don't have that I think would be useful is a
> > > way to re-order the columns in a table. Maybe it's just me,
> > > but I tend to want column to appear in a specific order, and
> > > the only way you can accomplish this today is by re-creating
> > > the entire table.
> >
> > I agree with Jim, this would be a 'cool but not mandatory' feature ! :-)
> >
> > This feature is not mandatory since I avoid the use SELECT * FROM...
> > (and I forbid the use of SELECT * to my subordinates).
>
> 99.999% of the time, if you put SELECT * into code, you should be strung
> up by your own entrails. But do you mean to tell me that when you're
> testing stuff on the command line you never, ever use SELECT *?

I wouldn't go that far. I build updatable views, select * from them,
cycle through the fields getting name / type and build generic forms to
let the user edit / insert new records.

It allows me to reuse the same basic chunk of code over and over.

Of course, it's select * on a view, not a table, so I set the order when I
create the view.

Now, using select * and ASSUMING the order of the variables in your
application code is a punishable offense, but as long as you determine the
name / type of the fields after the select * it's not so bad.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sean Chittenden 2003-06-16 21:58:55 Re: Sort memory not being released
Previous Message Tom Lane 2003-06-16 20:35:28 Re: Postgres performance comments from a MySQL user