Pending

User tests: Successful: Unsuccessful:

avatar gpongelli
gpongelli
15 Aug 2012

This driver implements inherited function from JDatabase class and add some other useful function to be able to use Joomla! on PostgreSQL database.
There is also a class that inherits from JDatabaseQuery to be able to create query object using PostgreSQL dialect.
Also added change item class for Postgresql under CMS libraries folder.
This pull include codes from platform 12.1 for JDatabaseQuery::charLength to address CMS' CASE WHEN
queries that has to be compared with 0 .

JDatabasePostgresql::getQuery has an optional second parameter to retrieve JDatabasePostgresqlQuery object, used inside JDatabasePostgresql::insertid call .

PostgreSQL's added functions:

  • getRandom, ge a random number
  • getStringPositionSQL, returns string's position inside another string
  • releaseTransactionSavepoint, release given savepoint during transaction
  • showTables, lists all table in database
  • transactionSavepoint, to create a savepoint

Overridden functions:

  • connected
  • dropTable
  • escape
  • explain
  • fetchArray
  • fetchAssoc
  • fetchObject
  • freeResult
  • getAffectedRows
  • getAlterDbCharacterSet
  • getCollation
  • getCreateDbQuery
  • getNumRows
  • getQuery
  • getTableColumns
  • getTableCreate
  • getTableKeys
  • getTableList
  • getVersion
  • hasUTF
  • insertid
  • insertObject
  • lockTable
  • query
  • queryBatch
  • renameTable
  • replacePrefix
  • select
  • setUTF
  • test
  • transactionCommit
  • transactionRollback
  • transactionStart
  • unlockTables
  • updateObject

PostgreSQL database query added functions:

  • limit, a possible replace for limit in setQuery
  • offset, a possible replace for limit in setQuery
  • forShare, lock table/row during SELECT
  • forUpdate, lock table/row during SELECT
  • noWait, no wait a locked table
  • returning, an INSERT INTO optional clause to returns last insert id
avatar gpongelli gpongelli - open - 15 Aug 2012
avatar realityking
realityking - comment - 15 Aug 2012

Ah good this resurfaces :)

3 points:
1. This doesn't merge right now
2. I don't think we need all these SQL for changes to the databases since no one will update form a Joomla 2.5 postgres installation.
3. Please submit the changes to files in libraries/joomla to the platform so they can be merged over there first.

avatar gpongelli
gpongelli - comment - 15 Aug 2012

Hi Rouven,
1. Why isn't it mergeable ?
2. You're right, these files coming from old pull request and I've leaved them because I've found same files under mysql folder.
3. There's an open pull request for platform project about these changes at least two months old.

Gabriele Pongelli

avatar realityking
realityking - comment - 15 Aug 2012

Hey Gabriele,

I don't know what the problem is, github just tells me it can't automatically be merged. Ideally you just update it to current master, since there hasn't been many commits the past two days it shouldn't be a big problem.

You probably mean this platform pull #307, don't you?

This doesn't contain the changes to JSessionStorageDatabase and JTable. Could you submit them separately?

avatar mbabker
mbabker - comment - 15 Aug 2012

The commit to make FinderIndexer abstract is the likely cause of the merge issue.

Gabrielle, I abstracted out FinderIndexer so that child classes could be built for each database driver to run the indexer in a way that is optimized for that environment. So, could you add a FinderIndexerDriverPostgresql class (you should be able to use the MySQL class as a base) and then you can modify the queries in that class to make them work best in Postgres (I have a patch doing the same for SQL Server).

avatar gpongelli
gpongelli - comment - 16 Aug 2012

@realityking
pull request is joomla/joomla-platform#1261 .
Can you write me git steps to do ?

About JSessionStorageDatabase the changes I have is about str_replace as this in read()

str_replace('\0\0\0', chr(0).'*'.chr(0), $result);

can't you see them?
Which is JTable change you're referring to?

@mbabker
I'm studying that code, I'll add Postgresql's version soon.

avatar realityking
realityking - comment - 16 Aug 2012

To rebase pull request I'd follow the github instructions, they are better explained than I could ever do. The section about "Pull in upstream changes" is what you need https://help.github.com/articles/fork-a-repo

I can see the JSessionStorageDatabase fine here but we need it in the platform as well.

Regarding JTable I mean this change: https://github.com/joomla/joomla-cms/pull/307/files#diff-48

Also please drop the extra sql files.

avatar gpongelli
gpongelli - comment - 16 Aug 2012

That is not a rebase but a merge, I hope that these steps won't break anything, I'll do them soon.

About JSessionStorageDatabase and JTable I've added new branch for platform project, but I've problems with github site so I can't actually open a new pull request.

Which sql files do you mean? all except 3.0.0.sql ?

avatar realityking
realityking - comment - 16 Aug 2012

All except joomla.sql and the sample data.

avatar gpongelli
gpongelli - comment - 17 Aug 2012

Here it is pull request for platform about JSessionStorageDatabase and JTable.

avatar gpongelli
gpongelli - comment - 17 Aug 2012

I'm merging from master branch, but I've too many conflicts on

installation/models/database.php
about a commit of one day ago .

@realityking
IMHO you should have look at my code before merge this commit that breaks installation on PostgreSQL .

avatar gpongelli
gpongelli - comment - 21 Aug 2012

Is this branch mergeable now ?

I've removed all sql files and added FinderIndexerDriverPostgresql class, not tested but commented Mysql specific queries.
Do not merge this branch now, I'm working on installation/models/database.php file yet.

avatar realityking
realityking - comment - 21 Aug 2012

Yes it is :)

avatar mbabker
mbabker - comment - 21 Aug 2012

I have PostgreSQL set up, so I can test the Finder work here. I am trying to get my SQL Server class committed too, which I believe touches some of the same queries in common areas, so we are on the right track there.

avatar dextercowley
dextercowley - comment - 6 Sep 2012

committed in master. thanks.

avatar dextercowley dextercowley - close - 6 Sep 2012

Add a Comment

Login with GitHub to post a comment