Re: [GENERAL] Inserting rows containing composite foreign keys

2013-11-26 Thread Nelson Green
> To: pgsql-general@postgresql.org > Date: Tue, 26 Nov 2013 08:15:45 +0100 > > Nelson Green, 25.11.2013 23:01: > > Hello, > > When inserting a record into the jobs table that references projects by > > name, do I have to query the projects table twice, > > once to get the funding source number,

Re: [GENERAL] Inserting rows containing composite foreign keys

2013-11-25 Thread Thomas Kellerer
Nelson Green, 25.11.2013 23:01: > Hello, > When inserting a record into the jobs table that references projects by name, > do I have to query the projects table twice, > once to get the funding source number, and once to get the project sequence > number, even though both results will > return

[GENERAL] Inserting rows containing composite foreign keys

2013-11-25 Thread Nelson Green
Hello, I have a question regarding inserting a row into a child table when the PK of the parent table is a composite key. In this case, I have funding sources that buy projects, and projects generate jobs. Project numbers are not universally unique, but are unique to funding source. Therefore