From: | Sean Davis <sdavis2(at)mail(dot)nih(dot)gov> |
---|---|
To: | Kumar S <ps_postgres(at)yahoo(dot)com> |
Cc: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: Please help |
Date: | 2005-03-01 17:55:55 |
Message-ID: | b2698efa97ef532a28e7ea925ccd44e4@mail.nih.gov |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
On Mar 1, 2005, at 12:32 PM, Kumar S wrote:
> Hello all,
>
>
> I have a table and it has is like this:
> exp_id
> exp_name
> exp_type
> exp_desc
> exp_pmid
> exp_paper
> exp_author
> genechip_id
> exp_rawdata_link
> con_id
> Indexes:
> "experiment_pkey" primary key, btree (exp_id)
> Foreign-key constraints:
> "$1" FOREIGN KEY (genechip_id) REFERENCES
> genechip_array(genechip_id)
> "$2" FOREIGN KEY (con_id) REFERENCES
> contacts(con_id)
>
>
> Based on the data I have information that should fill
> in this column U133A.
>
> What I have in the genechip_array table is
>
> genechip_id | fc_genechip_array |gc_spec
> --+----------------------+------------------
>
> 5 | Human Genome U133A Array | Homo sapiens
>
>
> Now how can I bring in the foreign key 5 to my
> previous table. All I have is U133A.
>
> Could any one help me in this.
>
Postgresql doesn't do this automatically. A foreign key only functions
as a link between tables after it is formed. You must supply the link
in the first place by a lookup in the foreign table either in the
client or as part of a function to load the data. You aren't going to
have many genechip_ids, so you could easily just append a column full
of "5" to the incoming data for each of those tables if you want a
quick and easy solution.
Sean
From | Date | Subject | |
---|---|---|---|
Next Message | Kumar S | 2005-03-01 18:03:33 | Re: Please help |
Previous Message | Kumar S | 2005-03-01 17:32:53 | Please help |