
postgresql
hewy0526
这个作者很懒,什么都没留下…
展开
-
plpython 9.2.2
注意,安装python时,需要--enable-shared安装pg时,需要--with-python如果python,重装报 error while loading shared libraries: libpython2.7则需要 vi /etc/ld.so.conf 添加/usr/local/Python2.7/lib/sbin/ldco转载 2013-02-07 18:02:56 · 1754 阅读 · 1 评论 -
PostgreSQL实用SQL
--查看数据库select * from pg_database;--查看表空间select * from pg_tablespace;--查看语言select * from pg_language;--查看角色用户select * from pg_user;select * from pg_shadow;sele转载 2014-10-09 22:31:25 · 667 阅读 · 0 评论 -
postgresql 创建 uuid 自定义函数
PostgreSQL 源码 contrib目录,如果编译报错,需要./configure --with-libxml --with-ossp-uuid --with-libs=/usr/local/lib --with-includes=/usr/local/include --prefix=/data/pgsql/ --with-python原创 2014-11-12 14:46:38 · 3551 阅读 · 0 评论 -
PostgreSQL如何去重,如何获知一张表的隐藏属性(字段)
PostgreSQL中如何获知一张表的隐藏属性(字段)1.创建一张表test_hide_attr,通过这张表获知PostgreSQL表的隐藏属性。12test_zqs=# create table test_hide_attr(hide int4); CREATE TABLE2.查询Postgr转载 2014-06-23 10:53:52 · 3307 阅读 · 0 评论 -
PostgreSQL:ERROR,0A000,"cached plan must not change result type"
今天发现数据库日志报大量如下错误,数据库版本: PostgreSQL 9.1.9。 --数据库错误日志 2013-07-24 15:11:35.895 CST,"db_test","db_test",17526,"192.168.100.221:40188",51ed7b10.4476,1555,"BIND",2013-07-23 02:33:52 CST转载 2014-08-04 13:49:55 · 3889 阅读 · 1 评论 -
postgresql最强整理资料
http://blog.163.com/digoal@126/blog/static/16387704020141229159715/转载 2014-07-28 10:25:28 · 1049 阅读 · 0 评论 -
postgresql-9.3.2 tablefunc 安装
[root@AY1206230659041b61356 /home/www/postgresql-9.3.2/contrib/tablefunc]$find / -name pg_config_ext.h/root/hy/postgresql-9.3.2/src/include/pg_config_ext.h[root@AY1206230659041b61356 /ho原创 2014-04-13 16:27:04 · 3343 阅读 · 0 评论 -
PostgreSQL 升级详细步骤
1、先用源码安装9.32、修改环境变量path3、初始化9.3数据库initdb -E utf8 --locale=zh_CN.UTF8 -D /Users/heyong/opt/pgsql93/data/4、安装pg_upgrade、pg_upgrade_supportcontrib目录下(可能需要把so文件拷贝到lib目录)5、升级自定义包(如果老版原创 2014-01-18 14:38:28 · 2188 阅读 · 0 评论 -
Postgresql表排他锁
lock table xxx in SHARE UPDATE EXCLUSIVE mode; 可以用于资源控制。原创 2013-10-30 13:31:26 · 2075 阅读 · 0 评论 -
postgres 9.2.3流复制环境搭建
环境:primary 10.0.0.1 Red Hat Enterprise Linux Server release 5.4standby 10.0.0.2 Red Hat Enterprise Linux Server release 5.41,主备节点分别安装PG,primary端启动PG服务,不详细描述了。2,primary端修改流复制相关参数,转载 2013-09-02 16:47:14 · 2021 阅读 · 0 评论 -
PostgreSQL性能优化综合
【软件环境】 CentOS 5 x64PostgreSQL 9.1.3plproxy 2.3pgbouncer 1.4.2【测试模型】设计一个包含INSERT, UPDATE, SELECT语句的业务模型用于本优化案例.业务逻辑 : 【测试表】create table user_info(userid int转载 2013-08-23 16:35:52 · 1323 阅读 · 0 评论 -
postgresql 分区表 创建函数
postgresql中,并没有分区表的创建命令,是通过创建继承表及约束等规则来创建,步骤繁琐且麻烦,邮件中封装了一个方法。便于创建分区表规范:postgresql中 时间分区字段请统一采用 timestamp(0) 类型一、原始表 tbl_partitioncreate table tbl_partition (id integer,n原创 2013-06-17 21:15:47 · 1039 阅读 · 0 评论 -
postgresql 加解密
F.20. pgcryptoThe pgcrypto module provides cryptographic functions for PostgreSQL.F.20.1. General hashing functionsF.20.1.1. digest() digest(data text, type text) returns bytea原创 2013-02-20 14:50:08 · 4030 阅读 · 0 评论 -
Postgresql 时间相减求 秒、分、小时数
select a.*,b.login_name,b.user_name,c.cat_name from sec.t_post_message a,sec.t_user b,sec.t_comm_cfg c where a.user_id=b.id and a.type_id=c.cat_id and inpool='0' and time_type='1' and abs((EXTRACT(EPO原创 2013-02-18 18:16:27 · 14063 阅读 · 0 评论 -
python postgresql 函数
CREATE or replaceFUNCTION public.test() RETURNS text AS $$ import socket return socket.gethostname()$$ LANGUAGEplpythonu; CREATE or replaceFUNCTION public.test(keyword varchar)原创 2013-02-07 19:35:43 · 1252 阅读 · 0 评论 -
PostgreSQL9.2 升级至 PostgreSQL 9.3
1)备份9.2的数据cp -r pgdata /home/postgres/pgdata.bak2)修改环境变量至新的PostgreSQL路径vi ~/.bash_profile/opt/postgres/pgsql/bin/psql3)创建新数据库目录mkdir /drbd/pgdata934)初始化数据库/原创 2014-11-28 06:23:05 · 3725 阅读 · 0 评论