Re: Duplication error . please help.

Поиск
Список
Период
Сортировка
От Sean Davis
Тема Re: Duplication error . please help.
Дата
Msg-id fd9335d7a58dd33667af4c2ff911555e@mail.nih.gov
обсуждение исходный текст
Ответ на Duplication error . please help.  (Kumar S <ps_postgres@yahoo.com>)
Список pgsql-novice
On Mar 9, 2005, at 4:02 PM, Kumar S wrote:

> Dear group,
>
> Looking forward to get some help form experiences
> members.
>
> BEGIN TRANSACTION;
> INSERT INTO
> EXPERIMENT(study_id,genechip_id,sample_id,mat_id,hyb_id,exp_aim)VALUES(
> (SELECT
> study_id from study where study_author = 'Georgantas
> RW 3rd and Civin CI'),(SELECT genechip_id from
> genechip where genechip_array = 'U133B'),(SELECT
> sample_id FROM sample WHERE sample_name ='Human stem
> cells'),(SELECT mat_id FROM material_manip where
> mat_treatment_type = 'ES H1-1a'),(select hyb_id from
> experiment where exp_id =
> (currval('experiment_exp_id_seq'))),'In this
> experiment ES H1-1a sample was used test on U133B chip
> ');
> INSERT INTO
> PLATFORM(platform_filename,platform_file_loc,exp_id)VALUES('RGeo-
> ESHSC-H1ES-1a-U133B','\/home\/database\/bob\/data\/es\/RGeo-ESHSC-
> H1ES-1a-U133\/RGeo-ESHSC-H1ES-1a-
> U133B',(currval('experiment_exp_id_seq')));
>

Looks like RGeo-EHHSC.... might already be in PLATFORM?  Do you have a
unique or primary key on platform_filename to make sure that you never
have more than 1, if you are expecting them to be unique?
> I get the following error, when I execute.
> BEGIN
> INSERT 132600251 1
> INSERT 132600252 1
> psql:/home/database/bob/dbsqls/torun/ESHSC-H1ES/test.sql:6:
> ERROR:  more than one row returned by a subquery used
> as an expression

Looks like RGeo-EHHSC... might already be in PLATFORM as a
platform_filename, causing 2 records to be returned by the above
subquery?  Do you have a unique or primary key on platform_filename to
make sure that you never have more than 1, if you are expecting them to
be unique?

> psql:/home/database/bob/dbsqls/torun/ESHSC-H1ES/test.sql:8:
> ERROR:  current transaction is aborted, commands
> ignored until end of transaction block
> psql:/home/database/bob/dbsqls/torun/ESHSC-H1ES/test.sql:10:
> ERROR:  current transaction is aborted, commands
> ignored until end of transaction block
> psql:/home/database/bob/dbsqls/torun/ESHSC-H1ES/test.sql:12:
> ERROR:  current transaction is aborted, commands
> ignored until end of transaction block


В списке pgsql-novice по дате отправления:

Предыдущее
От: Kumar S
Дата:
Сообщение: Duplication error . please help.
Следующее
От:
Дата:
Сообщение: Re: Getting started - Interfacing questions