Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

PostgreSQL driver for Joomla! CMS. [v2] - [DEPRECATED] #166

Closed
wants to merge 44 commits into from

5 participants

gpongelli JoaoSRaposo ruisabino Michael Babker Carlo Pires
gpongelli

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
gpongelli added some commits
gpongelli gpongelli Added PostgreSQL's sql files. ed00929
gpongelli gpongelli Added PostgreSQL as supported database. cd388bf
gpongelli gpongelli Fixed an issue on new article, publish_down field was not a timestamp
but an empty string.
efd6c4e
gpongelli gpongelli Removed old commented code block.
Replaced an INSERT IGNORE INTO query to be PostgreSQL compatible.
5aef5fb
gpongelli gpongelli Updated charLength to 12.1 platform's version to address CMS' CASE WHEN
queries.
ac0d24a
gpongelli gpongelli Added quoteName call to columns' name that have capital letter. b7942fc
gpongelli gpongelli Query fix. 28d0e82
gpongelli gpongelli Fixed CASE WHEN query, it must evaluate boolean. fa4e3ad
gpongelli gpongelli Fixed CASE WHEN comparison with null date. 58a4575
gpongelli gpongelli Fixed CASE WHEN comparison with null date. 06ffece
gpongelli gpongelli Query fix. 24fd93c
gpongelli gpongelli Fixed SELECT query using quoteName with array parameter. 567d7ef
gpongelli gpongelli Query fix. bb626ed
gpongelli gpongelli Escaping chr(0) chars from the session.
Thanks to elkuku.
cceed43
gpongelli gpongelli Query fix. 2ce3dc1
gpongelli gpongelli Added Postgresql entry. fc78d37
gpongelli gpongelli Various changes to make Joomla! installable on PostgreSQL.
Added handle section for "CREATE OR REPLACE FUNCTION", used in
PostgreSQL to create a replacement for SOUNDEX function.
ceea975
gpongelli gpongelli Fix: Table key must not "0" but "null" for insert statements.
Thanks to elkuku.
315512a
gpongelli gpongelli Update PostgreSQL changes. 6e5b461
gpongelli gpongelli Added a kind of filter to load only requested files, depending on
database subfolder, and not all present under sql/update folder.
23dacc9
gpongelli gpongelli Added Postgresql driver, query class, change item class and sql files. c202cab
gpongelli

See #84 .

gpongelli and others added some commits
gpongelli gpongelli Changed getQuery to return a JDatabasePostgresqlQuery object inside
JDatabasePostgresql::insertid call.
9fc3950
gpongelli gpongelli Replaced "left" call with "substr", supported in PostgreSQL database
older than 9.1 .
6b6d780
Carlo Pires carlopires Fixes for insertid issues with postgresql driver
Fixes to postgresql sql script
Fixes to database adapters
fbe7606
Carlo Pires carlopires Fix template adapters to work with postgresql 31f0952
Carlo Pires carlopires Fixed JDatabase::insertObject and JDatabase::updateObject to use JDat…
…abaseQuery

Revert installer adapters to use JDatabase::insertid and avoid break of compatibility with others drivers
2a94a01
Carlo Pires carlopires Fixed joomla users creation 9881248
Carlo Pires carlopires Finished users management fixes with PostgreSQL bd747b5
Carlo Pires carlopires Removed insertid calls from installer adapters to avoid pitfalls rela…
…ted to JTable::store
a97e2ff
Carlo Pires carlopires Fixed menu edition with PostgreSQL 559c69e
Carlo Pires carlopires Better fix to JDatabasePostgreSQL::getNumRows 8d6e9e1
Carlo Pires carlopires Joomla coding style applied to JDatabasePostgreSQL::insertObject a4aa9f7
gpongelli gpongelli Merge pull request #2 from carlopires/postgresql_v2
Fixes for insertid issues with postgresql driver
8e5b5eb
gpongelli gpongelli Changed explicit primary key name with more general $key to let code
be independent of future primary key's change.
b029bc2
gpongelli gpongelli Fixed charLength use to work with PostgreSQL. a4f5418
gpongelli gpongelli Added fix for older PostgreSQL version. 27d6303
gpongelli gpongelli Added three check before value storing to prevent query error. a7e43b2
gpongelli gpongelli Overloaded store function to avoid NOT NULL constraint violation. c38403f
gpongelli gpongelli Added checks on timestamp empty fields. b58f7a2
gpongelli gpongelli Removed doubled $sqlFolder . ba231c8
gpongelli gpongelli Added a comment for deprecated "imagepos" field. 49c9464
gpongelli gpongelli Changed "imagepos" lenght to avoid PostgreSQL error on not used field. 08ba302
ruisabino

