Re: PostgreSQL 9.6: view based on sequence

Поиск
Список
Период
Сортировка
От Vincenzo Romano
Тема Re: PostgreSQL 9.6: view based on sequence
Дата
Msg-id CAHjZ2x5R0+u2xTR_15_ii3xeheKPoYeTtVU-pTOoiXxGE+d0pg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PostgreSQL 9.6: view based on sequence  (Enrico Pirozzi <e.pirozzi@nbsgroup.it>)
Ответы Re: PostgreSQL 9.6: view based on sequence  (Enrico Pirozzi <e.pirozzi@nbsgroup.it>)
Список pgsql-general
2018-01-24 13:02 GMT+01:00 Enrico Pirozzi <e.pirozzi@nbsgroup.it>:
>
>> tmp1=# create sequence x;
>> CREATE SEQUENCE
>> Time: 69,857 ms
>> tmp1=# select * from x;
>> last_value | log_cnt | is_called
>> ------------+---------+-----------
>>           1 |       0 | f
>> (1 row)
>>
>> Maybe what you want to do is
>>
>> create view v_test_sequence as select nextval( 'test_sequence' );
>>
>> Ciao.
>
>
> Yes but this appens on a 10.x version :)
>
> Ciao
> --
>
> Enrico Pirozzi
> e.pirozzi@nbsgroup.it
>

I haven't any v9 any more in my deployments. Sorry.

What is the objective of that view?
If it's to hide the nextval() function, then the solution can be
similar to mine.
If it's to access the sequence metainfo, then maybe it'd be better to
explore the pg_catalog schema.

-- 
Vincenzo Romano - NotOrAnd.IT
Information Technologies
--
NON QVIETIS MARIBVS NAVTA PERITVS


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

Предыдущее
От: Enrico Pirozzi
Дата:
Сообщение: Re: PostgreSQL 9.6: view based on sequence
Следующее
От: Enrico Pirozzi
Дата:
Сообщение: Re: PostgreSQL 9.6: view based on sequence