linux postgresql

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();

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章