[Bizgres-general] Another use case

Mark Kirkwood mkirkwood at greenplum.com
Fri Aug 11 01:22:38 UTC 2006


Gavin Sherry wrote:
>
> This is where it gets fairly ... difficult. Say you this:
>
> 1) Backend A: SELECT a, sum(b) FROM bigtable ...
>
> 2) Backend A: queue statement as <stmt>
>
> 3) Backend B: ALTER TABLE bigtable DROP COLUMN b;
>
> 4) Backend B: force <stmt> to drop its locks
>
> 5) Backend B: complete DROP COLUMN
>
> ...
>
> 6) Run <stmt>
>
> There's a good reason DDL take out locks which conflict with DML
> statements: they will change the table under the DML and the DML will fail
> in spectacular fashion. I'm not sure how you should handle this.
>
>   

Hmm , Yeah - good scenario. We might be ok if it is only the 
[Row]Exclusive locks on the target relation that I'm dropping - as there 
will still be AccessShare ones on all the relations in the query - which 
should prevent the DROP COLUMN or similar from beginning.


Cheers

Mark


More information about the Bizgres-general mailing list