Re: Non-Stored Generated Columns

Поиск
Список
Период
Сортировка
От Ron Johnson
Тема Re: Non-Stored Generated Columns
Дата
Msg-id CANzqJaARwTp-tFPRp5HYpUZE4+OWuyLDabaq5kJXqGCQJmqRHg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Non-Stored Generated Columns  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Wed, Feb 28, 2024 at 2:11 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Dominique Devienne <ddevienne@gmail.com> writes:
> Views can have foreign-keys?

Surely you'd put the FK on the underlying table.

> Generated view columns be indexed?

You want an index on a virtual column?  Sure, just build an expression
index (on the underlying table) that matches it.

I agree with Laurenz that it's hard to see much use-case here
that's not sufficiently covered already.

Oracle and SQLite have them, so, by definition, *many* more than one person (you don't get a feature added to Oracle that easily...) has seen sufficient reasons for doing it instead of modifying the underlying table, or building an expression index.

My guess as to why they do it is "clarity of design".

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

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: Documentation diff
Следующее
От: Erik Wienhold
Дата:
Сообщение: Re: Excel Source [24]] Error: System.Exception: SqlTruncateException: Numeric arithmetic causes