? ? Pending

User tests: Successful: Unsuccessful:

avatar softarius
softarius
24 May 2019

Pull Request for Issue #24998 .

Summary of Changes

Method getTableColumns of JDatabaseDriverPostgresql class

Testing Instructions

  • install Joomla with PostgreSQL driver.
  • create a new schema (for example 'test')
  • create a new table in this schema
CREATE TABLE test.customer (
  id SERIAL,
  name VARCHAR(100),
  PRIMARY KEY(id)
) 
WITH (oids = false);
  • in code call getTableColumns for this table
$db = JFactory::getDBO();
$custfields=$db->getTableColumns('test.customer'); 

Expected result

Array with fields of a table

Actual result

Empty array

Documentation Changes Required

Added to param $table
For PostgreSQL may starting with a schema

avatar softarius softarius - open - 24 May 2019
avatar softarius softarius - change - 24 May 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 24 May 2019
Category Postgresql Libraries
avatar softarius softarius - change - 24 May 2019
Labels Added: ?
avatar richard67
richard67 - comment - 24 May 2019

@alikon Do you think this is a new feature for 4.0, or is it a bug fix for 3.9?

avatar alikon
alikon - comment - 24 May 2019

quite a greyzone it dependes on how you feel that, so up to the Production Lead

avatar richard67
richard67 - comment - 24 May 2019

@HLeithner Do you think this PR is a bug fix for 3.9 or a new feature for 4.0? From my point of view it is a bug fix since it is not good practice to use the public schema for everything in PostgreSQL, as far as I know, like it has to be without this PR. But I might be wrong, so I'd like to know your opinion, and @alikon 's, too, because he is doing much with PostgreSQL.

avatar HLeithner
HLeithner - comment - 24 May 2019

@HLeithner Do you think this PR is a bug fix for 3.9 or a new feature for 4.0? From my point of view it is a bug fix since it is not good practice to use the public schema for everything in PostgreSQL, as far as I know, like it has to be without this PR. But I might be wrong, so I'd like to know your opinion, and @alikon 's, too, because he is doing much with PostgreSQL.

It's a bugfix.

avatar alikon
alikon - comment - 24 May 2019

to me too it's a bugfix

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 24 May 2019
avatar softarius
softarius - comment - 24 May 2019

@HLeithner Do you think this PR is a bug fix for 3.9 or a new feature for 4.0? From my point of view it is a bug fix since it is not good practice to use the public schema for everything in PostgreSQL, as far as I know, like it has to be without this PR. But I might be wrong, so I'd like to know your opinion, and @alikon 's, too, because he is doing much with PostgreSQL.

My PR isn't only bug-fix. It's a feature request for a future version of Joomla.
Best practice for PostgresSQL is using different schemas for logical subsystems into a database.
Proof - https://www.postgresql.org/docs/10/ddl-schemas.html#DDL-SCHEMAS-PATTERNS
Simple RDBS (not supported schemas, such as MySQL) use surrogate solving with a prefix for tables.
When I write a new component for Joomla with PostgreSQL, I wont to use for this separate schema.
In another side, in big and complex system Joomla could use schema. called other than "public". But Joomla can't do it.
Third, with good schemas supporting Joomla could switching between schemas just different databases.

avatar HLeithner
HLeithner - comment - 24 May 2019

I'm not sure what you mean with "Simple RDBS (not supported schemas, such as MySQL)" is the schema support of MySQL different then the support form PostgresSQL?

avatar softarius
softarius - comment - 24 May 2019

I'm not sure what you mean with "Simple RDBS (not supported schemas, such as MySQL)" is the schema support of MySQL different then the support form PostgresSQL?

Using the term 'schema' completely different in other systems.
In MySQL and Firebird command CREATE SCHEMA is a synonym for CREATE DATABASE -

In more powerful RDBMS (Oracle, SQL Server, PostgreSQL ) a schema is essentially a namespace.
Proofs:

avatar HLeithner
HLeithner - comment - 24 May 2019

I'm not sure what you mean with "Simple RDBS (not supported schemas, such as MySQL)" is the schema support of MySQL different then the support form PostgresSQL?

Using the term 'schema' completely different in other systems.
In MySQL and Firebird command CREATE SCHEMA is a synonym for CREATE DATABASE -

ok thx, anyway in this case it's only a bugfix because it's should handle this and don't break.

avatar alikon
alikon - comment - 24 May 2019

I have tested this item successfully on d16b754


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24999.

avatar alikon
alikon - comment - 24 May 2019

I have tested this item successfully on d16b754


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24999.

avatar alikon alikon - test_item - 24 May 2019 - Tested successfully
avatar richard67 richard67 - change - 25 May 2019
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 25 May 2019
avatar joomla-cms-bot joomla-cms-bot - edited - 25 May 2019
avatar richard67
richard67 - comment - 25 May 2019

@softarius I've changed the "Actual result" in your testing instructions to the value from the issue. I guess that was a copy and paste thing from "Expected result", so it was the same as that, and in the issue it was correct, right?

avatar richard67
richard67 - comment - 25 May 2019

@HLeithner I can fully confirm @softarius 's explanations above.

avatar richard67
richard67 - comment - 25 May 2019

I have tested this item successfully on d16b754


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24999.

avatar richard67 richard67 - test_item - 25 May 2019 - Tested successfully
avatar alikon alikon - change - 25 May 2019
Status Pending Ready to Commit
avatar alikon
alikon - comment - 25 May 2019

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24999.

avatar alikon
alikon - comment - 25 May 2019

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24999.

avatar richard67
richard67 - comment - 25 May 2019

@alikon Have there ever been discussions in past about full db schema support in Joomla, i.e. you can specify a schema like you can specify user and database names when installing on PostgreSQL, so Joomla can be installed using a different schema than "Public"? If so, what was the result of these discussions?

avatar richard67
richard67 - comment - 25 May 2019

For the one who will merge: Drone failure is not related to this PR.

avatar softarius
softarius - comment - 25 May 2019

@softarius I've changed the "Actual result" in your testing instructions to the value from the issue. I guess that was a copy and paste thing from "Expected result", so it was the same as that, and in the issue it was correct, right?

Yes.

avatar alikon
alikon - comment - 27 May 2019

@richard67

Have there ever been discussions in past about full db schema support in Joomla

not that i'm aware of

avatar richard67
richard67 - comment - 30 May 2019

I have tested this item successfully on 3da16d1


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24999.

avatar richard67
richard67 - comment - 30 May 2019

I have tested this item successfully on 3da16d1


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24999.

avatar richard67 richard67 - test_item - 30 May 2019 - Tested successfully
avatar HLeithner HLeithner - close - 5 Jun 2019
avatar HLeithner HLeithner - merge - 5 Jun 2019
avatar HLeithner HLeithner - change - 5 Jun 2019
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-06-05 15:47:09
Closed_By HLeithner
avatar HLeithner
HLeithner - comment - 5 Jun 2019

thx

Add a Comment

Login with GitHub to post a comment