SELECT bug? - Mailing list pgsql-bugs

From Jacek Kalinski
Subject SELECT bug?
Date
Msg-id 3EF800FA.6060300@o2.pl
Whole thread Raw
List pgsql-bugs
============================================================================
                         POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name        : Jacek Kalinski (Jack)
Your email address    : jacek_kal@o2.pl


System Configuration
---------------------
   Architecture (example: Intel Pentium)     : i686 - AMD Athlon XP 1800+

   Operating System (example: Linux 2.0.26 ELF)     : Linux2.4.20/2.4.21 ELF

   PostgreSQL version (example: PostgreSQL-7.3.3): PostgreSQL-7.3.3

   Compiler used (example:  gcc 2.95.2)        : 3.2.2

Memory: 512MB DDR
Avg CPU usage when inserting records to db: 20-35%

Please enter a FULL description of your problem:
------------------------------------------------

Firstly, sorry for my English (it is not my native language).

I have a strange problem: I created a new database in postgres. I tried
to import a tables, views etc. - there was no error.
Then I started a small script (wroted in perl) which started to import
data into my database - but I think that is no problem with this script..
After that I checked, that records are incorrect (are duplicated!).
It is not first time, when records in different tables are duplicated.
In another console i tried to connect to this database (by psql). I wrote:
select usable,count(*) from authors group by usable having count(*)>1;

I get a list of duplicates. When I tried to select only duplicated rows
by select * from authors where usable = '"name" <alias@domain.pl>';
first run this command returned me 0 rows (sometimes, but rarely I also
got that 1 rows were found as you can see below):
  id   |        original          |           usable
------+--------------------------+--------------------------------
13126 | "name" <alias@domain.pl> | "name" <alias@domain.pl>
(1 row)

but when I wrote the same command not with equals '=' but with 'like' I
  got:
  id   |        original          |           usable
------+--------------------------+--------------------------------
  8078 | "name" <alias@domain.pl> | "name" <alias@domain.pl>
13126 | "name" <alias@domain.pl> | "name" <alias@domain.pl>
(2 rows)

I really do not know where can be a problem.
Now it is not a problem that records were inserted twice (or more - I
also have this records), but the script is checking if record already
exist by select.

I don't know what to do with this...



Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

How to repeat this problem? It is very easy: just connect to database
and write down select command.
To get different records it is very difficult, but why select does not
return correctly (0 rows)?

Yours faithfully,
Jack Kalinski

pgsql-bugs by date:

Previous
From:
Date:
Subject: Re: Movie
Next
From: "arindam banerjee"
Date:
Subject: PostgreSQL problem with Triggers