?
avatar ethikrates
ethikrates
26 May 2013

Used versions:
Joomla 3.1.1, Postgresql 9.2.4, openSUSE 12.3

Trying to create an article being logged in but not as Administrator results in the following
errors in the database log:


 2013-05-26 12:25:57 CEST joomla joomla LOG:  statement: INSERT INTO "hp_content"
        ("title","alias","introtext","fulltext","catid","created","created_by","created_by_alias
","version","metakey","metadesc","access","metadata","language") VALUES 
        ('Test','test','Test Text','',82,'2013-05-26 10:25:57',1,'',1,'','',1,'{"tags":null}','*')
        RETURNING id
2013-05-26 12:25:57 CEST joomla joomla ERROR:  null value in column "images" violates not-null constraint
2013-05-26 12:25:57 CEST joomla joomla DETAIL:  Failing row contains (82, 0, Test, test, Test  Text, , 0, 82, 2013-05-26 10:25:57, 1, , 1970-01-01 00:00:00, 0, 0, 1970-01-01 00:00:00, 1970-01-01 00:00:00, 1970-01-01 00:00:00, null, null, null, 1, 0, , , 1, 0, {"tags":null}, 0, *, ).

After reading some posts it seems that MySQL has a default value "empty string" if no default is set.
To get the same behaviour in Postgresql I added default values to 3 columns of table "hp_content":

  • images
  • urls
  • attribs

via


alter  table hp_content alter column  set default '';

I propose a patch to the installation script, which I haven't tested, but it should fix it.

Kind regards
Ethikrates


--- installation/sql/postgresql/joomla.sql  2013-04-27 00:39:21.000000000 +0200
+++ installation/sql/postgresql/joomla.sql.patch    2013-05-26 16:43:06.986555341 +0200
@@ -341,9 +341,9 @@
   "checked_out_time" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL,
   "publish_up" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL,
   "publish_down" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL,
-  "images" text NOT NULL,
-  "urls" text NOT NULL,
-  "attribs" character varying(5120) NOT NULL,
+  "images" text DEFAULT '' NOT NULL,
+  "urls" text DEFAULT '' NOT NULL,
+  "attribs" character varying(5120) DEFAULT '' NOT NULL,
   "version" bigint DEFAULT 1 NOT NULL,
   "ordering" bigint DEFAULT 0 NOT NULL,
   "metakey" text NOT NULL,
avatar ethikrates ethikrates - open - 26 May 2013
avatar kwirk
kwirk - comment - 18 Aug 2013

:+1:

avatar brianteeman
brianteeman - comment - 13 Oct 2013

Thanks for your contribution - At this time we are only using github as the place to submit code fixes, the actual reporting of issues and testing fixes is still taking place on Joomlacode.

As it has been some time since you opened this issue can you please confirm that it is still valid with the current Master or Joomla 3.2 beta. If it is no longer valid then please can you close this issue. Otherwise please can you:

1) Open an item on the Joomlacode tracker in the appropriate area.

CMS Bug Reports: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemBrowse&tracker_id=8103

CMS Feature Requests: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemBrowse&tracker_id=8549

2) After submitting the item to the Joomlacode tracker, add a link to the Joomlacode tracker item here and make sure that you add a link to this GitHub issue or pull request on the joomlacode tracker item.

avatar vdespa vdespa - change - 28 Jul 2014
The description was changed
Priority Medium Low
Build 3.1.1
avatar zero-24 zero-24 - close - 25 Aug 2014
avatar brianteeman
brianteeman - comment - 25 Aug 2014

I am closing this as it has been resolved elsewhere

avatar brianteeman brianteeman - change - 25 Aug 2014
The description was changed
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-08-25 09:28:04
avatar brianteeman brianteeman - close - 25 Aug 2014
avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment