PostgreSQL support in Drupal 5 and many critical third-party modules is already so pervasive, that it is quite frustrating to see small and simple modules that have this homework undone, and not even any warning about incompatibility in place.

I've attached a patch that adds PostgreSQL support to .install file and fixes the module. But the actual format selection does not seem to work – I have yet to investigate if that is due to some already-reported bug.

Comments

plj’s picture

Status: Active » Needs review

Submitted with wrong status; fixed.

dllh’s picture

Assigned: Unassigned » dllh
Status: Needs review » Fixed

I've applied your patch and committed to svn. Re postgres support, I'm sympathetic, but this was a quick itch-scratch module that I thought it'd be nice to contribute, and to be fair, it's still in dev, so lack of postgres support seems forgivable. Not an issue any more thanks to you, though.

plj’s picture

Status: Fixed » Needs review
StatusFileSize
new1.24 KB

I did not understand that this module only supports non-CCK content types until I red #172962, and this is why it never worked for me. When I finally discovered the reason, I tried with ordinary content type and found yet another PostgreSQL bug. Since dllh already committed my previous patch (thanks for that!), I'm posting a new one that fixes only this later issue. Now it really works! (Although only with non-CCK node types.)

FYI: For PostgreSQL, CONCAT is not a native function, but one added by Drupal installer to make it accept more MySQL-ish (non-ANSI SQL) syntax. It only allows concatenation of two items, so instead of CONCAT(format_id, '.', role_id), we need to write CONCAT(format_id, CONCAT('.', role_id)).

plj’s picture

StatusFileSize
new1.24 KB

There was yet a junk comment that contained an old, erroneus version of the query that was fixed in the previous patch.

New patch attached.

davidwhthomas’s picture

Thanks, this fixed the postgres error, but still, the default format is not selected, none are!

davidwhthomas’s picture

Ok, it seems the root user bypasses the default input format and none are selected when logged in as the root user.

When logged in as a regular user, the settings work.

thanks!

DT

pearcec’s picture

Status: Needs review » Reviewed & tested by the community

Works like a champ.

plj’s picture

Version: 5.x-1.x-dev » 5.x-2.1

This should be applied against HEAD. There is some offset, but it still applies.

(And default_filter needs to be branched for Drupal 6.)

davidwhthomas’s picture

Status: Reviewed & tested by the community » Needs work

Unfortunately, this doesn't work in PostgreSQL 8.3

: Query failed: ERROR: function concat(unknown, integer) does not exist LINE 1: ...t_id FROM default_filters WHERE CONCAT(format_id, CONCAT('.'... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.

It's because it's CONCAT'ing a string and an integer, they need to be of the same datatype.

However, it's not possible to cast '.' as an integer to concat with int role_id.