Re: Inserting a needed record before a select

Поиск
Список
Период
Сортировка
От scott.marlowe
Тема Re: Inserting a needed record before a select
Дата
Msg-id Pine.LNX.4.33.0304141332090.18268-100000@css120.ihs.com
обсуждение исходный текст
Ответ на Re: Inserting a needed record before a select  ("Jay O'Connor" <joconnor@cybermesa.com>)
Список pgsql-general
On Mon, 14 Apr 2003, Jay O'Connor wrote:

> At 12:27 PM 04/14/2003 -0600, scott.marlowe wrote:
>
> >Crap, sorry, you're right.  You'll need to use a rule.  Rules are simpler
> >than triggers / functions.  They're described in the programmer's guide,
> >section 13 for 7.3.2.
>
> Problem is RULEs don't seem to have the sophistication I need (boolean
> logic...search for a record and if it doesn't exists, insert it, then
> re-SELECT on the same table)

I think it might be doable anyway.  Since rules allow where clauses, maybe
you could make one that had a where clause to test to see if the row
existed and if not then it calls a function to create the row.

I'm busy wrestling an import script to the ground right now, but I'll try
to see if I can make something like that work when I get a minute.


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

Предыдущее
От: Andrew Sullivan
Дата:
Сообщение: Re: Batch replication ordering (was Re: [GENERAL] 32/64-bit
Следующее
От: "Ed L."
Дата:
Сообщение: Re: Batch replication ordering (was Re: [GENERAL] 32/64-bit