Tôi có Trình kích hoạt này trong Postgresql mà tôi không thể chỉ hoạt động (không có gì). Để hiểu, có cách tôi đã xác định:gỡ lỗi kích hoạt postgresql
CREATE TABLE documents (
...
modification_time timestamp with time zone DEFAULT now()
);
CREATE FUNCTION documents_update_mod_time() RETURNS trigger
AS $$
begin
new.modification_time := now();
return new;
end
$$
LANGUAGE plpgsql;
CREATE TRIGGER documents_modification_time
BEFORE INSERT OR UPDATE ON documents
FOR EACH ROW
EXECUTE PROCEDURE documents_update_mod_time();
Bây giờ để làm cho nó thú vị hơn một chút .. Làm cách nào để bạn kích hoạt gỡ lỗi?
Điều này không liên quan chặt chẽ, nhưng bạn có thể thấy nó hữu ích trong cuộc phiêu lưu pgsql của bạn anyway: http://stackoverflow.com/questions/430123/how-do-i-enable-the-postgresql-function -profiler – Kev