[Pgpool-hackers] First pcp command as PostgreSQL function
Tatsuo Ishii
ishii at sraoss.co.jp
Fri Apr 22 04:39:23 UTC 2011
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I forgot to add that I had to comment line 29 of my
> "/usr/local/include/pool_type.h" to be able to build the module. If I
> don't, I have the following error:
>
> In file included from /usr/local/include/pcp.h:27:0,
> from pgpool_adm.c:22:
> /usr/local/include/pool_type.h:29:20: fatal error: config.h: No such
> file or directory
>
>
> Any idea about how to fix that ?
Probably we need to have something like postgres_ext.h, which is
inteded for applications, then move neccessary declarations to the
file. I will think this more.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp
> On 31/03/2011 13:18, Jehan-Guillaume (ioguix) de Rorthais wrote:
>> Hello,
>>
>> Following our previous discussions I created a PostgreSQL contrib module
>> which brings pgpool's pcp command as function in PostgreSQL. I called it
>> pgpool_adm, any better ideas ?
>>
>> As a first step, I decided to focus on one function only: pcp_node_info.
>> I'll add other ones as soon as this one will be committable.
>>
>> INSTALL: (tested against current 9.1devel HEAD)
>>
>> $ cd $PGSRC/contrib
>> $ tar zxf pgpool_adm.tgz
>> $ cd pgpool_adm
>> $ make && sudo make install
>>
>> then:
>>
>> $ psql pgpool
>> CREATE SCHEMA pgpool;
>> CREATE EXTENSION pgpool_adm WITH SCHEMA pgpool ;
>> SELECT * FROM pgpool.pcp_node_info(0, 'localhost', 10, 9898,
>> 'pgpool_adm', 'password');
>> host | port | status | weight
>> -----------+------+---------------------------------+-------------
>> localhost | 5491 | Waiting for connection to start | 1.46602e+13
>> (1 ligne)
>>
>> If you don't want/cannot test with 9.1, just adapt and run the "CREATE
>> FUNCTION" query located in pgpool_adm/pgpool_adm--1.0.sql.
>>
>> NOTE:
>> I had to mess a bit to make the compilation work out of the box because
>> of my setup of pgpool installing stuffs in /usr/local/{lib,include}.
>> Basically editing my system ldd setup and configuring postgresql with
>> "--with-libraries" and "--with-includes". Drop me a mail if you have any
>> trouble.
>>
>> TODO:
>> * I will try to make it work with foreign server and user mappings so
>> we will not have to give all servers parameters (host, port, timeout),
>> but most importantly, not have to write in clear text authentication
>> parameters.
>> * Why do we backend_weight/RAND_MAX in the code ?
>>
>> Feedback & comments ?
>
> _______________________________________________
> Pgpool-hackers mailing list
> Pgpool-hackers at pgfoundry.org
> http://pgfoundry.org/mailman/listinfo/pgpool-hackers
>
>
> - --
> Jehan-Guillaume (ioguix) de Rorthais
> DBA
> http://www.dalibo.com
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk2UeQUACgkQXu9L1HbaT6KtyACeMN1rPUTe8orV+lvLk7jtYAy9
> pkQAniZ8oip2LgB6piIe/twTXVPmHb4b
> =SBZS
> -----END PGP SIGNATURE-----
> _______________________________________________
> Pgpool-hackers mailing list
> Pgpool-hackers at pgfoundry.org
> http://pgfoundry.org/mailman/listinfo/pgpool-hackers
More information about the Pgpool-hackers
mailing list