| От | Michael Olivier |
|---|---|
| Тема | new.oid not working inside rule [repost] |
| Дата | |
| Msg-id | 37B4EB04.876196CE@local2me.com обсуждение исходный текст |
| Ответы |
Re: [SQL] new.oid not working inside rule [repost]
|
| Список | pgsql-sql |
I am reposting this because I haven't gotten an answer... is anyone
successfully using new.oid within a rule to store the oid of an inserted
row into another table? (See below)
This is in 6.4.2-3.
thanks,
--Michael
Michael Olivier wrote:
>
> 2. How can I get the oid of a record being inserted? Using new.oid
> isn't getting it for me... the field in my changes table remains
> blank...
>
> create rule users_add_rule as on insert to users do
> insert into changes (table_name, change_time, ref_oid, type)
> values ('users', 'now', new.oid, 'insert');
>
> Getting some other field, like new.acctname, does work...
>
> Thanks,
> Michael
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера