Shorthand for foreign key indices - Mailing list pgsql-general

From Brendan Jurd
Subject Shorthand for foreign key indices
Date
Msg-id 37ed240d050508090539f72c37@mail.gmail.com
Whole thread Raw
Responses Re: Shorthand for foreign key indices
Re: Shorthand for foreign key indices
List pgsql-general
Does anybody else think it would be cool if you could use a shorthand
expression for creating an index on a foreign key?  I think it's fair
to say that in the majority of cases, if you're using a foreign key,
you're going to want an index on it.

I know that it was decided a fair few releases ago to stop creating an
implicit index for each foreign key, and that's cool, but should the
creation syntax really require a separate statement for every single
FK you want to index?

Something like ...

CREATE TABLE foo (
 foo int NOT NULL REFERENCES bar INDEX
);

... would be marvellous

My apologies if this has been answered before, but a search of the
-general mailing list was not fruitful.

BJ

pgsql-general by date:

Previous
From: Michael Ben-Nes
Date:
Subject: Re: SQL History
Next
From: Tom Lane
Date:
Subject: Re: SQL History