defaults

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UsesFastPath

func UsesFastPath(ctx context.Context, conn db.DB, tableName, columnType, defaultExpr string) (bool, error)

UsesFastPath returns true if [defaultExpr] will use the fast-path optimization added in Postgres 11 to avoid taking an `ACCESS_EXCLUSIVE` lock when adding a new column with a `DEFAULT` value.

The implementation works by creating a schema-only copy of [tableName], adding a new column with a `DEFAULT` value of [defaultExpr] and checking system catalogs to see if the fast-path optimization was applied.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL