Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-16 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Sat, Jan 15, 2011 at 10:25 AM, Noah Misch n...@leadboat.com wrote: Do you value test coverage so little? If you're asking whether I think real-world usability is more important than test coverage, then yes. Quite honestly, I'd be inclined to rip

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-16 Thread Noah Misch
On Sun, Jan 16, 2011 at 12:07:44PM -0500, Tom Lane wrote: Robert Haas robertmh...@gmail.com writes: On Sat, Jan 15, 2011 at 10:25 AM, Noah Misch n...@leadboat.com wrote: Do you value test coverage so little? If you're asking whether I think real-world usability is more important than

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-16 Thread Robert Haas
On Sun, Jan 16, 2011 at 12:07 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Sat, Jan 15, 2011 at 10:25 AM, Noah Misch n...@leadboat.com wrote: Do you value test coverage so little? If you're asking whether I think real-world usability is more important

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-15 Thread Robert Haas
On Sat, Jan 15, 2011 at 1:30 AM, Noah Misch n...@leadboat.com wrote: Here's v2 based on your feedback. I pruned test coverage down to just the highlights.  By the end of patch series, the net change becomes +67 to alter_table.sql and +111 to alter_table.out.   The alter_table.out delta is

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-15 Thread Noah Misch
On Sat, Jan 15, 2011 at 08:57:30AM -0500, Robert Haas wrote: On Sat, Jan 15, 2011 at 1:30 AM, Noah Misch n...@leadboat.com wrote: Here's v2 based on your feedback. I pruned test coverage down to just the highlights. ?By the end of patch series, the net change becomes +67 to

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-15 Thread Robert Haas
On Sat, Jan 15, 2011 at 10:25 AM, Noah Misch n...@leadboat.com wrote: Do you value test coverage so little? If you're asking whether I think real-world usability is more important than test coverage, then yes. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-15 Thread Noah Misch
On Sat, Jan 15, 2011 at 02:31:21PM -0500, Robert Haas wrote: On Sat, Jan 15, 2011 at 10:25 AM, Noah Misch n...@leadboat.com wrote: Do you value test coverage so little? If you're asking whether I think real-world usability is more important than test coverage, then yes. No, I wasn't asking

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-14 Thread Noah Misch
Here's v2 based on your feedback. I pruned test coverage down to just the highlights. By the end of patch series, the net change becomes +67 to alter_table.sql and +111 to alter_table.out. The alter_table.out delta is larger in this patch (+150), because the optimizations don't yet apply and

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-12 Thread Noah Misch
On Tue, Jan 11, 2011 at 09:41:35PM -0500, Robert Haas wrote: On Tue, Jan 11, 2011 at 7:25 AM, Noah Misch n...@leadboat.com wrote: On Tue, Jan 11, 2011 at 06:37:33AM -0500, Robert Haas wrote: On Sun, Jan 9, 2011 at 4:59 PM, Noah Misch n...@leadboat.com wrote: This begins the patch series

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-11 Thread Simon Riggs
On Sun, 2011-01-09 at 16:59 -0500, Noah Misch wrote: This begins the patch series for the design I recently proposed[1] for avoiding some table rewrites in ALTER TABLE ... ALTER COLUMN ... TYPE. I'm posting these patches today: These sound very good. I have a concern that by making the

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-11 Thread Robert Haas
On Sun, Jan 9, 2011 at 4:59 PM, Noah Misch n...@leadboat.com wrote: This begins the patch series for the design I recently proposed[1] for avoiding some table rewrites in ALTER TABLE ... ALTER COLUMN ... TYPE.  I'm posting these patches today: 0 - new test cases This doesn't look right.

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-11 Thread Noah Misch
On Tue, Jan 11, 2011 at 09:24:46AM +, Simon Riggs wrote: On Sun, 2011-01-09 at 16:59 -0500, Noah Misch wrote: This begins the patch series for the design I recently proposed[1] for avoiding some table rewrites in ALTER TABLE ... ALTER COLUMN ... TYPE. I'm posting these patches

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-11 Thread Noah Misch
On Tue, Jan 11, 2011 at 06:37:33AM -0500, Robert Haas wrote: On Sun, Jan 9, 2011 at 4:59 PM, Noah Misch n...@leadboat.com wrote: This begins the patch series for the design I recently proposed[1] for avoiding some table rewrites in ALTER TABLE ... ALTER COLUMN ... TYPE. ?I'm posting

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-11 Thread Robert Haas
On Tue, Jan 11, 2011 at 7:14 AM, Noah Misch n...@leadboat.com wrote: I have a concern that by making the ALTER TABLE more complex that we might not be able to easily tell if a rewrite happens, or not. Perhaps we should add a WITHOUT REWRITE clause? That would allow a user to specify that they

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-11 Thread Simon Riggs
On Tue, 2011-01-11 at 07:14 -0500, Noah Misch wrote: These changes do make it harder to guess how much work the ALTER TABLE will do. Indeed, about 1/4 of my own guesses prior to writing were wrong. Something like WITHOUT REWRITE might be the way to go, though there are more questions: if it

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-11 Thread Noah Misch
On Tue, Jan 11, 2011 at 12:37:28PM +, Simon Riggs wrote: On Tue, 2011-01-11 at 07:14 -0500, Noah Misch wrote: These changes do make it harder to guess how much work the ALTER TABLE will do. Indeed, about 1/4 of my own guesses prior to writing were wrong. Something like WITHOUT

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-11 Thread Noah Misch
On Tue, Jan 11, 2011 at 07:27:46AM -0500, Robert Haas wrote: On Tue, Jan 11, 2011 at 7:14 AM, Noah Misch n...@leadboat.com wrote: True. ?At least we could completely document the lock choices on the ALTER TABLE reference page. ?The no-rewrite cases are defined at arms length from ALTER

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-11 Thread Simon Riggs
On Tue, 2011-01-11 at 08:06 -0500, Noah Misch wrote: On Tue, Jan 11, 2011 at 12:37:28PM +, Simon Riggs wrote: On Tue, 2011-01-11 at 07:14 -0500, Noah Misch wrote: These changes do make it harder to guess how much work the ALTER TABLE will do. Indeed, about 1/4 of my own guesses

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-11 Thread Noah Misch
On Tue, Jan 11, 2011 at 01:17:23PM +, Simon Riggs wrote: On Tue, 2011-01-11 at 08:06 -0500, Noah Misch wrote: On Tue, Jan 11, 2011 at 12:37:28PM +, Simon Riggs wrote: Given your thoughts above, my preference would be for EXPLAIN ALTER TABLE to describe the actions that will take

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-11 Thread Robert Haas
On Jan 11, 2011, at 8:50 AM, Noah Misch n...@leadboat.com wrote: Okay; I'll see what I can come up with. The other part I was going to try to finish before the last commitfest begins is avoiding unnecessary rebuilds of indexes involving changed columns. Is that more or less important than

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-11 Thread Csaba Nagy
On Tue, 2011-01-11 at 07:14 -0500, Noah Misch wrote: On Tue, Jan 11, 2011 at 09:24:46AM +, Simon Riggs wrote: I have a concern that by making the ALTER TABLE more complex that we might not be able to easily tell if a rewrite happens, or not. What about add EXPLAIN support to it, then

Re: [HACKERS] ALTER TYPE 0: Introduction; test cases

2011-01-11 Thread Robert Haas
On Tue, Jan 11, 2011 at 7:25 AM, Noah Misch n...@leadboat.com wrote: On Tue, Jan 11, 2011 at 06:37:33AM -0500, Robert Haas wrote: On Sun, Jan 9, 2011 at 4:59 PM, Noah Misch n...@leadboat.com wrote: This begins the patch series for the design I recently proposed[1] for avoiding some table