SELECT bug?

From: Jacek Kalinski <jacek_kal(at)o2(dot)pl>
To: pgsql-bugs(at)postgresql(dot)org
Subject: SELECT bug?
Date: 2003-06-24 07:42:50
Message-ID: 3EF800FA.6060300@o2.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name : Jacek Kalinski (Jack)
Your email address : jacek_kal(at)o2(dot)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(at)domain(dot)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(at)domain(dot)pl> | "name" <alias(at)domain(dot)pl>
(1 row)

but when I wrote the same command not with equals '=' but with 'like' I
got:
id | original | usable
------+--------------------------+--------------------------------
8078 | "name" <alias(at)domain(dot)pl> | "name" <alias(at)domain(dot)pl>
13126 | "name" <alias(at)domain(dot)pl> | "name" <alias(at)domain(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tatsuo Ishii 2003-06-24 07:47:55 Re: [HACKERS] again: Bug #943: Server-Encoding from EUC_TW toUTF-8
Previous Message Bruce Momjian 2003-06-23 17:03:55 Re: fe-connect build failure (Solaris 9, PGSQL 7.3.3, OpenSSL