pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #13838: Problem in a table with integer primary key
3+ messages / 3 participants
[nested] [flat]

* BUG #13838: Problem in a table with integer primary key
@ 2015-12-29 17:03  ronan.vargas@gmail.com
  0 siblings, 1 reply; 3+ messages in thread

From: ronan.vargas@gmail.com @ 2015-12-29 17:03 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      13838
Logged by:          Ronan Lima Vargas
Email address:      ronan.vargas@gmail.com
PostgreSQL version: 9.1.14
Operating system:   Windows
Description:        

Hi,
I'm using pgAdmin 1.20 for running some queries in my database. The
following error is occurring:

- Given a table (CLIENT) with a integer key (CLIENT_COD), when I run the
query:

select * from client where client_cod = 1

It doesn't return ANY row.

But when I run:

select * from client where (cast client_cod as text) = '1'

It returns ONE row.

In this moment, for me it would be hard to change DB version in order to see
if it will be solved. I've already tried to run an UPDATE, setting the same
CLIENT_COD, but it didn't work.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #13838: Problem in a table with integer primary key
@ 2015-12-29 20:26  Feike Steenbergen <feikesteenbergen@gmail.com>
  parent: ronan.vargas@gmail.com
  0 siblings, 1 reply; 3+ messages in thread

From: Feike Steenbergen @ 2015-12-29 20:26 UTC (permalink / raw)
  To: ronan.vargas@gmail.com; +Cc: pgsql-bugs

Could you do an explain analyze of both of these statements? It may help in
understanding the issue.

If it's a primary key, I assume the first query to be using the primary key
index.
The second variant will probably be a sequential scan on the table.

If these give different results, it may be a corrupt index, you could try
to reindex the specific index or the table, see
http://www.postgresql.org/docs/9.1/static/sql-reindex.html

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #13838: Problem in a table with integer primary key
@ 2016-01-06 11:09  Ronan Vargas <ronan.vargas@gmail.com>
  parent: Feike Steenbergen <feikesteenbergen@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Ronan Vargas @ 2016-01-06 11:09 UTC (permalink / raw)
  To: Feike Steenbergen <feikesteenbergen@gmail.com>; +Cc: pgsql-bugs

Hi Feike,
It was a corrupt index. We ran "reindex" under CLIENTS table and the
problem was solved.

Thank you very much for help!

Att,
Ronan.


2015-12-29 18:26 GMT-02:00 Feike Steenbergen <feikesteenbergen@gmail.com>:

> Could you do an explain analyze of both of these statements? It may help
> in understanding the issue.
>
> If it's a primary key, I assume the first query to be using the primary
> key index.
> The second variant will probably be a sequential scan on the table.
>
> If these give different results, it may be a corrupt index, you could try
> to reindex the specific index or the table, see
> http://www.postgresql.org/docs/9.1/static/sql-reindex.html
>



-- 
Ronan Lima Vargas

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2016-01-06 11:09 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-12-29 17:03 BUG #13838: Problem in a table with integer primary key ronan.vargas@gmail.com
2015-12-29 20:26 ` Feike Steenbergen <feikesteenbergen@gmail.com>
2016-01-06 11:09   ` Ronan Vargas <ronan.vargas@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox