Re: [HACKERS] Re: [BUGS] BUG #4689: Expanding the length of a VARCHAR column should not induce a table rewrite

2009-03-05 Thread Xuân Baldauf
Jaime Casanova wrote: > On Thu, Mar 5, 2009 at 10:47 AM, Matteo Beccati wrote: > >> Guillaume Smet ha scritto: >> >>> On Wed, Mar 4, 2009 at 11:50 AM, Peter Eisentraut wrote: >>> The question is how you want to implement this in a data type independent fashion. You can't

Re: [HACKERS] Re: [BUGS] BUG #4689: Expanding the length of a VARCHAR column should not induce a table rewrite

2009-03-05 Thread Jaime Casanova
On Thu, Mar 5, 2009 at 3:27 PM, Xuân Baldauf wrote: > > > Well, while this behaviour is well-known for PostgreSQL, this is actually an > abuse of syntax. If there are legitimate requirements for rewriting a table, > then there should be explicit syntax for such a feature, like "ALTER TABLE > ... R

Re: [HACKERS] Re: [BUGS] BUG #4689: Expanding the length of a VARCHAR column should not induce a table rewrite

2009-03-05 Thread Jaime Casanova
On Thu, Mar 5, 2009 at 2:46 PM, Kevin Grittner wrote: > >> now, back to the problem... is not easier to define a column as TEXT >> and to put a check to constraint the length? if you wanna change the >> constraint that will be almost free > > Thanks for the interesting suggestion.  I'm not sure I'

Re: [HACKERS] Re: [BUGS] BUG #4689: Expanding the length of a VARCHAR column should not induce a table rewrite

2009-03-05 Thread Kevin Grittner
>>> Jaime Casanova wrote: > the table will be scanned but not rewritten That can still be a very long time on some tables. And there would still be the issue of dodging all the brickbats thrown at me by developers whose tools use the system tables to limit the number of characters a user is a

Re: [HACKERS] Re: [BUGS] BUG #4689: Expanding the length of a VARCHAR column should not induce a table rewrite

2009-03-05 Thread Kevin Grittner
>>> Jaime Casanova wrote: > ALTER TABLE ... TYPE does cause a table rewrite even if new_type = > old_type, and that is actually useful... > for example when you add a fillfactor to an existing table that > fillfactor will not affect the existing data until you rewrite the > table and a convenien

Re: [HACKERS] Re: [BUGS] BUG #4689: Expanding the length of a VARCHAR column should not induce a table rewrite

2009-03-05 Thread Jaime Casanova
On Thu, Mar 5, 2009 at 10:47 AM, Matteo Beccati wrote: > Guillaume Smet ha scritto: >> On Wed, Mar 4, 2009 at 11:50 AM, Peter Eisentraut wrote: >>> The question is how you want to implement this in a data type independent >>> fashion.  You can't assume that increasing the typmod is a noop for all

Re: [HACKERS] Re: [BUGS] BUG #4689: Expanding the length of a VARCHAR column should not induce a table rewrite

2009-03-05 Thread Matteo Beccati
Guillaume Smet ha scritto: > On Wed, Mar 4, 2009 at 11:50 AM, Peter Eisentraut wrote: >> The question is how you want to implement this in a data type independent >> fashion. You can't assume that increasing the typmod is a noop for all data >> types. > > Sure. See my previous answer on -hackers