Tom Lane wrote:
>> Andres Freund writes:
>>> Hm, strategically sprinkled CheckTableNotInUse() might do the trick?
>
> Attached is a proposed patch that closes off this problem. I've tested
> it to the extent that it blocks Albe's example and passes check-world.
I tested it, and it works fine.
Michael Paquier writes:
> The patch looks good to me, could you add a regression test?
Done, thanks for the review. I stuck the test into triggers.sql,
which is not completely on point since there are other ways to get
to this error. But if we're thinking of it as a framework for testing
other
On 2017-06-03 18:23:33 -0400, Tom Lane wrote:
> Attached is a proposed patch that closes off this problem. I've tested
> it to the extent that it blocks Albe's example and passes check-world.
Cool.
> I'm unsure whether to back-patch or not; the main argument for not doing
> so is that if any ext
On Sun, Jun 4, 2017 at 7:23 AM, Tom Lane wrote:
> I'm unsure whether to back-patch or not; the main argument for not doing
> so is that if any extensions are calling DefineIndex() directly, this
> would be an API break for them. Given what a weird case this is, I'm not
> sure it's worth that.
Kn
I wrote:
> Andres Freund writes:
>> Hm, strategically sprinkled CheckTableNotInUse() might do the trick?
> +1. We can't reasonably make it work: the outer query already has its
> list of indexes that need to be inserted into. Also, if you try to
> make the index via ALTER TABLE ADD CONSTRAINT i
Andres Freund writes:
> On 2017-05-24 08:26:24 -0400, Robert Haas wrote:
>> I'm willing to bet that nobody ever thought about that case very hard.
>> It seems like we should either make it work or prohibit it, but I
>> can't actually see quite how to do either off-hand.
> Hm, strategically sprink
On 2017-05-24 08:26:24 -0400, Robert Haas wrote:
> On Mon, May 22, 2017 at 7:05 AM, Albe Laurenz wrote:
> > Not that it is a useful use case, but I believe that this is
> > a bug that causes index corruption:
> >
> > CREATE TABLE mytable(
> >id integer PRIMARY KEY,
> >id2 integer NOT NULL
On Mon, May 22, 2017 at 7:05 AM, Albe Laurenz wrote:
> Not that it is a useful use case, but I believe that this is
> a bug that causes index corruption:
>
> CREATE TABLE mytable(
>id integer PRIMARY KEY,
>id2 integer NOT NULL
> );
>
> CREATE FUNCTION makeindex() RETURNS trigger
>LANGU
Not that it is a useful use case, but I believe that this is
a bug that causes index corruption:
CREATE TABLE mytable(
id integer PRIMARY KEY,
id2 integer NOT NULL
);
CREATE FUNCTION makeindex() RETURNS trigger
LANGUAGE plpgsql AS
$$BEGIN
CREATE INDEX ON mytable(id2);
RETURN NEW;
E