Although installing Drupal with PostgreSQL is rather straight forward, there are a few stumbling blocks (needing to load a language into the database and not using the public schema, as well as there being zero instructions):

I have added instructions to INSTALL.txt on how to load up the SQL scheme into PostgreSQL, and I have edited database/database.pgsql so that it is easy to install drupal into any schema. As a result, users can now for example install Drupal into database drupal, schema drupal (with the functions in public). This means they could use different modules for different schemas if they wanted to.

The instructions include:

  • Creating a database with createdb
  • Loading up plpgsql language with createlang
  • Inserting all the SQL data into the schema of choice
  • Changing $db_prefix to reflect the schema
  • Support from Acquia helps fund testing for Drupal Acquia logo

    Comments

    Smirnov’s picture

    FileSize
    588 bytes

    Attached the database/database.pgsql patch

    Smirnov’s picture

    Version: 4.6.0 »
    FileSize
    4.48 KB

    Updated INSTALL.txt against HEAD, also made it so the instructions pertain to installing to the "public" schema by default (and left a notice on there for people to edit database.pgsql if they need to do otherwise). The previous patches can now be safely ignored (esp. since they were for 4.6.1).

    Cvbge’s picture

    I like the patch, but IMO it needs to wait till http://drupal.org/node/26091 gets in

    Cvbge’s picture

    Attached patch splits INSTALL.txt into INSTALL.txt, INSTALL.mysql.txt and INSTALL.pgsql.txt
    INSTALL.pgsql.txt is written from scratch.

    Cvbge’s picture

    Version: » 4.6.3

    It's for 4.6 (cause there'll be new 4.6 soon) and it probably needs to be applied with -p1 or something, as it's made with normal diff from outside of drupal dir (it adds new files so it can't be done with cvs diff)

    Cvbge’s picture

    Component: postgresql database » database system
    Status: Needs review » Reviewed & tested by the community
    Morbus Iff’s picture

    Status: Reviewed & tested by the community » Needs work

    Comments/revision forthcoming.

    Morbus Iff’s picture

    * Needs CVS header version macro thing.

    * Needs contents block for the pgsql file.

    * instructions are too dissimilar. why "drupal" for the database
    name in mysql.txt, but databasename for PostgreSQL? And why do we
    use BOTH "databasename" AND "drupal_db" in the text for pgsql?

    * don't use stuff like "I assume". We don't have a similar statement in the
    MySQL file, and it doesn't belong here either. Second, it's not *you*
    talking to the user, it's the entire Drupal developer team talking
    to the user. Never use first person (not in an install.txt at least).

    * Try try to make the same "mental" decisions that MySQL does. We don't
    caution the user in MySQL.txt "not to run steps 1 through 3 if you
    already have a MySQL database", because most users don't need to be
    told that - they will know if they have one or not.

    * "Please note, that Drupal needs PL/pgSQL procedural language
    installed in your database." I have no clue what that means.
    Replace with something like "Please note that the PHP bindings for
    PostgreSQL must be enabled for Drupal to operate properly."
    (Actually, in reading further through the instructions, I'd remove
    this comment entirely: you instruct users how to do it in step 3, right?)

    * Some lines are longer than 80 characters. These need to be brought
    down to 78 characters or less.

    * "For example on default Debian installation you must be logged
    in as "postgres" system." NEVER include information such as this.
    For one, it'll go outta date faster than milk. Secondly, people will
    mentally skip right over "Debian" ("well, BSD is kinda like Debian
    right? It's gotta be the same, right?"), and thirdly, it sets a dangerous
    precedent of including tons of distro-specific support in the INSTALLs.

    * "your local PostgreSQL guru." Don't say this either. This reads like
    "well, shit, we're not gonna help you if you've screwed up. We've
    washed our hands of you." This is *our* software. The Drupal developers
    have decided that we know enough about PostgreSQL to ship code that
    runs with it. Whether we are, or not, *WE* are the user's gurus.

    Cvbge’s picture

    Thanks for your suggestions. I've changed the files the best I could (kudos to webchick and bertboerland for help with english).

    I've wrapped long lines, except for error quotes, which should stay unchanged IMO.

    But I disagree on this:

    * "your local PostgreSQL guru." Don't say this either. This reads like
    "well, shit, we're not gonna help you if you've screwed up. We've
    washed our hands of you." This is *our* software.

    No, PostgreSQL is not *our* software. Creating database user, the database, loading the scheme has nothing to do with Drupal.
    I've removed references to "local gurus" or outside documentation, but I think they should be there. Maybe reworded, but still.

    Cvbge’s picture

    Status: Needs work » Needs review

    Setting to "needs review"

    Cvbge’s picture

    Previous patch was reversed

    Cvbge’s picture

    Status: Needs review » Reviewed & tested by the community
    FileSize
    12.82 KB

    Morbus fixed the files (thanks :)).
    Attached patch should be applied with -p1, e.g. patch -p1 < the_patch.diff

    This patch allows us to close http://drupal.org/node/29324

    Cvbge’s picture

    Err. Last patch had INSTALL.txt diffied against cvs not 4.6

    Dries’s picture

    Status: Reviewed & tested by the community » Needs review

    Morbus, are you 100% happy with the latest patch?
    Waiting for Morbus' blessing.

    Morbus Iff’s picture

    Yah. The latest patch is my own, really, just generated by Cvbge. My understanding is that this will be for both 4.6 and CVS.

    Morbus Iff’s picture

    Status: Needs review » Reviewed & tested by the community
    Cvbge’s picture

    Updated patch - adds "and" in one line and changes "example.dom" to "example.com".

    Yes, this patch is currently for 4.6, but will be for 4.7 too, just needs some small changes.

    Morbus Iff’s picture

    Ayup. Good by me.

    Dries’s picture

    Committed to HEAD. Won't commit it to DRUPAL-4-6 because PostgreSQL support is somewhat broken anyway.

    Dries’s picture

    Status: Reviewed & tested by the community » Needs work

    Not marking this fixed, because it needs minor changes as pointed out by Cvbge.
    If you really want me to commit this to DRUPAL-4-6, let me know.

    Cvbge’s picture

    Status: Needs work » Reviewed & tested by the community
    FileSize
    2.43 KB

    Hmm not really really...

    Anyway, here's a patch for HEAD:
    - a change to settings.php: use "databasename" istead of "database" in $db_url for consistency with install.txt
    - removed PL/pgSQL related documentation, recent patch removed dependency on it
    - createdb creates database with unicode encoding

    Morbus Iff’s picture

    Looks good to me.

    Cvbge’s picture

    Version: 4.6.3 » x.y.z
    Assigned: Unassigned »

    Changing version to cvs

    Dries’s picture

    Status: Reviewed & tested by the community » Fixed

    Committed to HEAD. Thanks.

    Anonymous’s picture

    Status: Fixed » Closed (fixed)