BUG #19019: Feature Request: allow the use of column reference in DEFAULT expression
От | PG Bug reporting form |
---|---|
Тема | BUG #19019: Feature Request: allow the use of column reference in DEFAULT expression |
Дата | |
Msg-id | 19019-962b23dc13723881@postgresql.org обсуждение исходный текст |
Ответы |
Re: BUG #19019: Feature Request: allow the use of column reference in DEFAULT expression
Re: BUG #19019: Feature Request: allow the use of column reference in DEFAULT expression |
Список | pgsql-bugs |
The following bug has been logged on the website: Bug reference: 19019 Logged by: Paolo Saggese Email address: spam@bit.bucket PostgreSQL version: Unsupported/Unknown Operating system: Any Description: As it is possible in some other SQL RDBMS, it would be useful to allow the use of column reference in DEFAULT expression. That is, for example: CREATE TABLE my_table ( my_column my_type NOT NULL DEFAULT ( my_expression ), -- some other columns, constraints, etc... ) where "my_expression" uses values from some other column(s) of (the same row of) the same table and may be allow (also) for even more generic references to any other column of any table in the DB (in which case "my_expression" would be a query returning a single value compatible with "my_type"...). A possible equivalent alternative syntax would be e.g.: GENERATED BY DEFAULT AS ( my_expression ) (where "STORED" would be obviously implied...). Note that the (existing) syntax: GENERATED ALWAYS AS ( my_expression ) STORED obviously is not equivalent and does not provide the desired behavior (as of course in such case the column would be read-only and would not allow to replace the generated value with something else).
В списке pgsql-bugs по дате отправления: