Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# the official .clang-format style for https://github.com/taocpp
#
# clang-format-4.0 -i -style=file $(find -name '[^.]*.[hc]pp')

Language: Cpp
Standard: Cpp11

AccessModifierOffset: -3
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: true
AfterControlStatement: false
AfterEnum : true
AfterFunction : true
AfterNamespace : true
AfterStruct : true
AfterUnion : true
BeforeCatch : true
BeforeElse : true
IndentBraces : false
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: false
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 0
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 3
ContinuationIndentWidth: 3
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
IndentWidth: 3
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
PointerAlignment: Left
ReflowComments: false
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: Never
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: true
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpacesInParentheses: true
SpacesInSquareBrackets: true
TabWidth: 8
UseTab: Never
18 changes: 18 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Bootstrap nix-direnv (ensures specific version, robust)
if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" "sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4="
fi

# Watch flake.nix for changes to reload the environment
watch_file flake.nix

# Use the Nix flake to provide the development environment
use flake

# Set consistent locale for development environment
#export LANGUAGE=C.utf8
#export LANG=C.utf8
#export LC_ALL=C.utf8

# IKOS-specific environment variable (keep if needed for your IKOS workflow)
export IKOS_SCAN_NOTIFIER_FILES=""
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,11 @@ lib*.pc
/Release/
/tmp_install/
/portlock/

build/
install/
test-db/
.direnv/
.cache/
.history

8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

580 changes: 580 additions & 0 deletions .idea/editor.xml

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Attach Postgres",
"type": "cppdbg",
"request": "attach",
"program": "${workspaceRoot}/install/bin/postgres",
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
}
]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.associations": {
"syscache.h": "c"
}
}
18 changes: 18 additions & 0 deletions doc/src/sgml/ref/create_table.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -1997,6 +1997,24 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
</listitem>
</varlistentry>

<varlistentry id="reloption-expression-checks" xreflabel="expression_checks">
<term><literal>expression_checks</literal> (<type>boolean</type>)
<indexterm>
<primary><varname>expression_checks</varname> storage parameter</primary>
</indexterm>
</term>
<listitem>
<para>
Enables or disables evaulation of predicate expressions on partial
indexes or expressions used to define indexes during updates.
If <literal>true</literal>, then these expressions are evaluated during
updates to data within the heap relation against the old and new values
and then compared to determine if <acronym>HOT</acronym> updates are
allowable or not. The default value is <literal>true</literal>.
</para>
</listitem>
</varlistentry>

</variablelist>

</refsect2>
Expand Down
29 changes: 25 additions & 4 deletions doc/src/sgml/storage.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -1097,10 +1097,10 @@ data. Empty in ordinary tables.</entry>
<itemizedlist>
<listitem>
<para>
The update does not modify any columns referenced by the table's indexes,
not including summarizing indexes. The only summarizing index method in
the core <productname>PostgreSQL</productname> distribution is <link
linkend="brin">BRIN</link>.
The update does not modify index keys, or when using a summarized
index. The only summarizing index method in the core
<productname>PostgreSQL</productname> distribution is
<link linkend="brin">BRIN</link>.
</para>
</listitem>
<listitem>
Expand Down Expand Up @@ -1138,6 +1138,27 @@ data. Empty in ordinary tables.</entry>
</itemizedlist>
</para>

<para>
<acronym>HOT</acronym> updates can occur when the expression used to define
an index shows no changes to the indexed value. To determine this requires
that the expression be evaulated for the old and new values to be stored in
the index and then compared. This allows for <acronym>HOT</acronym> updates
when data indexed within JSONB columns is unchanged. To disable this
behavior and avoid the overhead of evaluating the expression during updates
set the <literal>expression_checks</literal> option to false for the table.
</para>

<para>
<acronym>HOT</acronym> updates can also occur when updated values are not
within the predicate of a partial index. However, <acronym>HOT</acronym>
updates are not possible when the updated value and the current value differ
with regards to the predicate. To determine this requires that the predicate
expression be evaluated for the old and new values to be stored in the index
and then compared. To disable this behavior and avoid the overhead of
evaluating the expression during updates set
the <literal>expression_checks</literal> option to false for the table.
</para>

<para>
You can increase the likelihood of sufficient page space for
<acronym>HOT</acronym> updates by decreasing a table's <link
Expand Down
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
description = "PostgreSQL development environment";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};

shellConfig = import ./shell.nix { inherit pkgs system; };

in {
devShells = {
default = shellConfig.devShell;
gcc = shellConfig.devShell;
clang = shellConfig.clangDevShell;
gcc-musl = shellConfig.muslDevShell;
clang-musl = shellConfig.clangMuslDevShell;
};

packages = {
inherit (shellConfig) gdbConfig flameGraphScript pgbenchScript;
};
}
);
}
Loading