Re: SELECT returning too many rows (?) [7.4.2]

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: rob <rob(at)dsvr(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: SELECT returning too many rows (?) [7.4.2]
Date: 2005-02-08 16:14:00
Message-ID: 6989.1107879240@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

rob <rob(at)dsvr(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message robf 2005-02-08 16:41:51 Re: SELECT returning too many rows (?)
Previous Message Tom Lane 2005-02-08 16:12:30 Re: SELECT returning too many rows (?)