Native PostgreSQL support

According to 1.0 release notes, ejabberd supports PostgreSQL natively. How do you configure it? Configuration example contains only ODBC example, but native support means that I do not have to use ODBC for PostgreSQL connection - am I correct? Can anyone post a configuration example, please?

Regards,
Tomaso

Preliminary instructions

It seems the documentation does not cover this yet, and the example config does not include any example.

Preliminary instructions to use PostgreSQL native support:

  1. Install the library: PGSQL
  2. Create the database
  3. Import the file ejabberd/src/pg.sql to the new database
  4. Configure ejabberd to use this method. On ejabberd.cfg
    {auth_method, odbc}.
    {odbc_server, {pgsql, Server, Database, Username, Password}}.

    Example values:

    {odbc_server, {pgsql, "localhost", "erlang_example", "cos", ""}}.
  5. Start ejabberd on interactive mode (removing Erlang options such as -detached) and call manually the functions exported by the module ejd2odbc to generate SQL formatted dump files.

Note that even if the configuration seems to use ODBC, ejabberd uses in fact the pgsql library, with no ODBC involved.

I'll ask if this is the correct method. Maybe somebody is able to write a nice tutorial.

Re: Preliminary instructions

badlop wrote:

I'll ask if this is the correct method. Maybe somebody is able to write a nice tutorial.

Mickaël said he has very detailed documentation for ODBC and PostgreSQL.

Yes. I have started writing

Yes. I have started writing an ODBC document. Not yet ready however, but I will publish it soon.

--
Mickaël Rémond

ODBC Docs

How far are you? Is it possible to post what you have done so far?

postgre document

Waiting for postgre document. thanks a lot

Failed to compile PGSQL library

Retrieved the PGSQL code from the sourceforge CVS server and tried to compile it.
---------------------------------------------------
[186] root@lilo:~/tmp/jungerl/lib/pgsql# make
(cd src;make)
"Makefile", line 1: Could not find ../../../support/include.mk
make: fatal errors encountered -- cannot continue
*** Error code 1

Stop in /root/tmp/jungerl/lib/pgsql.
---------------------------------------------------
Looks like the include.mk file is missing. There is a include.mk.in file. I renamed the file to include.mk, but it still wouldn't compile.

---------------------------------------------------
[211] root@lilo:~/tmp/jungerl/lib/pgsql# make
(cd src;make)
"../../../support/include.mk", line 25: Need an operator
"../../../support/include.mk", line 27: Need an operator
"../../../support/include.mk", line 29: Need an operator
"../../../support/include.mk", line 31: Need an operator
make: fatal errors encountered -- cannot continue
*** Error code 1

Stop in /root/tmp/jungerl/lib/pgsql.
---------------------------------------------------

What am I missing? It would be much appreciated if someone could please nudge me in the right direction.

Jungerl build chain is not

Jungerl build chain is not intended to be issued at the library level but for the whole Jungerl compilation.

You could simply type erlc *.erl in the jungerl pgsql library.

--
Mickaël Rémond

Syndicate content