| От | Gregory Wood |
|---|---|
| Тема | Re: Rules, views, sequences and returned values |
| Дата | |
| Msg-id | 004401c0b3a9$13ef51f0$7889ffcc@comstock.com обсуждение исходный текст |
| Ответ на | Rules, views, sequences and returned values (DaVinci <bombadil@wanadoo.es>) |
| Ответы |
Re: Re: Rules, views, sequences and returned values
|
| Список | pgsql-general |
> I have a table and want to make a view updateable with rules. Table has a
> sequence that creates default value to primary key when inserting.
>
> And now the question: Is it posible to return value of primary key from
> rule of inserting with NEW? Is that value what i would get from extern
> calling to insert, instead of OID?.
SELECT currval('seq-table-name_seq-field-name_seq');
where seq-table-name is the name of your table (not the view), and
seq-field-name is the name of the primary key.
Greg
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера