replace all occurences of "COUNT(1) filecount" with "COUNT(1) AS filecount"
another mysql specific syntax ...

CommentFileSizeAuthor
#4 filemanager_as.patch1.43 KBZed Pobre

Comments

phacka’s picture

also replace "SUM(size) size" with "SUM(size) AS size"

nellisjp’s picture

There is one more thing that needs to be 'tweaked' before the filemanager will work with Postgres. In the filemanger_add_file function, you need to change the insert statement:

INSERT INTO {file} (fid, area, directory, filename, mimetype, size, active, working, private) VALUES (%d,'%s',%d,'%s','%s',%d,'%s','%s','%s')

to this

INSERT INTO {file} (fid, area, directory, filename, mimetype, size, active, working, private) VALUES (%d,'%s',%d,'%s','%s',%d,%d,'%s',%d)

And in the function filemanager_promote_working:

UPDATE {file} SET working='%s', active='%s', size=%d WHERE fid=%d

to this

UPDATE {file} SET working='%s', active=%d, size=%d WHERE fid=%d

Postgres handles boolean values differently than MySQL, so it is necessary to cast the 'active' and 'private' values to integers instead of strings.

nellisjp’s picture

Whoops. Kings 'X'. I completely misinterpreted what was going on with those boolean values. Sure, the above 'fix' worked for me with publicly accessible files, but when I switched over to private files, all hell broke loose. My apologies.

Zed Pobre’s picture

Status: Active » Needs review
StatusFileSize
new1.43 KB

I'm attaching a patch correcting the immediately visible problems with AS being missing.

There remains a problem with private files not being copied properly.

ccourtne’s picture

Status: Needs review » Fixed

fixed the as problem... I dont' have postgres anywhere so I can't test the current module with it.

Anonymous’s picture

Status: Fixed » Closed (fixed)