Re: full featured alter table?

Поиск
Список
Период
Сортировка
Искать
От
scott.marlowe
Тема
Re: full featured alter table?
Дата
Msg-id
Pine.LNX.4.33.0306131523150.21088-100000@css120.ihs.com
Ответ на
Список
Дерево обсуждения
full featured alter table? Sven Koehler <skoehler@upb.de>
full featured alter table/column ordering - a summary Sven Koehler <skoehler@upb.de>
Re: full featured alter table? Jonathan Bartlett <johnnyb@eskimo.com>
Re: full featured alter table? Sven Koehler <skoehler@upb.de>
Re: full featured alter table? Stephan Szabo <sszabo@megazone23.bigpanda.com>
Re: full featured alter table? Sven Koehler <skoehler@upb.de>
Re: full featured alter table? Stephan Szabo <sszabo@megazone23.bigpanda.com>
Re: full featured alter table? Reynard Hilman <reynardmh@lightsky.com>
Re: full featured alter table? "scott.marlowe" <scott.marlowe@ihs.com>
Re: full featured alter table? Reynard Hilman <reynardmh@lightsky.com>
Re: full featured alter table? weigelt@metux.de
Re: full featured alter table? Sven Köhler <skoehler@upb.de>
Re: full featured alter table? weigelt@metux.de
Re: full featured alter table? Sven Köhler <skoehler@upb.de>
Re: full featured alter table? Alvaro Herrera <alvherre@dcc.uchile.cl>
Re: full featured alter table? Tino Wildenhain <tino@wildenhain.de>
Re: full featured alter table? Tom Lane <tgl@sss.pgh.pa.us>
Re: full featured alter table? "Jim C. Nasby" <jim@nasby.net>
RE : full featured alter table? "Bruno BAGUETTE" <pgsql-ml@baguette.net>
Re: RE : full featured alter table? "Jim C. Nasby" <jim@nasby.net>
Re: RE : full featured alter table? Ernest E Vogelsinger <ernest@vogelsinger.at>
Re: RE : full featured alter table? Mike Mascari <mascarm@mascari.com>
Re: RE : full featured alter table? Ernest E Vogelsinger <ernest@vogelsinger.at>
Re: RE : full featured alter table? Sven Köhler <skoehler@upb.de>
Re: RE : full featured alter table? "Jim C. Nasby" <jim@nasby.net>
Re: RE : full featured alter table? Sven Köhler <skoehler@upb.de>
Re: RE : full featured alter table? Tom Lane <tgl@sss.pgh.pa.us>
Re: RE : full featured alter table? Bruce Momjian <pgman@candle.pha.pa.us>
Re: RE : full featured alter table? Sven Köhler <skoehler@upb.de>
Re: RE : full featured alter table? Sven Köhler <skoehler@upb.de>
Re: RE : full featured alter table? "scott.marlowe" <scott.marlowe@ihs.com>
Re: RE : full featured alter table? Dennis Gearon <gearond@cvc.net>
Re: full featured alter table? Bruno Wolff III <bruno@wolff.to>
Re: full featured alter table? "Jim C. Nasby" <jim@nasby.net>
Re: full featured alter table? "Nigel J. Andrews" <nandrews@investsystems.co.uk>
Re: full featured alter table? Greg Stark <gsstark@mit.edu>
Re: full featured alter table? Sven Köhler <skoehler@upb.de>
Re: full featured alter table? Andrew Sullivan <andrew@libertyrms.info>
Re: full featured alter table? Manfred Koizar <mkoi-pg@aon.at>
Re: full featured alter table? Sven Köhler <skoehler@upb.de>
Re: full featured alter table? Bruno Wolff III <bruno@wolff.to>
Re: full featured alter table? Sven Köhler <skoehler@upb.de>
Re: full featured alter table? Tom Lane <tgl@sss.pgh.pa.us>
Re: full featured alter table? Sven Köhler <skoehler@upb.de>
Re: full featured alter table? weigelt@metux.de
Re: full featured alter table? Sven Köhler <skoehler@upb.de>
Re: full featured alter table? weigelt@metux.de
Re: full featured alter table? "Jay O'Connor" <joconnor@cybermesa.com>
Re: full featured alter table? Sven Köhler <skoehler@upb.de>
Re: full featured alter table? Sven Köhler <skoehler@upb.de>
Re: full featured alter table? "Nigel J. Andrews" <nandrews@investsystems.co.uk>
Re: full featured alter table? Sven Köhler <skoehler@upb.de>
Re: full featured alter table? Guillaume LELARGE <gleu@wanadoo.fr>
Re: full featured alter table? merlyn@stonehenge.com (Randal L. Schwartz)
Re: full featured alter table? Sven Köhler <skoehler@upb.de>
On Thu, 12 Jun 2003, Sven Koehler wrote:

> Hi,
> 
> one of the biggest disease of PostGreSQL is, that i can't change the 
> definition of a column.
> 
> In order to do that, i'd have to drop any keys, drop the column and 
> create a new one with all indexes etc.
> 
> Are there any plans to overcome that problem?
> Even simple changes like varchar(20) to varchar(200) are not allowed.
> 
> I asked this question about 2 years ago, and there were only some guys, 
> that told me that i wouldn't need to change my DB if i'd plan it well.
> 
> So my DB is planned well, but i have to change it every now and than 
> because i must implement the changes that my client demands me to do, 
> and have some extra work that nobody will pay me for, if there's no way 
> to change a column.
> 
> This is the only missing feature, that prevent me to use this DBMS - i'd 
> love to, because it's an ORDBMS and that's what i'd have needed sometimes.

OK, so how do we handle things like converting a varchar to a timestamp 
with time zone?  What if one of the rows has invalid date syntax?  Do we 
convert the column anyway, or throw the whole change out with an error?

What about converting int8 to int4 where we have integers that are LARGER 
than what an int4 can hold.  Do we just set the int4 to max/min when the 
int8 is out of range?

How about converting varchar(64) to varchar(32).  Do you want it to error 
out if there are any fields over 32 chars, or just chop them off?

MySQL has a "feature" like the one you want.  It's not well thought out, 
and easily causes as much misery and pain as it prevents.  If you convert 
a column to date type it silently converts any field it can't suss out to 
the very wonderful value of 0000-00-00.  Since their DDL is not 
transactable, you've just lost all your dates.  Hope you had a backup 
laying around.

Converting column types is like walking around with a gun pointed at your 
foot.  If the possible error cases aren't well thought out, then bam! the 
gun goes off and your data is so much mush.

Other vendors may not care as much about data integrity as the postgresql 
team, and if you prefer their product feel free to use it.  The Postgresql 
team has a tendency of not incorporating such changes until they can work 
for virtually all cases without error.

Here's how I do it:

# pg_dump -a -t tabletochange >tabledata.sql
# pg_dump -s -t tabletochange >tableschema.sql
vi tableschema.sql (make changes)
psql testdatabase 
В списке pgsql-general по дате отправления
От: weigelt@metux.de
Дата:
Сообщение: Re: using sequences
От: scott.marlowe
Дата:
FAQ