| От | Richard Huxton |
|---|---|
| Тема | Re: Rule/sequence weirdness |
| Дата | |
| Msg-id | 413588B2.6070708@archonet.com обсуждение исходный текст |
| Ответ на | Rule/sequence weirdness (Steve Crawford <scrawford@pinpointresearch.com>) |
| Список | pgsql-general |
Steve Crawford wrote:
>
> I want to monitor inserts to table "foo":
> guid: integer not null default nextval('public.guid'::text)
> end_time: integer
[snip]
> I expected the guid to match. Unfortunately there are no matching
> guids between the two tables. It appears that the sequence is being
> called twice so the guid in the log table is one greater than the
> guid in the main table.
>
> Did I miss something in my rule logic or is this a bug?
Rules are simply macros, so you are right and the sequence will be
accessed twice. You'll want to look at triggers.
--
Richard Huxton
Archonet Ltd
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера