I've created a couple of patches for the relationship module to give it PostgreSQL compatibility, but I've stalled on an odd bug when trying to edit anything in the ontology_foaf.

The error is:

# warning: pg_query() [function.pg-query]: Query failed: ERROR: invalid input syntax for integer: "DatatypeProperty" in /www/drupal/sandbox-4.7.3/includes/database.pgsql.inc on line 84.
# user warning: query: SELECT * FROM relationship_statement WHERE (0 = 'DatatypeProperty') ORDER BY predicate, object in /www/drupal/sandbox-4.7.3/includes/database.pgsql.inc on line 103.

The patches I'm going to post in sequence here are for the 2006-09-13 version of the module:

relationship.install: updated code to write in postgresql-compatible table and index.
rdf_datastore.inc: updated quoting to work on postgresql and mysql alike.
relationship_api.inc: line 845, new condition for RLIKE on PGSQL: ~* for regexp matching.

These need testing on mysql if they're eventually included. But since this module is so unstable I'm going to leave it at this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

PMunn’s picture

FileSize
899 bytes

Here is the relationship_api.inc patch.

PMunn’s picture

FileSize
937 bytes

And here is the rdf_datastore.inc patch.

PMunn’s picture

Status: Active » Needs work

Oops, forgot to set it to status patch - code needs work.

dman’s picture

Status: Needs work » Fixed

I'll assume these work, I have no clue about POSTGRES, but it hasn't broken anything.
Was there a need for any change in the install file?

Committed into CVS. Thanks.

dman’s picture

As for the bug you mentioned - it arose because the ontology_foaf.rdf wasn't ready for prime-time.
It was just a direct dump from the original source. Got into my relationship distribution by accident when I was investigating if it could absorb outside formats (at all).

Turns out it could ALMOST do so, but the foaf syntax neglected to define a dc:identifier property for its items - and I require that. Bringing up the edit screens for those foaf items you'd see the gap. That gap could NOT be blank.

I've added another check into the relationship_get_term() function to ensure that at no time can terms float around without an ID of some sort.
In CVS now.

PMunn’s picture

FileSize
899 bytes

Ah ha I missed the .install patch. I'd generated it but forgot to post it. Here it is.

PMunn’s picture

Oops hehe the _0 told me the story. I'd posted it at the start of the issue up top already. :-D

dman’s picture

Doh.
I missed it too. there should be an icon next to downloads or something :-B
I'll pop it on now...

Anonymous’s picture

Status: Fixed » Closed (fixed)