linux postgresql

来源:互联网 发布:网络微电影女主角 编辑:程序博客网 时间:2024/06/06 08:28

root:

yum install http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm

yum install postgresql93-server postgresql93-contrib
service postgresql-9.3 initdb
chkconfig postgresql-9.3 on

service postgresql-9.3 start

postgresql-9.3

... 

createdb ...

psql ...ok可以用了。



编辑postgreaql.conf里面的listen_address='*'

在pg_hba.conf里添加信任的ip地址192.168.1.0/24

可以连上了。

文件位置/var/lib/pgsql..


CREATE OR REPLACE FUNCTION trigf()
  RETURNS trigger AS
'/home/postgres/testtriger.so', 'trigf'
  LANGUAGE c VOLATILE
  COST 1;
ALTER FUNCTION trigf()
  OWNER TO postgres;


CREATE OR REPLACE FUNCTION qhsrvaccount_monitor()
  RETURNS trigger AS
'/home/postgres/qhsrvaccount_monitor.so', 'qhsrvaccount_monitor'
  LANGUAGE c VOLATILE
  COST 1;
ALTER FUNCTION qhsrvaccount_monitor()
  OWNER TO postgres;

CREATE OR REPLACE FUNCTION qhcardinfo_monitor()
  RETURNS trigger AS
'/home/postgres/qhcardinfo_monitor.so', 'qhcardinfo_monitor'
  LANGUAGE c VOLATILE
  COST 1;
ALTER FUNCTION qhcardinfo_monitor()
  OWNER TO postgres;


CREATE TRIGGER tbefore BEFORE INSERT OR UPDATE OR DELETE ON qhsrvaccount
    FOR EACH ROW EXECUTE PROCEDURE qhsrvaccount_monitor();

0 0
原创粉丝点击