If a domain type has a default, adding a column of that type (without any explicit DEFAULT clause) failed to install the domain's default value in existing rows, instead leaving the new column null. This is unexpected, and it used to work correctly before v11. The cause is confusion in the atthasmissing mechanism about which default value to install: we'd only consider installing an explicitly-specified default, and then we'd decide that no table rewrite is needed. To fix, take the responsibility for filling attmissingval out of StoreAttrDefault, and instead put it into ATExecAddColumn's existing logic that derives the correct value to fill the new column with. Also, centralize the logic that determines the need for default-related table rewriting there, instead of spreading it over four or five places. In the back branches, we'll leave the attmissingval-filling code in StoreAttrDefault even though it's now dead, for fear that some extension may be depending on that functionality to exist there. A separate HEAD-only patch will clean up the now-useless code. Reported-by: jian he <jian.universality@gmail.com> Author: jian he <jian.universality@gmail.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CACJufxHFssPvkP1we7WMhPD_1kwgbG52o=kQgL+TnVoX5LOyCQ@mail.gmail.com Backpatch-through: 13 |
1 year ago | |
|---|---|---|
| config | jit: Remove {llvm-config,clang}-N configure probes. | 2 years ago |
| contrib | Handle default NULL insertion a little better. | 1 year ago |
| doc | Doc: Fix pg_copy_logical_replication_slot description. | 1 year ago |
| src | Fix broken handling of domains in atthasmissing logic. | 1 year ago |
| .cirrus.star | Remove duplicate words in docs and code comments. | 2 years ago |
| .cirrus.tasks.yml | meson: ci: ensure tests are built before running them | 1 year ago |
| .cirrus.yml | ci: Make compute resources for CI configurable | 3 years ago |
| .dir-locals.el | Make Emacs perl-mode indent more like perltidy. | 7 years ago |
| .editorconfig | Add .editorconfig | 6 years ago |
| .git-blame-ignore-revs |
Add commit 7229ebe011 to .git-blame-ignore-revs.
|
2 years ago |
| .gitattributes | Exclude LLVM files from whitespace checks | 1 year ago |
| .gitignore | Update top-level .gitignore. | 3 years ago |
| COPYRIGHT | Update copyright for 2025 | 1 year ago |
| GNUmakefile.in | Allow selecting the git revision to be packaged by "make dist". | 2 years ago |
| HISTORY | Canonicalize some URLs | 6 years ago |
| Makefile | Adapt REL_17_STABLE to its new status as a stable branch | 2 years ago |
| README.md | Adapt REL_17_STABLE to its new status as a stable branch | 2 years ago |
| aclocal.m4 | autoconf: Move export_dynamic determination to configure | 3 years ago |
| configure | Stamp 17.4. | 1 year ago |
| configure.ac | Stamp 17.4. | 1 year ago |
| meson.build | Make test portlock logic work with meson | 1 year ago |
| meson_options.txt | Allow selecting the git revision to be packaged by "make dist". | 2 years ago |
README.md
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/17/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/17/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.