[pgadmin-support] Error on deleting

2004-03-30 Thread Indibil
Hi:

I have a PostgreSQL 7.2.2 database since 2 years working right until now.
When I try to delete a row from pgAdmin II , I get the message " cannot
uniquely identify, 2 rows match." If I go on deleting the row, the 2
ones are deleted. Of Course the 2 rows don't match. They have different
primary key, OIDs, and so on.

This has happened several times in the last days. If I issue the SQL command
"Delete .." no errors occurs. 

Please I need help, because the database is into production, and I am
receiving callings from angry users which can not delete rows from their
Visual Basic program ( they access the PostgreSQL database via this
program, and get the message " the record does not exist" when they are
trying to delete).

Thanks in advance, and sorry for my poor english.

Indibil

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [pgadmin-support] Error on deleting

2004-03-31 Thread Indibil
Hi David:

I have another server with PostgreSQL 7.3 so,  I dumped the PostgreSQL 7.2
database and restored it in 7.3. With pgAdmin_II I get the same error when
I try to delete a record from the table "escritos". This table has a
primary key with two fields: "cod_ficha", "cod_estado". If, for example, I
select the records:

cod_ficha   cod_estado
---
200301  0001
200301  0023

When I try to delete only one of them, I get the message: "The selected
record could not be uniquely identified, 2 records match, and will all be
deleted if you proceed. Do you wish to continue?". 

The last lines in the pg_adminII.log are:
SELECT count(*) AS count FROM public.escritos WHERE cod_ficha=200301
DELETE public.escritos WHERE cod_ficha=200301

I think the problem is in the DELETE statement because the WHERE condition 
must be: ... WHERE cod_ficha=200301 AND cod_estado='0023'

Whith pgAdmin III there is no problem on deleting because it issues the
following deleting statement:
DELETE public.escritos WHERE oid=169858256


Thanks a lot for your interest David,

Indibil


Dave Page wrote:

> It's rumoured that Indibil once said:
>> Hi:
>>
>> I have a PostgreSQL 7.2.2 database since 2 years working right until
>> now. When I try to delete a row from pgAdmin II , I get the message "
>> cannot uniquely identify, 2 rows match." If I go on deleting
>> the row, the 2 ones are deleted. Of Course the 2 rows don't match. They
>> have different primary key, OIDs, and so on.
> 
> Hmm, can you re-create this with logging set to errors + sql please? Then
> send the logfile...
> Regards, Dave
> 
> 
> 
> ---(end of broadcast)---
> TIP 8: explain analyze is your friend


---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match