Re: [HACKERS] Materialized views and unique indexes

2013-03-07 Thread Josh Berkus
As expected, the refresh failed, but the error message is not really user-friendly. Shouldn't we output instead something like that? ERROR: could not refresh materialized view because of failure when rebuilding index DETAIL: key is duplicated. Is there a good reason to allow unique indexes

Re: [HACKERS] Materialized views and unique indexes

2013-03-07 Thread Michael Paquier
On Fri, Mar 8, 2013 at 11:33 AM, Josh Berkus j...@agliodbs.com wrote: As expected, the refresh failed, but the error message is not really user-friendly. Shouldn't we output instead something like that? ERROR: could not refresh materialized view because of failure when rebuilding index

Re: [HACKERS] Materialized views and unique indexes

2013-03-07 Thread Craig Ringer
On 03/08/2013 10:55 AM, Michael Paquier wrote: Also, as it is not mandatory for a unique index to be a constraint, I think that we should block the creation of unique indexes too to avoid any problems. Any suggestions? How much does the planner benefit from the implied constraint of a unique

Re: [HACKERS] Materialized views and unique indexes

2013-03-07 Thread Tom Lane
Craig Ringer cr...@2ndquadrant.com writes: On 03/08/2013 10:55 AM, Michael Paquier wrote: Also, as it is not mandatory for a unique index to be a constraint, I think that we should block the creation of unique indexes too to avoid any problems. Any suggestions? How much does the planner

Re: [HACKERS] Materialized views and unique indexes

2013-03-07 Thread Michael Paquier
On Fri, Mar 8, 2013 at 12:32 PM, Tom Lane t...@sss.pgh.pa.us wrote: Craig Ringer cr...@2ndquadrant.com writes: On 03/08/2013 10:55 AM, Michael Paquier wrote: Also, as it is not mandatory for a unique index to be a constraint, I think that we should block the creation of unique indexes too