[support] If you are running Drupal with Postgres as the database that you have access to less modules compared to running Drupal with MySQL as the database.

Larry Garfield larry at garfieldtech.com
Wed Apr 14 02:05:44 UTC 2010


Ah, "read on the web", that excellent source of objective, researched 
information... :-)

Drupal's database layer provides some degree of abstraction for MySQL and 
PostgreSQL.  In most cases, code that uses Drupal's database API properly will 
run just fine on both MySQL and PostgreSQL.  

The caveat is "code that uses Drupal's database API properly".  You certainly 
can write SQL statements that will only work on MySQL or only work on 
PostgreSQL, as there are syntactic differences between the two.  Mostly that 
relates to the more esoteric field types (like geographic fields) or to 
functions that are specific to one database or the other.  Alternatively, there 
are some syntactic shortcuts that MySQL allows that PostgreSQL does not, which 
many module authors may take advantage of without realizing that it breaks 
PostgreSQL support.  (The converse is also true, but there are far fewer 
PostgreSQL-native developers than there are MySQL-native developers so it is 
considerably less likely.)

If you come across such a module, the correct course of action is to file a 
(polite) bug report against the module in question.

Sadly until recently PostgreSQL did not get much attention in Drupal, and 
there are even some parts of core that do not work on it.  However, the 
database layer was totally gutted and rewritten for Drupal 7 and now has much 
more extensive support for MySQL, PostgreSQL, and SQLite.  That doesn't mean 
you can't write queries that are databse-specific, but it does mean that it's 
less likely that you'll do so inadvertently.  Core is also targeting 100% 
support for all three databases.  

--Larry Garfield

On Tuesday 13 April 2010 04:14:30 pm John Mitchell wrote:
> Conversely are their any Drupal modules that only run within Postgres
> and not within MySQL.
> 
> I thought I read that at least part of a geographic/mapping type of
> module only ran within postgres, but now I can't locate that module's
> text stating that.
> 
> John
> 
> On 4/13/10, John Mitchell <mitchelljj98 at gmail.com> wrote:
> > A co-worker informed me that he read on the web that if you are
> > running Drupal with Postgres as the database that you have access to
> > less modules compared to running Drupal with MySQL as the database.
> >
> > Any comments?
> >
> > Thanks,
> >
> > John
> >
> >
> > --
> > John J. Mitchell
> 


More information about the support mailing list