Re: pgsql: doc: add examples of creative use of unique expression indexes

2020-05-21 Thread Bruce Momjian
On Mon, Apr 20, 2020 at 08:31:29PM -0400, Bruce Momjian wrote: > On Mon, Apr 20, 2020 at 04:21:32PM -0400, Tom Lane wrote: > > [ sorry, I'd lost track of this thread ] > > > > Bruce Momjian writes: > > > I now remember that I wrote the first IS NULL in: > > > CREATE UNIQUE INDEX tests_target_on

Re: pgsql: doc: add examples of creative use of unique expression indexes

2020-04-20 Thread Bruce Momjian
On Mon, Apr 20, 2020 at 04:21:32PM -0400, Tom Lane wrote: > [ sorry, I'd lost track of this thread ] > > Bruce Momjian writes: > > I now remember that I wrote the first IS NULL in: > > CREATE UNIQUE INDEX tests_target_one_null ON tests ((target IS NULL)) > > WHERE target IS NULL; > > in hope t

Re: pgsql: doc: add examples of creative use of unique expression indexes

2020-04-20 Thread Tom Lane
[ sorry, I'd lost track of this thread ] Bruce Momjian writes: > I now remember that I wrote the first IS NULL in: > CREATE UNIQUE INDEX tests_target_one_null ON tests ((target IS NULL)) WHERE > target IS NULL; > in hope that if someone is looking for the null value in the column, the > IS NUL

Re: pgsql: doc: add examples of creative use of unique expression indexes

2020-04-11 Thread Bruce Momjian
On Fri, Apr 10, 2020 at 08:17:09PM -0400, Bruce Momjian wrote: > On Fri, Apr 10, 2020 at 07:21:29PM -0400, Tom Lane wrote: > > Bruce Momjian writes: > > > I agree with your analysis. I still want to have some mention that > > > partial indexes can be used to create single-NULL columns, which migh