Hello gpongelli,
i'm thinking in using Joomla! on PostegreSQL in my organization. And i need it because i want to use the spatial component PostGIS. Could you please tell me if the support for PostgreSQL of Joomla! is in a stable release? Or what release can i use for this matter? Otherwise I'm considering using Drupal. Could you help me on this?
Thanks in advanced,
Rui Sabino

JoaoSRaposo

Hello gpongelli,

Really nice work.
Postgres support is very important to easily integrate Joomla with other applications that are using postgres DB.

Thank you very much for you work and hope this pull request will be included in next Joomla release.

JoaoSRaposo

Hi,

I'm using your version for about two months and only recently found a bug :)

When I try to process multiple articles, for example when copying multiple articles from one category to another changing their language, I receive the following error (translated from portuguese):

The batch process failed with the following message: Failed to archive JTableAsset ::
JLIB_DATABASE_QUERY_FAILED ERROR: null value in the "rules" violates the constraint not null SQL = INSERT INTO "minonl_assets" ("name", "title" , "parent_id", "level", "lft", "RGT") VALUES ('com_content.article.98', 'Software and Human Resources Management in the Cloud', 207,4,323,324) RETURNING id

The result of this operation, is that only one article is copied and mantains de original language.

In the screencast bellow you can see it happening.

http://screencast.com/t/31QjGSCiOrxL

It's not a serious error so I can continue working with no problem, I just want to let you now ;)

Regards,

gpongelli
gpongelli
Michael Babker mbabker closed this
gpongelli gpongelli referenced this pull request in joomla/joomla-platform
Closed

Improvement for PostgreSQL database. #1460

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 25, 2012
  1. gpongelli
  2. gpongelli
  3. gpongelli
  4. gpongelli

    Removed old commented code block.

    gpongelli authored
    Replaced an INSERT IGNORE INTO query to be PostgreSQL compatible.
  5. gpongelli
  6. gpongelli
  7. gpongelli

    Query fix.

    gpongelli authored
  8. gpongelli
  9. gpongelli
  10. gpongelli
  11. gpongelli

    Query fix.

    gpongelli authored
  12. gpongelli
  13. gpongelli

    Query fix.

    gpongelli authored
  14. gpongelli

    Escaping chr(0) chars from the session.

    gpongelli authored
    Thanks to elkuku.
  15. gpongelli

    Query fix.

    gpongelli authored
  16. gpongelli

    Added Postgresql entry.

    gpongelli authored
  17. gpongelli

    Various changes to make Joomla! installable on PostgreSQL.

    gpongelli authored
    Added handle section for "CREATE OR REPLACE FUNCTION", used in
    PostgreSQL to create a replacement for SOUNDEX function.
  18. gpongelli
  19. gpongelli

    Update PostgreSQL changes.

    gpongelli authored
  20. gpongelli

    Added a kind of filter to load only requested files, depending on

    gpongelli authored
    database subfolder, and not all present under sql/update folder.
  21. gpongelli
  22. gpongelli

    Changed getQuery to return a JDatabasePostgresqlQuery object inside

    gpongelli authored
    JDatabasePostgresql::insertid call.
Commits on Mar 31, 2012
  1. gpongelli
Commits on Apr 3, 2012
  1. Carlo Pires

    Fixes for insertid issues with postgresql driver

    carlopires authored
    Fixes to postgresql sql script
    Fixes to database adapters
  2. Carlo Pires
  3. Carlo Pires

    Fixed JDatabase::insertObject and JDatabase::updateObject to use JDat…

    carlopires authored
    …abaseQuery
    
    Revert installer adapters to use JDatabase::insertid and avoid break of compatibility with others drivers
  4. Carlo Pires
Commits on Apr 4, 2012
  1. Carlo Pires
  2. Carlo Pires
  3. Carlo Pires
  4. Carlo Pires
  5. Carlo Pires
Commits on Apr 7, 2012
  1. gpongelli

    Merge pull request #2 from carlopires/postgresql_v2

    gpongelli authored
    Fixes for insertid issues with postgresql driver
  2. gpongelli

    Changed explicit primary key name with more general $key to let code

    gpongelli authored
    be independent of future primary key's change.
  3. gpongelli
Commits on Apr 11, 2012
  1. gpongelli
Commits on Apr 12, 2012
  1. gpongelli
Commits on Apr 14, 2012
  1. gpongelli
Commits on Apr 15, 2012
  1. gpongelli
Commits on Apr 17, 2012
  1. gpongelli

    Removed doubled $sqlFolder .

    gpongelli authored
Commits on Apr 22, 2012
  1. gpongelli
  2. gpongelli
Commits on Apr 27, 2012
  1. gpongelli
  2. gpongelli

    Changed getTableColumns' query, coming from last used in platform, and

    gpongelli authored
    added extra check on field's default value converting to PHP's null.
Something went wrong with that request. Please try again.