Re: SELECT returning too many rows (?) [7.4.2] - Mailing list pgsql-bugs

From Tom Lane
Subject Re: SELECT returning too many rows (?) [7.4.2]
Date
Msg-id 6989.1107879240@sss.pgh.pa.us
Whole thread Raw
In response to Re: SELECT returning too many rows (?) [7.4.2]  (rob <rob@dsvr.net>)
List pgsql-bugs
rob <rob@dsvr.net> writes:
> I believe there to be one row stored, which is the reason why the
> constraints on the primary key (id) were met, and that for reasons as
> yet unknown a select returns three rows.

Just for the record: you do have three physical rows.  The reason a
select on the primary key returns only one is that Postgres "knows"
a unique index can only return one hit for a given key, and so it stops
the indexscan after getting the first result.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: SELECT returning too many rows (?)
Next
From: robf
Date:
Subject: Re: SELECT returning too many rows (?)