Re: [GENERAL] Thoughts on a surrogate key lookup function?

2010-11-09 Thread Merlin Moncure
On Sat, Nov 6, 2010 at 1:01 PM, Nick nboutel...@gmail.com wrote: Merlin, thanks for the reply. Yes, using email_addresses was a very silly example. Maybe the following is a better example... CREATE TABLE first_names (id INT, first_name VARCHAR); ALTER TABLE first_names ADD CONSTRAINT

[GENERAL] Thoughts on a surrogate key lookup function?

2010-11-06 Thread Nick
Are there any existing trigger functions (preferably C) that could retrieve a missing value for a compound foreign key on insert or update? If this overall sounds like a really bad idea, please let me know as well. This functionality could really speed my project up though. For example, CREATE

Re: [GENERAL] Thoughts on a surrogate key lookup function?

2010-11-06 Thread Merlin Moncure
On Fri, Nov 5, 2010 at 5:27 PM, Nick nboutel...@gmail.com wrote: Are there any existing trigger functions (preferably C) that could retrieve a missing value for a compound foreign key on insert or update? If this overall sounds like a really bad idea, please let me know as well. This

Re: [GENERAL] Thoughts on a surrogate key lookup function?

2010-11-06 Thread Nick
Merlin, thanks for the reply. Yes, using email_addresses was a very silly example. Maybe the following is a better example... CREATE TABLE first_names (id INT, first_name VARCHAR); ALTER TABLE first_names ADD CONSTRAINT first_names_pkey PRIMARY KEY (id,first_name); ALTER TABLE first_names ADD