How do I prevent a texture from stretching when using a boolean modifier on the object?
If using generated texture coordinates, such as:



The coordinates will be between 0 and 1, whatever the object size is.

So if we apply a boolean, the resulting object size changes and the texture stretches (which can be an interesting effect, by the way):



If we use 'object', like here:



Coordinates are stable in object space as they are the real coordinates, not remapped between 0 and 1.

So: