PostgreSQL support in update scripts

Narno - April 16, 2008 - 18:44
Project:FeedAPI
Version:5.x-1.2
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

Update #9

* Failed: ALTER TABLE {feedapi} ADD skip SMALLINT NOT NULL DEFAULT '0'
* Failed: CREATE INDEX {feedapi}_skip_idx ON {feedapi} (skip)

Update #10

* Failed: ALTER TABLE {feedapi} ALTER COLUMN url TYPE text, ALTER COLUMN link TYPE text

#1

mustafau - April 16, 2008 - 19:30

I did not tested following codes. Just copied and pasted from system.install file.

<?php
$ret
[] = update_sql("ALTER TABLE {feedapi} ADD skip SMALLINT NOT NULL DEFAULT '0'");
?>

can be implemented as

<?php
db_add_column
($ret, 'feedapi', 'skip', 'smallint', array('not null' => TRUE, 'default' => 0));
?>

and

<?php
$ret
[] = update_sql("ALTER TABLE {feedapi}
        ALTER COLUMN url TYPE text,
        ALTER COLUMN link TYPE text"
);
?>

can be implemented as

<?php
db_change_column
($ret, 'feedapi', 'url', 'url', 'text', array('default' => "", 'not null' => TRUE));
db_change_column($ret, 'feedapi', 'link', 'link', 'text', array('default' => "", 'not null' => TRUE));
?>

#2

mustafau - April 16, 2008 - 19:32
Status:active» patch (code needs work)

#3

Aron Novak - April 29, 2008 - 17:18

Well, what is the version of the postgresql that you use?
I tested all of my install scripts with this:

[aaron@vonat ~]$ psql --version
psql (PostgreSQL) 8.2.7

I read at the http://drupal.org/requirements page that i should rely on "PostgreSQL 7.4 or higher".

#4

Narno - April 29, 2008 - 18:17

I use PostgreSQL 7.4.16 :-)

#5

Aron Novak - May 3, 2008 - 16:37
Status:patch (code needs work)» fixed

Narno:
I committed what mustafau suggested. Please try it out and if you still experience nonsense, please reopen the ticket.

#6

Anonymous (not verified) - May 17, 2008 - 16:41
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.