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

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
could not identify an equality operator for type point
    #38696898
LeXa NalBat
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
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
could not identify an equality operator for type point
    #38696911
LeXa NalBat
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
попробуйте

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

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

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


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