Lookups

Поиск
Список
Период
Сортировка
От Layton Duncan
Тема Lookups
Дата
Msg-id 4BC97EBD-1DD0-44F7-821A-BADF937C5197@rainbowprint.co.nz
обсуждение исходный текст
Ответы Re: Lookups  ("Jim C. Nasby" <jim@nasby.net>)
Список pgsql-novice
I'm new to Postgres coming from a Filemaker Pro background. I'm
looking at converting an existing database from FM to postgres.

One thing i'm not sure on, is how best to implement an equivalent of
a FileMaker auto-enter "lookup" in Postgres.

Basically, i'm wanting to set the contents of a field in one table
based on the contents of a related field in another table.

Say for example in a table "Jobs", i enter a customer id, I then want
the "customer name" field in the same table ("Jobs") to have the
appropriate name pulled from the "Customers" table, based on the
customer id. I don't want to leave this up to client processing, I
would like it done server side.

Is this done with triggers? Is there any information on writing
trigger functions in postgres "internal" language? I've found a lot
on writing trigger functions in c, but although i'm completely
competent in c, it would be nice to avoid it.

Thanks,
Layton

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

Предыдущее
От: "Wilfred Benson"
Дата:
Сообщение: Re: Subquery in INSERT?
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Lookups