Re: [GENERAL] change type from NUMERIC(14,4) to NUMERIC(24,12)

2017-01-24 Thread Tom Lane
=?UTF-8?Q?Torsten_F=C3=B6rtsch?= writes: > we have a large table and want to change the type of one column > from NUMERIC(14,4) to NUMERIC(24,12). If the new type is just NUMERIC > without any boundaries, the operation is fast. If (24,12) is specified, it > takes ages. > I think it takes so long

Re: [GENERAL] change type from NUMERIC(14,4) to NUMERIC(24,12)

2017-01-24 Thread Torsten Förtsch
I found that myself. But ... postgres=# create table x(n14_4 NUMERIC(14,4), n24_12 NUMERIC(24,12), n NUMERIC); CREATE TABLE postgres=# insert into x select i+.4, i+.12, i+.5234543 from generate_series(1,100) i; INSERT 0 100 postgres=# select * from x order by n limit 5; n14_4 | n24_12

Re: [GENERAL] change type from NUMERIC(14,4) to NUMERIC(24,12)

2017-01-24 Thread Albe Laurenz
Torsten Förtsch wrote: > we have a large table and want to change the type of one column from > NUMERIC(14,4) to NUMERIC(24,12). > If the new type is just NUMERIC without any boundaries, the operation is > fast. If (24,12) is > specified, it takes ages. > > I think it takes so long because the d

[GENERAL] change type from NUMERIC(14,4) to NUMERIC(24,12)

2017-01-24 Thread Torsten Förtsch
Hi, we have a large table and want to change the type of one column from NUMERIC(14,4) to NUMERIC(24,12). If the new type is just NUMERIC without any boundaries, the operation is fast. If (24,12) is specified, it takes ages. I think it takes so long because the database wants to check that all da

Re: [GENERAL] Change type

2005-01-18 Thread Oleg Bartunov
On Tue, 18 Jan 2005, Vladimir S. Petukhov wrote: Hi! Sorry for my English.. I want to dinamcly change type of column. If possible, of course.Trivial idia - create new temporary column, try to write value from old columt to temporarity (if type conersion ok - this made using select/update command

Re: [GENERAL] Change type

2005-01-18 Thread Michael Fuhr
On Tue, Jan 18, 2005 at 07:01:45PM +, Vladimir S. Petukhov wrote: > I want to dinamcly change type of column. If possible, of course. The FAQ discusses this: http://www.postgresql.org/files/documentation/faqs/FAQ.html#4.4 -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---

[GENERAL] Change type

2005-01-18 Thread Vladimir S. Petukhov
Hi! Sorry for my English.. I want to dinamcly change type of column. If possible, of course. Trivial idia - create new temporary column, try to write value from old columt to temporarity (if type conersion ok - this made using select/update command and type conversion checks on client's side),