Odd delete behavior in 7.0beta1

Поиск
Список
Период
Сортировка
От Andrew Rawnsley
Тема Odd delete behavior in 7.0beta1
Дата
Msg-id 00022312372901.04412@coho.ravensfield.com
обсуждение исходный текст
Список pgsql-general
Any idea whether this is (a) a bug in 7.0beta1 or (b)
me being an idiot (happens to the best of us..).

System: Fresh build of 7.0beta1 on a redhat 6.0 system

In summary: Delete behavior doesn't jibe with update and
select behavior. In fact, I can't get delete to work
at all in this situation.

Details:

sm=> \d parameters
           Table "parameters"
  Attribute  |     Type      | Modifier
-------------+---------------+-----------
 casno       | char(15)      | not null
 parameter   | text          | not null
 status      | integer       | default 0
 mf          | varchar(50)   |
 mw          | numeric(10,3) |
 tsca        | integer       | default 0
 epa_inv     | char(2)       |
 ohvap       | integer       | default 0
 bustr       | integer       | default 0
 saraiii     | integer       | default 0
 description | text          |
 uses        | text          |
Indices: pkprm, (NOTE: pkprm is primary key on casno)
         xparm  (NOTE: xparm is a btree index on parameter)

sm=> insert into parameters (casno,parameter) values ('0000-00-0','METHYL ETHYL DOGPOOP');
INSERT 199287 1
sm=> explain update parameters set parameter = 'METHYL ETHYL PUPPYPOOP' where casno = '0000-00-0';
NOTICE: QUERY PLAN:

Index scan using pkprm on parameters  (cost=0.00..7.09 rows=10 width=98)

sm=> update parameters set parameter = 'METHYL ETHYL PUPPYPOOP' where casno = '0000-00-0';
UPDATE 1
sm=> delete from parameters where casno = '0000-00-0';
ERROR:     Unable to identify operator '=' for types 'int4' and 'bpchar'
    You will have to retype this query using an explicit cast
sm=> explain delete from parameters where casno = '0000-00-0';
NOTICE: QUERY PLAN:

Index scan using pkprm on parameters  (cost=0.00..7.09 rows=10 width=98)

sm=> delete from parameters where casno = '0000-00-0'::text;
DELETE 0
sm=> delete from parameters where casno = '0000-00-0'::char;
ERROR:     Unable to identify operator '=' for types 'int4' and 'bpchar'
    You will have to retype this query using an explicit cast
sm=> delete from parameters where casno = '0000-00-0'::varchar;
ERROR:     Unable to identify operator '=' for types 'int4' and 'bpchar'
    You will have to retype this query using an explicit cast



Other than this bit, 7.0 looks peachy. Peachy enough for me to finally
completely ditch Sybase (there was much rejoicing). Good work all.

--
Regards,

Andrew Rawnsley
Ravensfield Geographic Resources, Ltd.
(740) 587-0114
www.ravensfield.com



В списке pgsql-general по дате отправления:

Предыдущее
От: Ron Chmara
Дата:
Сообщение: Re: [GENERAL] Re: [General] pgsql on win95
Следующее
От: Andrew Rawnsley
Дата:
Сообщение: Odd delete behavior in 7.0beta1