Skip site navigation (1) Skip section navigation (2)

Re: Foreign key error, please help.

From: Kumar S <ps_postgres(at)yahoo(dot)com>
To: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Foreign key error, please help.
Date: 2005-03-09 14:46:45
Message-ID: (view raw or whole thread)
Lists: pgsql-novice
Hi Stephan,
Thank you very much, it was my stupid mistake.

One more question. aplogies if this is also not so
worthy question.
In a transaction does currval work only if a previous
statement defines it.  In my case I wanted to get FK
from existing currval in sample table (sample_id).
when I execute my statements in a transasction, I get
the following error. Do I have to just use a SELECT
statement here, because currval is not working? Or did
i made a mistake instead?

Thank you. 

My statement:

bob=> \i /home/torun/ESHSC-H1ES/test.sql
psql:/home//torun/ESHSC-H1ES/test.sql:2: ERROR: 
currval of sequence "sample_sample_id_seq" is not yet
defined in this session
bob=> rollback

--- Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
> On Tue, 8 Mar 2005, Kumar S wrote:
> >
> > (currval('experiment_exp_id_seq')),(SELECT
> > platform_id from platform where platform_filename
> =
> > 'RGeo-ESHSC-H1ES1-1a-U133A'),(SELECT seq_anno_id
> > sequence_annotation, genechip WHERE
> > sequence_annotation.seq_probeset_id =
> > 'AFFX-r2-Ec-bioB-M_at'AND
> > sequence_annotation.genechip_id =
> genechip.genechip_id
> > AND genechip.genechip_array =
> > 'U133A'),'AFFX-r2-Ec-bioB-M_at',6.419,0.1671675);
> It looks to me like the select platform_id subselect
> is in the column
> position for seq_anno_id not the select seq_anno_id
> subselect which
> doesn't seem to be what's intended.
> ---------------------------(end of
> broadcast)---------------------------
> TIP 8: explain analyze is your friend

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 


pgsql-novice by date

Next:From: Keith WorthingtonDate: 2005-03-09 15:20:30
Subject: When are trigger function results committed
Previous:From: John DeSoiDate: 2005-03-09 13:58:31
Subject: Re: QT3 Designer Pgadmin III and PgAccess Cannot connect to PostgreSQL 7.4 database

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group