上一页 1 ··· 62 63 64 65 66 67 68 69 70 ··· 104 下一页
摘要: 学习网络上的文章:http://blog.sina.com.cn/s/blog_7ffcb1410100s0ut.html然后我自己做了一下简单地验证:[root@localhost test]# cat testjmp.c#include<stdio.h>#include<setjmp.h>jmp_buf ebuf;int ftaste();int main(){ int i; fprintf(stderr,"1\n"); i=setjmp(ebuf); if (i==0) { ftaste(); fprintf(stderr,"This 阅读全文
posted @ 2012-10-30 08:48 健哥的数据花园 阅读(204) 评论(0) 推荐(0)
摘要: 学习了网络上的这篇文章:http://liyong-zone.blog.sohu.com/102060659.html致谢。编译的时候用:g++ -o testsig.o testsig.cpp试着运行了一下:[root@localhost test]# cat testsig.cpp#include <iostream>#include <signal.h>using namespace std;void CatchSigUsr1(int sig){ cout<<"SIGUSR1 Caught"<<endl;}void Ca 阅读全文
posted @ 2012-10-29 16:31 健哥的数据花园 阅读(20502) 评论(0) 推荐(1)
摘要: [作者:技术者高健@博客园 mail:luckyjackgao@gmail.com]在bgwriter的代码中,有这样一段,其中的MyProc显得很突兀:/* * Loop forever */ for (;;) { bool can_hibernate; int rc; ... 阅读全文
posted @ 2012-10-29 14:39 健哥的数据花园 阅读(1057) 评论(0) 推荐(0)
摘要: 我找了很多的地方,都没有找到合适的例子。最后从PostgreSQL 的代码入手,找到一些例子,于是我做了一个小练习,还不错。[作者:技术者高健@博客园 mail:luckyjackgao@gmail.com]#include "postgres.h"#include "executor/spi.h"#include "utils/builtins.h"#include "catalog/pg_type.h"#ifdef PG_MODULE_MAGICPG_MODULE_MAGIC;#endifint plantes 阅读全文
posted @ 2012-10-29 13:06 健哥的数据花园 阅读(621) 评论(0) 推荐(0)
摘要: [作者:技术者高健@博客园 mail:luckyjackgao@gmail.com]参考这个例子:http://www.postgresql.org/docs/9.1/static/spi-examples.html如果我们在 src/backend/executor/spi.c 的 SPI_finish 函数处进行调试(增加打印 SPI_finish called)可以发现,如果不在SPI 程序中调用 SPI_finish,其实会有问题。启动PostgreSQL:[root@localhost ~]# su - postgres[postgres@localhost ~]$ cd /usr/ 阅读全文
posted @ 2012-10-29 09:56 健哥的数据花园 阅读(472) 评论(0) 推荐(0)
摘要: [作者:技术者高健@博客园 mail:luckyjackgao@gmail.com]http://www.postgresql.org/docs/9.1/static/spi-examples.htmlSPI 的例子里面没有说,是如何编译和部署的,我这里补充下:编译与部署:[root@localhost soft]# export LD_LIBRARY_PATH=/usr/local/pgsql/lib[root@localhost soft]# echo $LD_LIBRARY_PATH/usr/local/pgsql/lib[root@localhost test]# cc -fpic - 阅读全文
posted @ 2012-10-29 08:33 健哥的数据花园 阅读(788) 评论(0) 推荐(0)
摘要: [作者:技术者高健@博客园 mail:luckyjackgao@gmail.com]这个也是从 oid2name 中扒出来的:[postgres@localhost bin]$ ./oid2name -d postgresFrom database "postgres":now: SELECT pg_catalog.pg_relation_filenode(c.oid) as "Filenode", relname as "Table Name" FROM pg_class c LEFT JOIN pg_catalog.pg_name 阅读全文
posted @ 2012-10-26 15:47 健哥的数据花园 阅读(12175) 评论(0) 推荐(0)
摘要: 从 oid2name的代码里扒出来的:postgres=# SELECT d.oid AS Oid,datname AS DatabaseName,spcname AS Tablespacepostgres-# FROM pg_catalog.pg_database d JOIN pg_catalog.pg_tablespace t postgres-# ON (dattablespace = t.oid) order by 2; oid | databasename | tablespace -------+--------------+------------ 12788 | p... 阅读全文
posted @ 2012-10-26 15:02 健哥的数据花园 阅读(632) 评论(0) 推荐(0)
摘要: [作者:技术者高健@博客园 mail:luckyjackgao@gmail.com]depency.h 中:/* * This enum covers all system catalogs whose OIDs can appear in * pg_depend.classId or pg_shdepend.classId. */ typedef enum ObjectCl... 阅读全文
posted @ 2012-10-26 14:24 健哥的数据花园 阅读(514) 评论(0) 推荐(0)
摘要: 代码位于src/backend/catalog/dependency.c,这里有一个 dodeletion 函数。不过这个函数是通用的。[作者:技术者高健@博客园 mail:luckyjackgao@gmail.com]/* * doDeletion: actually delete a single object */ static void doDeletion(const... 阅读全文
posted @ 2012-10-26 13:02 健哥的数据花园 阅读(309) 评论(0) 推荐(0)
上一页 1 ··· 62 63 64 65 66 67 68 69 70 ··· 104 下一页