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.
Click to show internal directories.
Click to hide internal directories.