[Devel] postgres tables example

Daniel-Constantin Mierla daniel at voice-system.ro
Thu Jun 30 15:06:47 CEST 2005


On 06/30/05 15:28, Klaus Darilion wrote:

> What about changing the existing mysqldb.sh to also support postgres?

This is also an option, but I do not know how simple it is. My 
experience with postgres is almost 0. I do not know if Ingo started to 
create the pgsql.sh.

>
> I've already started, but having some problems with different syntax 
> between mysql and postgres, e.g.
>
> datetime      --?-->  TIMESTAMP WITHOUT TIME ZONE
> timestamp(14) --?-->  TIMESTAMP
>
> also the default value must be changed as postgresql accepts only 
> correct formats:
>
> time datetime NOT NULL default '0000-00-00 00:00:00'
> --?--> '2000-01-01 00:00:01'

If there are going to be too many differences, in my opinion, will be 
better to have them separately, so someone which is very experienced 
with one of them can easily optimize the appropriate script.

>
> indexes should be no problem when defined after creating the table - 
> this works also with mysql
>
> Thus, we only need a new name for the file :-)


>
> I think updating serctl to support also postgres should be easy. The 
> only problem is that psql does not support the password as a command 
> line parameter. But >=7.3 supports storing the password in a ~/.pgpass 
> file. In think we can require having this file for postgres users.

An alternative is to use DB FIFO API 
(http://openser.org/docs/db_fifo.html) which was designed for this, but 
now needs some enhancements to be able to deal with multiple database 
drivers. Anyhow, this will happen after the FIFO interface will be 
replaced by an abstract interface; fifo server and unixsocket server 
will be moved as modules to avoid duplicate code for each external 
interface -- now each module duplicates the code of FIFO commands for 
unix sockets.

Cheers,
Daniel

>
> Comments?


>
> regards,
> klaus
>
>
> Daniel-Constantin Mierla wrote:
>
>> Hello,
>>
>> could you write a pgsqldb.sh similar to mysqldb.sh? You can 
>> eventually extract the common parts in another file and have only the 
>> differences in separate files. We can grant you cvs write access if 
>> you want to do it and maintain the scripts -- just make an account on 
>> sourceforge.net and let us know your id.
>>
>> cheers,
>> Daniel
>>
>> On 06/28/05 01:29, Ingo Wolfsberger wrote:
>>
>>> Hi
>>>
>>> I have attached "sample" tables for the postgres module.
>>> The most important tables are in it.
>>>
>>> bye,
>>>   Ingo
>>>
>>>  
>>>
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>> _______________________________________________
>>> Devel mailing list
>>> Devel at openser.org
>>> http://openser.org/cgi-bin/mailman/listinfo/devel
>>>  
>>>
>>
>> _______________________________________________
>> Devel mailing list
>> Devel at openser.org
>> http://openser.org/cgi-bin/mailman/listinfo/devel
>>
>>
>
>



More information about the Devel mailing list