[root@srv~]# cat /var/lib/pgsql/data/postgresql.conf | grep data
#data_directory = 'ConfigDir' # use data in another directory
#ssl_renegotiation_limit = 0 # amount of data between renegotiations
# open_datasync
# fdatasync (default on Linux)
# Set these on the master and on any standby that will send replication data.
# %d = database name
#client_encoding = sql_ascii # actually, defaults to database
[root@srv~]#
[root@srv~]# ls /var/lib/pgsql/data/
base pg_clog pg_ident.conf pg_multixact pg_serial pg_stat_tmp pg_tblspc PG_VERSION postgresql.conf postmaster.pid
global pg_hba.conf pg_log pg_notify pg_snapshots pg_subtrans pg_twophase pg_xlog postmaster.opts
[root@srv~]# ls /var/lib/pgsql/data/base/1
1/ 12918/ 12923/ 16384/
[root@srv~]# ls /var/lib/pgsql/data/base/12918/
12660 12677 12689_vm 12707 12721 12733 12745 12758 12773_vm 12788 12830_vm 12843 12860 12879 12893_vm 12908_vm
12660_fsm 12678 12691 12708 12721_fsm 12733_fsm 12746 12759 12775 12789 12832 12844 12862 12880 12895 12910
12660_vm 12678_fsm 12692 12709 12721_vm 12733_vm 12748 12761 12776 12790 12833 12845 12863 12882 12897 12912
12662 12678_vm 12693 12711 12723 12735 12749 12763 12777 12791 12833_fsm 12845_fsm 12864 12883 12898 12913
12662_fsm 12680 12695 12712 12724 12736 12749_fsm 12764 12779 12791_fsm 12833_vm 12845_vm 12866 12883_fsm 12898_fsm 12915
12662_vm 12681 12697 12713 12725 12737 12749_vm 12765 12780 12791_vm 12835 12847 12868 12883_vm 12898_vm 12917
12664 12682 12698 12713_fsm 12725_fsm 12738 12751 12766 12781 12793 12836 12848 12869 12885 12900 pg_filenode.map
12665 12682_fsm 12699 12713_vm 12725_vm 12738_fsm 12752 12767 12782 12794 12837 12849 12873 12887 12902 PG_VERSION
12666 12682_vm 12700 12715 12727 12738_vm 12752_fsm 12767_fsm 12782_fsm 12826 12837_fsm 12851 12873_fsm 12888 12903
12666_fsm 12684 12700_fsm 12716 12728 12740 12752_vm 12767_vm 12782_vm 12826_fsm 12837_vm 12852 12873_vm 12888_fsm 12903_fsm
12666_vm 12686 12700_vm 12717 12729 12741 12754 12769 12784 12826_vm 12839 12853 12875 12888_vm 12903_vm
12668 12687 12702 12717_fsm 12729_fsm 12742 12754_fsm 12771 12785 12828 12840 12855 12876 12890 12905
12669 12688 12704 12717_vm 12729_vm 12742_fsm 12754_vm 12772 12786 12829 12841 12856 12877 12892 12907
12674 12689 12705 12719 12731 12742_vm 12756 12773 12786_fsm 12830 12841_fsm 12857 12877_fsm 12893 12908
12676 12689_fsm 12706 12720 12732 12744 12757 12773_fsm 12786_vm 12830_fsm 12841_vm 12859 12877_vm 12893_fsm 12908_fsm
[root@srv~]#
zabbix=# select h.name AS host_name, i.name AS item_name, to_timestamp(hs.timestamp) as timestamp, to_timestamp(hs.clock) AS clock, hs.logeventid
zabbix-# from
zabbix-# hosts h
zabbix-# join items i on h.hostid = i.hostid
zabbix-# join history_log hs on i.itemid = hs.itemid
zabbix-# where hs.logeventid = '4625' and age(to_timestamp(hs.clock)) < (localtime - '1 day'::interval)
zabbix-# order by clock, item_name;
host_name | item_name | timestamp | clock | logeventid
----------------+-----------------------+------------------------+------------------------+------------
srv | Отказ входа в систему | 2017-06-23 01:08:21+06 | 2017-07-10 09:18:14+06 | 4625
srv | Отказ входа в систему | 2017-06-23 01:07:48+06 | 2017-07-10 09:18:14+06 | 4625
srv | Отказ входа в систему | 2017-06-23 01:07:21+06 | 2017-07-10 09:18:14+06 | 4625
select h.name AS host_name, i.name AS item_name, i.key_ as item_key, to_char(date(to_timestamp(hs.clock)), 'YYYY-MM-DD') AS last_time, hs.value, hs.logeventid
from
hosts h
join items i on h.hostid = i.hostid
join history_log hs on i.itemid = hs.itemid
where hs.clock > current_timestamp - interval '1 days' and i.hostid = '10084'
order by last_time, item_name
ОШИБКА: оператор не существует: integer > timestamp with time zone
СТРОКА 6: where hs.clock > current_timestamp - interval '1 days' and i...
^
ПОДСКАЗКА: Оператор с данными именем и типами аргументов не найден. Возможно, вам следует добавить явные приведения типов.