Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / PostgreSQL [игнор отключен] [закрыт для гостей] / could not identify an equality operator for type point / 4 сообщений из 4, страница 1 из 1
15.07.2014, 14:47:45
    #38696878
Gold_
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
could not identify an equality operator for type point
Доброго времени суток.

PostgreSQL 9.2.4 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, 64-bit
Происходит ошибка: could not identify an equality operator for type point
пример

Код: plsql
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
CREATE TABLE _t
(
  id integer NOT NULL,
  center point,
  CONSTRAINT _t_pkey PRIMARY KEY (id)
)
WITH (
  OIDS=FALSE
);


CREATE OR REPLACE FUNCTION t_to_queue()
  RETURNS trigger AS
$BODY$
BEGIN	
              
        IF (tg_op='UPDATE') THEN
                IF (old<>new) THEN
			RAISE NOTICE '!';
                end if;
	END IF;
	RETURN NEW;
end;
$BODY$
 LANGUAGE plpgsql ;



CREATE TRIGGER t__t_a100_event
  AFTER  UPDATE
  ON _t
  FOR EACH ROW
  EXECUTE PROCEDURE t_to_queue();

INSERT INTO _t (id,center) VALUES (1,'(61.379879,55.164235)');

---------------
--на этом запросе будет ошибка
UPDATE  _t
set id=id;
---------------
--подчищаем
DROP table _t;
DROP FUNCTION t_to_queue();




куда копать
...
Рейтинг: 0 / 0
15.07.2014, 15:02:19
    #38696898
LeXa NalBat
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
could not identify an equality operator for type point
Gold_,

9.11. Geometric Functions and Operators
Caution
Note that the "same as" operator, ~=, represents the usual notion of equality for the point, box, polygon, and circle types. Some of these types also have an = operator, but = compares for equal areas only. The other scalar comparison operators (<= and so on) likewise compare areas for these types.
...
Рейтинг: 0 / 0
15.07.2014, 15:08:39
    #38696911
LeXa NalBat
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
could not identify an equality operator for type point
попробуйте

IF (old::text<>new::text) THEN
...
Рейтинг: 0 / 0
15.07.2014, 15:12:24
    #38696917
Gold_
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
could not identify an equality operator for type point
LeXa NalBatпопробуйте

IF (old::text<>new::text) THEN

Заработало - спасибо!
...
Рейтинг: 0 / 0
Форумы / PostgreSQL [игнор отключен] [закрыт для гостей] / could not identify an equality operator for type point / 4 сообщений из 4, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]