#10 PEAR::DB/postgresql support

open
nobody
None
5
2004-08-11
2004-08-11
Jer
No

Changed all mysql_* calls to PEAR::DB calls.
Changed a few mysql specific SQL functions to
generic/postgresql functions.
(CURDATE->CURRENT_DATE), (GROUP BY n ORDER BY m ->
GROUP BY n,m ORDER BY m)

Discussion

  • Jer
    Jer
    2004-08-11

    Logged In: YES
    user_id=804977

    Additional comment: UNIX_TIMESTAMP() function is not defined
    is PostgreSQL as the following:

    CREATE FUNCTION UNIX_TIMESTAMP(timestamp) RETURNS timestamp
    AS 'select $1 as timestamp;' LANGUAGE SQL;

    Insert this function into your PostgreSQL database if FOF
    complains about a missing function.

     
  • Jer
    Jer
    2004-08-11

    Logged In: YES
    user_id=804977

    Found a better UNIX_TIMESTAMP function from here:
    http://www.xach.com/aolserver/mysql-to-postgresql.html

    drop function unix_timestamp(timestamp);
    create function unix_timestamp(timestamp) returns integer as '
    select date_part(''epoch'', $1)::int4 as result
    ' language 'sql';

    Also update the patch to fix a CSS bug (added "clear:both"
    tag to "item" divs), and to fix some SQL 'backtick' bugs.

     
  • Jer
    Jer
    2004-08-11

    PEAR::DB/PostgreSQL patch v0.2