Difference between revisions of "DPL:Manual - DPL with PostgreSQL"

From FollowTheScore
Jump to: navigation, search
(New DLP patch)
(DPL Patches)
 
(3 intermediate revisions by the same user not shown)
Line 31: Line 31:
 
   end;
 
   end;
 
$function$ language plpgsql immutable strict;
 
$function$ language plpgsql immutable strict;
</pre>
 
  
 +
create or replace function mysql.ifnull(text, text) returns text
 +
as $function$
 +
    select coalesce($1, $2) as result
 +
$function$ language 'sql';</pre>
  
== DPL Patch ==
+
==DPL Patches==
  
DLP uses (at least at version 1.7.5) a LIMIT syntax that is not suitable for PostgreSQL and leads to SQL errors. In the corresponding [[Issue:Issue:Crash_on_Postgres-based_Mediawiki_(patch_included)|bug report]], a small patch is posted that solves this issue.
+
DPL uses (at least at version 1.7.5) a LIMIT syntax that is not suitable for PostgreSQL and leads to SQL errors. In the corresponding [[Issue:Issue:Crash_on_Postgres-based_Mediawiki_(patch_included)|bug report]], a small patch is posted that solves this issue.
 +
 
 +
DPL uses parentheses around JOIN tables that is not suitable for PostgreSQL and leads to SQL errors.  In the corresponding [[Issue:Crash on ordermethod=category,sortkey on PostgreSQL-based Mediawiki (patch included)|bug report]], a small patch is posted that solves this issue.

Latest revision as of 14:45, 19 January 2011

Manual PostgreSQL

Database Functions

The code of this extenstion uses some MySQL-specific functions which don't exist in PostgreSQL. In order to avoid patching each new version of DyanmicPageList, I suggest to run the following script on your postgres Database (from the postgres account). This simply emulates the MySQL functions.

create schema mysql;

grant usage on schema mysql to public;

alter user wikiuser set search_path to mediawiki, public, mysql;

create or replace function mysql.concat(text, text) returns text
as $function$
  begin
    return $1 || $2;
  end;
$function$ language plpgsql immutable strict;

create or replace function mysql.if(boolean, text, text) returns text
as $function$
  begin
    if $1 then
      return $2;
    else
      return $3;
    end if;
  end;
$function$ language plpgsql immutable strict;

create or replace function mysql.ifnull(text, text) returns text
as $function$
    select coalesce($1, $2) as result
$function$ language 'sql';

DPL Patches

DPL uses (at least at version 1.7.5) a LIMIT syntax that is not suitable for PostgreSQL and leads to SQL errors. In the corresponding bug report, a small patch is posted that solves this issue.

DPL uses parentheses around JOIN tables that is not suitable for PostgreSQL and leads to SQL errors. In the corresponding bug report, a small patch is posted that solves this issue.