[GeoNetwork-users] gast: database setup: INSERT error

*A lot of thanks for your contribution*. I was completely lost. In fact, I had decided to back to an older version.

Best Regards,

Robert.

----- Original Message -----
From: Alain Benard
Sent: 02/23/11 04:08 PM
To: Robert Holland, Geonetwork Users
Subject: Re: [GeoNetwork-users] gast: database setup: INSERT error

Hi,
I have the same problem with gast when i want to create a *database
'Postgis'* (it's work normally for a postgresql database).
The script '*create-db-postgis.sql*' is bad and create just 2 columns in
the table Languages. The file is at
geonetworkpath/web/geonetwork/WEB-INF/classes/setup/sql/create. You must
replace the create Languages definition like this :

-- Commenté Alain Benard car manque une colonne
-- CREATE TABLE Languages
-- (
-- id varchar(5),
-- name varchar(32) not null,
--
-- primary key(id)
-- );
CREATE TABLE Languages
(
id varchar(5),
name varchar(32) not null,
isocode varchar(3) not null,

primary key(id)
);

The problem disappear but a new error message come : 'Erreur : une
valeur nulle viole la contrainte NOT NULL de la colonne "isocode"'.
The log posgresql is : INSERTION INTO Settings values (0,NULL,'root',NULL)
The INSERT line is correct but the create table is bad. In the same file
(create-db-postgis.sql ) comment just one line like below:

CREATE TABLE Settings
(
id int,
parentId int,
name varchar(32) not null,
*-- Commenté Alain Benard isocode varchar(3) not null,*

value text,

primary key(id),

foreign key(parentId) references Settings(id)
);

I think a drag and drop from the developper is the orgine from the
double problem. (just one line has been deplaced)
Sorry for My english.
*I hope developper's team will correct the source script*.
Have a nice day.
Alain.

Le 20:59, Robert Holland a écrit :
> Hi,
>
> I'm trying to install Geonetwork 2.6.3. The "Database Setup" action fails when data is being inserted. Specifically, it says that the INSERT has more expressions than target columns.
>
> I've looked at the log of the PostgreSQL database and it shows that the process fails when it launches the following sentence:
>
> INSERT INTO Languages VALUES ('en','English', 'eng')
>
> This is wrong because the table "Languages" only has two fields: "id" and "name".
>
> Any help?
>
> Regrads,
>
> Robert.
>
>

Be carfull at the software version.... in the 2.6.3 a column was added
a the table Language. In the directory "migrate" there is the script
used to change the data model.

2011/2/25 Robert Holland <robert.holland@anonymised.com>:

*A lot of thanks for your contribution*. I was completely lost. In fact, I had decided to back to an older version.

Best Regards,

Robert.

----- Original Message -----
From: Alain Benard
Sent: 02/23/11 04:08 PM
To: Robert Holland, Geonetwork Users
Subject: Re: [GeoNetwork-users] gast: database setup: INSERT error

Hi,
I have the same problem with gast when i want to create a *database
'Postgis'* (it's work normally for a postgresql database).
The script '*create-db-postgis.sql*' is bad and create just 2 columns in
the table Languages. The file is at
geonetworkpath/web/geonetwork/WEB-INF/classes/setup/sql/create. You must
replace the create Languages definition like this :

-- Commenté Alain Benard car manque une colonne
-- CREATE TABLE Languages
-- (
-- id varchar(5),
-- name varchar(32) not null,
--
-- primary key(id)
-- );
CREATE TABLE Languages
(
id varchar(5),
name varchar(32) not null,
isocode varchar(3) not null,

primary key(id)
);

The problem disappear but a new error message come : 'Erreur : une
valeur nulle viole la contrainte NOT NULL de la colonne "isocode"'.
The log posgresql is : INSERTION INTO Settings values (0,NULL,'root',NULL)
The INSERT line is correct but the create table is bad. In the same file
(create-db-postgis.sql ) comment just one line like below:

CREATE TABLE Settings
(
id int,
parentId int,
name varchar(32) not null,
*-- Commenté Alain Benard isocode varchar(3) not null,*

value text,

primary key(id),

foreign key(parentId) references Settings(id)
);

I think a drag and drop from the developper is the orgine from the
double problem. (just one line has been deplaced)
Sorry for My english.
*I hope developper's team will correct the source script*.
Have a nice day.
Alain.

Le 20:59, Robert Holland a écrit :
> Hi,
>
> I'm trying to install Geonetwork 2.6.3. The "Database Setup" action fails when data is being inserted. Specifically, it says that the INSERT has more expressions than target columns.
>
> I've looked at the log of the PostgreSQL database and it shows that the process fails when it launches the following sentence:
>
> INSERT INTO Languages VALUES ('en','English', 'eng')
>
> This is wrong because the table "Languages" only has two fields: "id" and "name".
>
> Any help?
>
> Regrads,
>
> Robert.
>
>

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

--
Ing. Francesco D'Amore
blog: www.marinajonica.org
linkedin: http://www.linkedin.com/in/francescodamore
Consiglio Nazionale delle Ricerche - Istituto di Inquinamento Atmosferico (IIA)
Ph. D. Student at University of Calabria - DEIS