@crvouga/postgres-mem 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +159 -0
- package/COMPATIBILITY-AUDIT.md +155 -0
- package/COMPATIBILITY.md +87 -0
- package/LICENSE +21 -0
- package/README.md +325 -0
- package/compat/coverage.json +1081 -0
- package/compat/divergences.json +191 -0
- package/compat/gate-report.json +80 -0
- package/compat/requirements.json +1105 -0
- package/compat/requirements.raw.html +484 -0
- package/compat/scenario-types.ts +98 -0
- package/compat/scenarios.ts +98 -0
- package/compat/sections/agg.ts +45 -0
- package/compat/sections/api.ts +28 -0
- package/compat/sections/arr.ts +45 -0
- package/compat/sections/cat.ts +47 -0
- package/compat/sections/con.ts +32 -0
- package/compat/sections/cpy.ts +24 -0
- package/compat/sections/cte.ts +29 -0
- package/compat/sections/dat.ts +60 -0
- package/compat/sections/ddl.ts +55 -0
- package/compat/sections/det.ts +20 -0
- package/compat/sections/dml.ts +37 -0
- package/compat/sections/eco.ts +16 -0
- package/compat/sections/err.ts +16 -0
- package/compat/sections/exp.ts +53 -0
- package/compat/sections/fun.ts +58 -0
- package/compat/sections/fzz.ts +36 -0
- package/compat/sections/guc.ts +27 -0
- package/compat/sections/joi.ts +33 -0
- package/compat/sections/jsn.ts +46 -0
- package/compat/sections/lim.ts +13 -0
- package/compat/sections/par.ts +61 -0
- package/compat/sections/pre.ts +26 -0
- package/compat/sections/sch.ts +31 -0
- package/compat/sections/sel.ts +43 -0
- package/compat/sections/seq.ts +31 -0
- package/compat/sections/snp.ts +21 -0
- package/compat/sections/tok.ts +53 -0
- package/compat/sections/trg.ts +57 -0
- package/compat/sections/tsr.ts +37 -0
- package/compat/sections/txn.ts +39 -0
- package/compat/sections/typ.ts +55 -0
- package/compat/sections/uni.ts +13 -0
- package/compat/sections/win.ts +43 -0
- package/compat/smoke-baseline.json +3 -0
- package/compat/unsupported-register.json +2526 -0
- package/dist/api/bind.d.ts +10 -0
- package/dist/api/database.d.ts +69 -0
- package/dist/api/statement.d.ts +51 -0
- package/dist/ast/nodes.d.ts +810 -0
- package/dist/constraints/enforce.d.ts +39 -0
- package/dist/errors/error.d.ts +24 -0
- package/dist/executor/ddl.d.ts +23 -0
- package/dist/executor/dml.d.ts +10 -0
- package/dist/executor/execute.d.ts +11 -0
- package/dist/executor/relation.d.ts +60 -0
- package/dist/executor/select.d.ts +41 -0
- package/dist/executor/session.d.ts +21 -0
- package/dist/executor/triggers-exec.d.ts +1 -0
- package/dist/executor/triggers.d.ts +16 -0
- package/dist/executor/window.d.ts +13 -0
- package/dist/expressions/context.d.ts +23 -0
- package/dist/expressions/eval.d.ts +38 -0
- package/dist/expressions/operators.d.ts +8 -0
- package/dist/expressions/pattern.d.ts +20 -0
- package/dist/functions/aggregates.d.ts +17 -0
- package/dist/functions/array-fns.d.ts +2 -0
- package/dist/functions/datetime-fns.d.ts +26 -0
- package/dist/functions/datetime-registry.d.ts +2 -0
- package/dist/functions/json-fns.d.ts +7 -0
- package/dist/functions/math-fns.d.ts +2 -0
- package/dist/functions/misc-fns.d.ts +8 -0
- package/dist/functions/scalar.d.ts +10 -0
- package/dist/functions/srf.d.ts +12 -0
- package/dist/functions/string-fns.d.ts +4 -0
- package/dist/functions/tsearch-fns.d.ts +2 -0
- package/dist/functions/util.d.ts +14 -0
- package/dist/functions/window.d.ts +7 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +19591 -0
- package/dist/index.js.map +7 -0
- package/dist/lexer/tokenize.d.ts +8 -0
- package/dist/parser/index.d.ts +1 -0
- package/dist/parser/parser.d.ts +96 -0
- package/dist/runtime/clock.d.ts +14 -0
- package/dist/runtime/index.d.ts +3 -0
- package/dist/runtime/options.d.ts +25 -0
- package/dist/runtime/prng.d.ts +48 -0
- package/dist/schema/catalog-tables.d.ts +1 -0
- package/dist/schema/catalog.d.ts +12 -0
- package/dist/serialization/codec.d.ts +29 -0
- package/dist/serialization/index.d.ts +1 -0
- package/dist/storage/database-state.d.ts +216 -0
- package/dist/transactions/manager.d.ts +25 -0
- package/dist/tsearch/stem.d.ts +5 -0
- package/dist/tsearch/tsearch.d.ts +59 -0
- package/dist/types/cast.d.ts +26 -0
- package/dist/types/compare.d.ts +18 -0
- package/dist/types/datetime.d.ts +68 -0
- package/dist/types/jsonb.d.ts +45 -0
- package/dist/types/numeric.d.ts +69 -0
- package/dist/types/resolve.d.ts +15 -0
- package/dist/types/timezone.d.ts +9 -0
- package/dist/types/value.d.ts +99 -0
- package/dist/unstable.d.ts +15 -0
- package/dist/unstable.js +19153 -0
- package/dist/unstable.js.map +7 -0
- package/package.json +120 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type CatalogSection, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
export const ERR_SECTION: CatalogSection = section("ERR", "Error parity", true, [
|
|
4
|
+
["syn-01", "42601 syntax error category"],
|
|
5
|
+
["tab-01", "42P01 undefined table"],
|
|
6
|
+
["col-01", "42703 undefined column"],
|
|
7
|
+
["fn-01", "42883 undefined function"],
|
|
8
|
+
["div-01", "22012 division by zero"],
|
|
9
|
+
["text-01", "22P02 invalid text representation"],
|
|
10
|
+
["uniq-01", "23505 unique violation"],
|
|
11
|
+
["null-01", "23502 not-null violation"],
|
|
12
|
+
["check-01", "23514 check violation"],
|
|
13
|
+
["range-01", "22003 numeric value out of range"],
|
|
14
|
+
["state-01", "a failed statement leaves the session usable"],
|
|
15
|
+
["state-02", "a constraint failure leaves the table writable"],
|
|
16
|
+
]);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type CatalogSection, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
const D = "documented_divergence" as const;
|
|
4
|
+
|
|
5
|
+
export const EXP_SECTION: CatalogSection = section("EXP", "Expressions & operators", true, [
|
|
6
|
+
["arith-01", "Integer division truncates toward zero"],
|
|
7
|
+
["arith-02", "Modulo sign follows dividend"],
|
|
8
|
+
["arith-03", "Integer division by zero errors"],
|
|
9
|
+
["arith-04", "Modulo by zero errors"],
|
|
10
|
+
["arith-05", "Numeric division by zero errors"],
|
|
11
|
+
["arith-06", "Arithmetic across mixed types"],
|
|
12
|
+
["arith-07", "Exponentiation operator ^"],
|
|
13
|
+
["concat-01", "|| with NULL yields NULL"],
|
|
14
|
+
["concat-02", "|| with non-text operands"],
|
|
15
|
+
["concat-03", "integer || integer errors"],
|
|
16
|
+
["null-01", "Comparisons with NULL yield NULL"],
|
|
17
|
+
["dist-01", "IS DISTINCT FROM / IS NOT DISTINCT FROM"],
|
|
18
|
+
["between-01", "BETWEEN and BETWEEN SYMMETRIC"],
|
|
19
|
+
["between-02", "BETWEEN with NULL bounds"],
|
|
20
|
+
["in-01", "IN lists with NULL"],
|
|
21
|
+
["in-02", "IN subquery with NULL rows"],
|
|
22
|
+
[
|
|
23
|
+
"in-03",
|
|
24
|
+
"Row-value IN subquery",
|
|
25
|
+
D,
|
|
26
|
+
"memory rejects multi-column row-value IN (SELECT ...) with 'subquery has too many columns'; PostgreSQL evaluates it",
|
|
27
|
+
undefined,
|
|
28
|
+
"row-value-subquery-arity",
|
|
29
|
+
],
|
|
30
|
+
["case-01", "CASE with NULL condition takes ELSE"],
|
|
31
|
+
["case-02", "CASE evaluates branches lazily"],
|
|
32
|
+
["cond-01", "COALESCE"],
|
|
33
|
+
["cond-02", "NULLIF"],
|
|
34
|
+
["cond-03", "GREATEST and LEAST ignore NULLs"],
|
|
35
|
+
["bool-01", "Three-valued AND/OR/NOT"],
|
|
36
|
+
["bool-02", "IS TRUE / IS FALSE / IS UNKNOWN"],
|
|
37
|
+
["like-01", "LIKE case sensitivity vs ILIKE"],
|
|
38
|
+
["like-02", "LIKE ESCAPE and default backslash escape"],
|
|
39
|
+
["like-03", "LIKE with NULL operands"],
|
|
40
|
+
["similar-01", "SIMILAR TO patterns"],
|
|
41
|
+
["regex-01", "POSIX regex ~ ~* !~ !~*"],
|
|
42
|
+
["regex-02", "Regex classes and word boundaries"],
|
|
43
|
+
["regex-03", "Invalid regex errors"],
|
|
44
|
+
["arrsub-01", "Array subscripting and out-of-bounds NULL"],
|
|
45
|
+
["arrsub-02", "Array slices and matrix subscripts"],
|
|
46
|
+
["scalar-01", "Scalar subquery with zero rows is NULL"],
|
|
47
|
+
["scalar-02", "Scalar subquery with many rows errors"],
|
|
48
|
+
["cmp-01", "Text comparison ordering"],
|
|
49
|
+
["cmp-02", "Cross-width numeric equality"],
|
|
50
|
+
["unary-01", "Unary plus and minus"],
|
|
51
|
+
["bit-01", "Bitwise operators on integers"],
|
|
52
|
+
["any-01", "ANY and ALL over arrays"],
|
|
53
|
+
]);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type CatalogSection, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
const D = "documented_divergence" as const;
|
|
4
|
+
|
|
5
|
+
export const FUN_SECTION: CatalogSection = section("FUN", "Built-in scalar functions", true, [
|
|
6
|
+
["length-01", "length/char_length/octet_length/bit_length"],
|
|
7
|
+
["case-01", "upper/lower/initcap"],
|
|
8
|
+
["substr-01", "substr and substring forms"],
|
|
9
|
+
["substr-02", "Negative substring length errors"],
|
|
10
|
+
["trim-01", "trim/ltrim/rtrim/btrim with custom sets"],
|
|
11
|
+
["pad-01", "lpad/rpad including truncation"],
|
|
12
|
+
["replace-01", "replace and translate"],
|
|
13
|
+
["split-01", "split_part including negative index"],
|
|
14
|
+
["strpos-01", "strpos and position"],
|
|
15
|
+
["leftright-01", "left/right including negative counts"],
|
|
16
|
+
["repeat-01", "repeat and reverse"],
|
|
17
|
+
["format-01", "format %s %I %L, positional and NULL args"],
|
|
18
|
+
["concat-01", "concat and concat_ws NULL handling"],
|
|
19
|
+
["regexp-01", "regexp_replace flags and backreferences"],
|
|
20
|
+
["regexp-02", "regexp_matches as scalar"],
|
|
21
|
+
["regexp-03", "regexp_split_to_array"],
|
|
22
|
+
["regexp-04", "regexp_count/regexp_like/regexp_substr"],
|
|
23
|
+
["abs-01", "abs across types"],
|
|
24
|
+
["ceil-01", "ceil/ceiling/floor"],
|
|
25
|
+
["round-01", "round numeric including 2-arg and ties"],
|
|
26
|
+
[
|
|
27
|
+
"round-02",
|
|
28
|
+
"round float8 ties",
|
|
29
|
+
D,
|
|
30
|
+
"memory rounds float8 ties away from zero (round(2.5::float8) = 3); PostgreSQL rounds half to even (= 2)",
|
|
31
|
+
undefined,
|
|
32
|
+
"round-half-away-from-zero",
|
|
33
|
+
],
|
|
34
|
+
["trunc-01", "trunc 1-arg and 2-arg"],
|
|
35
|
+
["sign-01", "sign across types"],
|
|
36
|
+
["moddiv-01", "mod and div sign rules"],
|
|
37
|
+
["exp-01", "exp on float8 and numeric"],
|
|
38
|
+
["ln-01", "ln on float8 and numeric"],
|
|
39
|
+
["ln-02", "ln of negative errors"],
|
|
40
|
+
["log-01", "log/log10 and 2-arg log"],
|
|
41
|
+
["sqrt-01", "sqrt/cbrt on float8 and numeric"],
|
|
42
|
+
["sqrt-02", "sqrt of negative errors"],
|
|
43
|
+
["power-01", "power on float8 and numeric"],
|
|
44
|
+
["trig-01", "Trigonometric functions"],
|
|
45
|
+
["trig-02", "asin out of range errors"],
|
|
46
|
+
["trig-03", "Degree-based trig sind/cosd/tand"],
|
|
47
|
+
["pi-01", "pi/degrees/radians"],
|
|
48
|
+
["wb-01", "width_bucket including out-of-range inputs"],
|
|
49
|
+
["tochar-01", "to_char numeric templates"],
|
|
50
|
+
["tochar-02", "to_char sign and FM modifiers"],
|
|
51
|
+
["md5-01", "md5"],
|
|
52
|
+
["encode-01", "encode hex/base64/escape"],
|
|
53
|
+
["decode-01", "decode hex and base64"],
|
|
54
|
+
["decode-02", "decode invalid hex errors"],
|
|
55
|
+
["gcd-01", "gcd and lcm"],
|
|
56
|
+
["fact-01", "factorial"],
|
|
57
|
+
["nulls-01", "num_nonnulls and num_nulls"],
|
|
58
|
+
]);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type CatalogSection, type ScenarioRow, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
const F = "fuzz" as const;
|
|
4
|
+
const P = "property" as const;
|
|
5
|
+
|
|
6
|
+
const rows: ScenarioRow[] = [
|
|
7
|
+
["diff-01", "grammar-based differential fuzz", F, undefined, ["tests/fuzz/differential.test.ts"]],
|
|
8
|
+
["expr-01", "expression/predicate fuzz", F, undefined, ["tests/fuzz/expressions.test.ts"]],
|
|
9
|
+
["bind-01", "bind-vs-literal and cast fuzz", F, undefined, ["tests/fuzz/typing-binds.test.ts"]],
|
|
10
|
+
["like-01", "LIKE/ILIKE and string-function fuzz", F, undefined, ["tests/fuzz/strings-like.test.ts"]],
|
|
11
|
+
["date-01", "datetime arithmetic fuzz", F, undefined, ["tests/fuzz/datetime.test.ts"]],
|
|
12
|
+
["jsn-01", "jsonb and array operator fuzz", F, undefined, ["tests/fuzz/json-arrays.test.ts"]],
|
|
13
|
+
["dml-01", "DML sequence fuzz with state compare", F, undefined, ["tests/fuzz/dml.test.ts"]],
|
|
14
|
+
["up-01", "ON CONFLICT upsert fuzz", F, undefined, ["tests/fuzz/upsert.test.ts"]],
|
|
15
|
+
["con-01", "constraint violation outcome fuzz", F, undefined, ["tests/fuzz/constraints.test.ts"]],
|
|
16
|
+
["fk-01", "FK action fuzz (CASCADE/SET NULL/NO ACTION)", F, undefined, ["tests/fuzz/foreign-keys.test.ts"]],
|
|
17
|
+
["join-01", "join-type and predicate fuzz", F, undefined, ["tests/fuzz/joins.test.ts"]],
|
|
18
|
+
["agg-01", "GROUP BY/HAVING/FILTER aggregate fuzz", F, undefined, ["tests/fuzz/aggregates.test.ts"]],
|
|
19
|
+
["sub-01", "subquery and IN-with-NULL fuzz", F, undefined, ["tests/fuzz/subqueries.test.ts"]],
|
|
20
|
+
["win-01", "window frame fuzz", F, undefined, ["tests/fuzz/windows.test.ts"]],
|
|
21
|
+
["cte-01", "CTE chain and recursion fuzz", F, undefined, ["tests/fuzz/cte.test.ts"]],
|
|
22
|
+
["txn-01", "transaction/savepoint sequence fuzz", F, undefined, ["tests/fuzz/transactions.test.ts"]],
|
|
23
|
+
["seq-01", "sequence and serial counter fuzz", F, undefined, ["tests/fuzz/sequences-counters.test.ts"]],
|
|
24
|
+
["tlp-01", "ternary logic partitioning metamorphic", F, undefined, ["tests/fuzz/metamorphic/tlp.test.ts"]],
|
|
25
|
+
["norec-01", "NoREC metamorphic rewrite", F, undefined, ["tests/fuzz/metamorphic/norec.test.ts"]],
|
|
26
|
+
["comb-01", "feature combination fuzz", F, undefined, ["tests/fuzz/combinations.test.ts"]],
|
|
27
|
+
["dst-01", "stateful DST dump-after-each engine", F, undefined, ["tests/fuzz/stateful.test.ts"]],
|
|
28
|
+
["mix-01", "mixed DDL/DML stateful simulation", F, undefined, ["tests/fuzz/mixed-stateful.test.ts"]],
|
|
29
|
+
["robust-01", "PostgresError-only / snapshot bit-flip robustness", F, undefined, ["tests/fuzz/robustness.test.ts"]],
|
|
30
|
+
["corpus-01", "corpus regression replay", F, undefined, ["tests/fuzz/corpus.test.ts"]],
|
|
31
|
+
["seed-01", "default seed 0x5a17e0e1", P, undefined, ["tests/fuzz/config.ts"]],
|
|
32
|
+
["replay-01", "POSTGRES_MEM_FUZZ_SEED / PATH replay", P, undefined, ["tests/fuzz/config.ts"]],
|
|
33
|
+
["min-01", "DST minimizer and repro script", P, undefined, ["tests/fuzz/dst/minimize.ts"]],
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
export const FZZ_SECTION: CatalogSection = section("FZZ", "Differential fuzz & property harness", true, rows);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type CatalogSection, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
export const GUC_SECTION: CatalogSection = section("GUC", "SET / SHOW session settings", true, [
|
|
4
|
+
["set-01", "SET and SHOW application_name"],
|
|
5
|
+
["set-02", "SET application_name TO form"],
|
|
6
|
+
["set-03", "later SET overwrites the earlier value"],
|
|
7
|
+
["reset-01", "RESET returns to the default"],
|
|
8
|
+
["reset-02", "SET TO DEFAULT behaves like RESET"],
|
|
9
|
+
["reset-03", "RESET ALL restores defaults"],
|
|
10
|
+
["local-01", "SET LOCAL reverts after COMMIT"],
|
|
11
|
+
["local-02", "SET LOCAL reverts after ROLLBACK"],
|
|
12
|
+
["local-03", "SET LOCAL outside a transaction has no lasting effect"],
|
|
13
|
+
["txn-01", "SET inside a rolled-back transaction reverts"],
|
|
14
|
+
["txn-02", "SET inside a committed transaction persists"],
|
|
15
|
+
["fn-01", "set_config sets a GUC and returns the new value"],
|
|
16
|
+
["fn-02", "current_setting reads a value set by SET"],
|
|
17
|
+
["fn-03", "current_setting missing_ok true returns NULL for unknown GUC"],
|
|
18
|
+
["fn-04", "current_setting missing_ok false works for known GUCs"],
|
|
19
|
+
["custom-01", "set_config on a custom two-part GUC name"],
|
|
20
|
+
["custom-02", "custom GUC readable with missing_ok before and after set"],
|
|
21
|
+
["path-01", "search_path readable through current_setting"],
|
|
22
|
+
["tz-01", "SET timezone changes timestamptz rendering"],
|
|
23
|
+
["tz-02", "SHOW timezone echoes the setting"],
|
|
24
|
+
["ver-01", "SHOW server_version matches the oracle"],
|
|
25
|
+
["err-01", "current_setting of an unknown GUC fails with 42704"],
|
|
26
|
+
["err-02", "SHOW of an unknown GUC fails with 42704"],
|
|
27
|
+
]);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type CatalogSection, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
export const JOI_SECTION: CatalogSection = section("JOI", "Joins & lateral", true, [
|
|
4
|
+
["inner-01", "INNER JOIN ON equality"],
|
|
5
|
+
["inner-02", "join on expression"],
|
|
6
|
+
["comma-01", "implicit comma join with WHERE"],
|
|
7
|
+
["cross-01", "CROSS JOIN"],
|
|
8
|
+
["left-01", "LEFT JOIN NULL padding"],
|
|
9
|
+
["left-02", "extra filter in ON keeps unmatched left rows"],
|
|
10
|
+
["left-03", "filter in WHERE turns LEFT JOIN into inner"],
|
|
11
|
+
["right-01", "RIGHT JOIN NULL padding"],
|
|
12
|
+
["full-01", "FULL JOIN pads both sides"],
|
|
13
|
+
["using-01", "USING dedups join column in star"],
|
|
14
|
+
["using-02", "qualified and bare join column after USING"],
|
|
15
|
+
["natural-01", "NATURAL JOIN on common columns"],
|
|
16
|
+
["natural-02", "NATURAL LEFT JOIN"],
|
|
17
|
+
["natural-03", "NATURAL join with no common columns is a cross product"],
|
|
18
|
+
["chain-01", "three-table join chain"],
|
|
19
|
+
["paren-01", "parenthesized join tree"],
|
|
20
|
+
["self-01", "self-join with aliases"],
|
|
21
|
+
["mixed-01", "mixed INNER and LEFT joins"],
|
|
22
|
+
["lat-01", "LATERAL generate_series"],
|
|
23
|
+
["lat-02", "LATERAL unnest of an array column"],
|
|
24
|
+
["lat-03", "LATERAL correlated subquery with LIMIT"],
|
|
25
|
+
["lat-04", "LEFT JOIN LATERAL ON true keeps unmatched rows"],
|
|
26
|
+
["semi-01", "semi-join via EXISTS"],
|
|
27
|
+
["anti-01", "anti-join via NOT EXISTS"],
|
|
28
|
+
["multi-01", "three-plus-table join with aggregate"],
|
|
29
|
+
["expr-01", "join on range condition"],
|
|
30
|
+
["outer-01", "aggregate over outer-join NULL padding"],
|
|
31
|
+
["err-01", "ambiguous column in join errors"],
|
|
32
|
+
["err-02", "USING column missing from one side errors"],
|
|
33
|
+
]);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type CatalogSection, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
export const JSN_SECTION: CatalogSection = section("JSN", "JSON & JSONB", true, [
|
|
4
|
+
["rt-01", "jsonb canonicalizes key order"],
|
|
5
|
+
["rt-02", "jsonb deduplicates keys keeping the last"],
|
|
6
|
+
["rt-03", "json preserves order duplicates whitespace"],
|
|
7
|
+
["rt-04", "jsonb::text round trip"],
|
|
8
|
+
["rt-05", "jsonb number canonicalization"],
|
|
9
|
+
["rt-06", "json <-> jsonb conversions"],
|
|
10
|
+
["rt-07", "jsonb scalars and json null vs SQL NULL"],
|
|
11
|
+
["rt-08", "nested structures and unicode escapes"],
|
|
12
|
+
["rt-09", "jsonb column round trips through storage"],
|
|
13
|
+
["op-01", "-> field and array index access"],
|
|
14
|
+
["op-02", "->> text access and negative index"],
|
|
15
|
+
["op-03", "missing key or index yields NULL"],
|
|
16
|
+
["op-04", "#> and #>> nested path access"],
|
|
17
|
+
["op-05", "@> containment object array nested"],
|
|
18
|
+
["op-06", "<@ contained by"],
|
|
19
|
+
["op-07", "? ?| ?& existence operators"],
|
|
20
|
+
["op-08", "|| concatenation of objects arrays scalars"],
|
|
21
|
+
["op-09", "- deletion by key index and key array"],
|
|
22
|
+
["op-10", "#- nested path deletion"],
|
|
23
|
+
["eq-01", "jsonb equality is structural"],
|
|
24
|
+
["fn-01", "jsonb_set replace add nested and array index"],
|
|
25
|
+
["fn-02", "jsonb_insert at array positions"],
|
|
26
|
+
["fn-03", "strip_nulls for json and jsonb"],
|
|
27
|
+
["fn-04", "jsonb_pretty formatting"],
|
|
28
|
+
["fn-05", "typeof for json and jsonb kinds"],
|
|
29
|
+
["fn-06", "array_length for json and jsonb"],
|
|
30
|
+
["fn-07", "jsonb_object_keys"],
|
|
31
|
+
["fn-08", "each and each_text set-returning"],
|
|
32
|
+
["fn-09", "array_elements and _text with ordinality"],
|
|
33
|
+
["fn-10", "extract_path and extract_path_text"],
|
|
34
|
+
["fn-11", "build_object and build_array json and jsonb"],
|
|
35
|
+
["fn-12", "jsonb_object from a text array"],
|
|
36
|
+
["fn-13", "to_json to_jsonb row_to_json"],
|
|
37
|
+
["cast-01", "jsonb scalar casts to int and boolean"],
|
|
38
|
+
["agg-01", "json_agg and jsonb_agg ordered"],
|
|
39
|
+
["agg-02", "json_object_agg and jsonb_object_agg"],
|
|
40
|
+
["agg-03", "json aggregates over empty input are NULL"],
|
|
41
|
+
["where-01", "containment filters rows in WHERE"],
|
|
42
|
+
["err-01", "invalid json text errors"],
|
|
43
|
+
["err-02", "trailing garbage after valid json errors"],
|
|
44
|
+
["err-03", "jsonb_array_length on an object errors"],
|
|
45
|
+
["err-04", "empty string is not valid json"],
|
|
46
|
+
]);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type CatalogSection, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
export const LIM_SECTION: CatalogSection = section("LIM", "Limits & pathological inputs", true, [
|
|
4
|
+
["depth-01", "deeply parenthesized expression"],
|
|
5
|
+
["cmpd-01", "many UNION ALL terms"],
|
|
6
|
+
["cols-01", "many columns per table"],
|
|
7
|
+
["vals-01", "many VALUES rows"],
|
|
8
|
+
["in-01", "large IN list"],
|
|
9
|
+
["ident-01", "long identifiers"],
|
|
10
|
+
["zero-01", "empty table and empty-string key"],
|
|
11
|
+
["zero-02", "SELECT with no FROM"],
|
|
12
|
+
["null-01", "all-NULL rows through aggregates"],
|
|
13
|
+
]);
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type CatalogSection, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
const D = "documented_divergence" as const;
|
|
4
|
+
|
|
5
|
+
export const PAR_SECTION: CatalogSection = section("PAR", "Parser & grammar", true, [
|
|
6
|
+
["prec-01", "Exponentiation associativity and unary minus"],
|
|
7
|
+
["prec-02", "OR binds looser than AND"],
|
|
8
|
+
["prec-03", "NOT binds looser than comparison"],
|
|
9
|
+
["prec-04", "IS NULL binds looser than +"],
|
|
10
|
+
["prec-05", "BETWEEN binds looser than +"],
|
|
11
|
+
["prec-06", ":: binds tighter than unary minus"],
|
|
12
|
+
["prec-07", "^ with negative exponent"],
|
|
13
|
+
["case-01", "Simple CASE expression"],
|
|
14
|
+
["case-02", "Searched CASE expression"],
|
|
15
|
+
["case-03", "CASE without ELSE yields NULL"],
|
|
16
|
+
["row-01", "Row constructor equality"],
|
|
17
|
+
["row-02", "Row constructor ordering"],
|
|
18
|
+
[
|
|
19
|
+
"row-03",
|
|
20
|
+
"Row constructor size mismatch",
|
|
21
|
+
D,
|
|
22
|
+
"memory raises 21000 cardinality at execution; PostgreSQL raises 42601 syntax at parse time",
|
|
23
|
+
undefined,
|
|
24
|
+
"row-value-subquery-arity",
|
|
25
|
+
],
|
|
26
|
+
["arr-01", "ARRAY[...] constructor"],
|
|
27
|
+
["arr-02", "Nested ARRAY constructor"],
|
|
28
|
+
["arr-03", "ARRAY element type mismatch errors"],
|
|
29
|
+
["cast-01", "CAST(x AS t) equals x::t"],
|
|
30
|
+
["fetch-01", "FETCH FIRST n ROWS ONLY"],
|
|
31
|
+
["fetch-02", "OFFSET with FETCH NEXT"],
|
|
32
|
+
["fetch-03", "FETCH FIRST WITH TIES"],
|
|
33
|
+
["limit-01", "LIMIT and OFFSET"],
|
|
34
|
+
["sub-01", "Parenthesized subquery in FROM"],
|
|
35
|
+
["exists-01", "EXISTS and NOT EXISTS"],
|
|
36
|
+
["in-01", "IN and NOT IN value lists"],
|
|
37
|
+
["multi-01", "Multi-statement exec script"],
|
|
38
|
+
["syntax-01", "Unknown leading keyword errors"],
|
|
39
|
+
["syntax-02", "Unbalanced parentheses error"],
|
|
40
|
+
["syntax-03", "Dangling comma in select list errors"],
|
|
41
|
+
["values-01", "Standalone VALUES statement"],
|
|
42
|
+
["values-02", "VALUES as table expression with aliases"],
|
|
43
|
+
["distinct-01", "SELECT DISTINCT"],
|
|
44
|
+
["ord-01", "ORDER BY with NULLS FIRST/LAST"],
|
|
45
|
+
["grp-01", "GROUP BY with HAVING"],
|
|
46
|
+
["alias-01", "Optional AS in aliases"],
|
|
47
|
+
["typedlit-01", "Typed literals date and timestamp"],
|
|
48
|
+
["typedlit-02", "INTERVAL literal forms"],
|
|
49
|
+
["typedlit-03", "Invalid typed literal errors"],
|
|
50
|
+
["param-01", "Positional $n parameters"],
|
|
51
|
+
["depth-01", "Deeply nested parentheses"],
|
|
52
|
+
["reserved-01", "Reserved words misused as identifiers error"],
|
|
53
|
+
[
|
|
54
|
+
"neg-01",
|
|
55
|
+
"Nested unary minus on numeric literals",
|
|
56
|
+
D,
|
|
57
|
+
"memory folds repeated unary minus into the literal text and rejects it; PostgreSQL evaluates - -5 to 5",
|
|
58
|
+
undefined,
|
|
59
|
+
"unary-minus-folding",
|
|
60
|
+
],
|
|
61
|
+
]);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type CatalogSection, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
export const PRE_SECTION: CatalogSection = section("PRE", "PREPARE / EXECUTE / DEALLOCATE", true, [
|
|
4
|
+
["prep-01", "PREPARE with a typed parameter"],
|
|
5
|
+
["prep-02", "PREPARE without declared types infers from usage"],
|
|
6
|
+
["prep-03", "PREPARE with multiple typed parameters"],
|
|
7
|
+
["prep-04", "text parameter concatenation"],
|
|
8
|
+
["exec-01", "EXECUTE runs multiple times"],
|
|
9
|
+
["exec-02", "prepared SELECT over a table"],
|
|
10
|
+
["exec-03", "prepared statement sees rows inserted after PREPARE"],
|
|
11
|
+
["dml-01", "prepared INSERT writes rows"],
|
|
12
|
+
["dml-02", "prepared UPDATE and DELETE"],
|
|
13
|
+
["txn-01", "EXECUTE inside a transaction commits"],
|
|
14
|
+
["txn-02", "EXECUTE rolled back with the transaction"],
|
|
15
|
+
["dealloc-01", "DEALLOCATE removes the prepared statement"],
|
|
16
|
+
["dealloc-02", "re-PREPARE after DEALLOCATE with a new definition"],
|
|
17
|
+
["dealloc-03", "DEALLOCATE PREPARE keyword form"],
|
|
18
|
+
["dealloc-04", "DEALLOCATE ALL removes every prepared statement"],
|
|
19
|
+
["err-01", "EXECUTE with too few arguments fails"],
|
|
20
|
+
["err-02", "EXECUTE with too many arguments fails"],
|
|
21
|
+
["err-03", "re-PREPARE of the same name fails with 42P05"],
|
|
22
|
+
["err-04", "EXECUTE of an unknown prepared statement fails"],
|
|
23
|
+
["err-05", "DEALLOCATE of an unknown prepared statement fails"],
|
|
24
|
+
["err-06", "EXECUTE argument that cannot convert fails with 22P02"],
|
|
25
|
+
["drop-01", "EXECUTE fails after the referenced table is dropped"],
|
|
26
|
+
]);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type CatalogSection, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
export const SCH_SECTION: CatalogSection = section("SCH", "Schemas and search_path", true, [
|
|
4
|
+
["create-01", "CREATE SCHEMA and a table inside it"],
|
|
5
|
+
["create-02", "CREATE SCHEMA IF NOT EXISTS is idempotent"],
|
|
6
|
+
["create-03", "schema appears in pg_namespace"],
|
|
7
|
+
["qual-01", "schema-qualified insert, update, select"],
|
|
8
|
+
["qual-02", "schema-qualified delete"],
|
|
9
|
+
["dup-01", "same table name in two schemas holds separate data"],
|
|
10
|
+
["join-01", "join across schemas"],
|
|
11
|
+
["seq-01", "sequence inside a schema"],
|
|
12
|
+
["view-01", "view inside a schema"],
|
|
13
|
+
["fk-01", "cross-schema foreign key enforced"],
|
|
14
|
+
["drop-01", "DROP SCHEMA removes an empty schema"],
|
|
15
|
+
["drop-02", "DROP SCHEMA without CASCADE fails when non-empty"],
|
|
16
|
+
["drop-03", "DROP SCHEMA CASCADE removes contained tables"],
|
|
17
|
+
["drop-04", "DROP SCHEMA CASCADE removes sequences and views"],
|
|
18
|
+
["drop-05", "DROP SCHEMA IF EXISTS on a missing schema is a no-op"],
|
|
19
|
+
["drop-06", "dropping one schema leaves the same-named table elsewhere"],
|
|
20
|
+
["path-01", "search_path picks the first schema containing the table"],
|
|
21
|
+
["path-02", "resolution falls through schemas missing the table"],
|
|
22
|
+
["path-03", "CREATE TABLE goes to the first schema on the search_path"],
|
|
23
|
+
["path-04", "current_schema reflects the first search_path entry"],
|
|
24
|
+
["path-05", "qualified names bypass the search_path"],
|
|
25
|
+
["path-06", "current_schemas lists the effective path"],
|
|
26
|
+
["cat-01", "pg_catalog builtins visible regardless of search_path"],
|
|
27
|
+
["cat-02", "pg_catalog tables visible regardless of search_path"],
|
|
28
|
+
["alter-01", "ALTER TABLE SET SCHEMA moves the table"],
|
|
29
|
+
["err-01", "CREATE TABLE in a missing schema fails with 3F000"],
|
|
30
|
+
["err-02", "duplicate schema fails with 42P06"],
|
|
31
|
+
]);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type CatalogSection, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
export const SEL_SECTION: CatalogSection = section("SEL", "SELECT surface", true, [
|
|
4
|
+
["proj-01", "star projection"],
|
|
5
|
+
["proj-02", "qualified t.* projection"],
|
|
6
|
+
["alias-01", "output alias usable in ORDER BY"],
|
|
7
|
+
["alias-02", "output alias usable in GROUP BY"],
|
|
8
|
+
["alias-03", "output alias not visible in WHERE"],
|
|
9
|
+
["dist-01", "DISTINCT dedups rows and NULLs"],
|
|
10
|
+
["diston-01", "DISTINCT ON picks first row per group"],
|
|
11
|
+
["diston-02", "DISTINCT ON with multiple expressions"],
|
|
12
|
+
["order-01", "ORDER BY mixed ASC and DESC"],
|
|
13
|
+
["order-02", "ORDER BY NULLS FIRST and NULLS LAST"],
|
|
14
|
+
["order-03", "ORDER BY expression"],
|
|
15
|
+
["order-04", "ORDER BY ordinal position"],
|
|
16
|
+
["order-05", "ORDER BY ordinal out of range errors"],
|
|
17
|
+
["limit-01", "LIMIT with OFFSET"],
|
|
18
|
+
["fetch-01", "OFFSET n ROWS FETCH NEXT n ROWS ONLY"],
|
|
19
|
+
["fetch-02", "FETCH FIRST n ROWS WITH TIES"],
|
|
20
|
+
["set-01", "UNION dedups across branches"],
|
|
21
|
+
["set-02", "UNION ALL keeps duplicates"],
|
|
22
|
+
["set-03", "INTERSECT"],
|
|
23
|
+
["set-04", "EXCEPT"],
|
|
24
|
+
["set-05", "set-op numeric type resolution"],
|
|
25
|
+
["set-06", "ORDER BY and LIMIT apply to whole compound"],
|
|
26
|
+
["set-07", "set-op column count mismatch errors"],
|
|
27
|
+
["values-01", "VALUES as a FROM table with aliases"],
|
|
28
|
+
["group-01", "GROUP BY expression"],
|
|
29
|
+
["group-02", "GROUP BY with HAVING"],
|
|
30
|
+
["group-03", "GROUPING SETS"],
|
|
31
|
+
["group-04", "ROLLUP"],
|
|
32
|
+
["group-05", "CUBE with grouping()"],
|
|
33
|
+
["having-01", "HAVING without GROUP BY"],
|
|
34
|
+
["sub-01", "scalar subquery in select list"],
|
|
35
|
+
["sub-02", "IN subquery"],
|
|
36
|
+
["sub-03", "correlated EXISTS subquery"],
|
|
37
|
+
["sub-04", "ANY and ALL subquery comparisons"],
|
|
38
|
+
["row-01", "row-value comparisons"],
|
|
39
|
+
["row-02", "row-value filter on table columns"],
|
|
40
|
+
["case-01", "CASE expression in projection"],
|
|
41
|
+
["talias-01", "table alias with column aliases"],
|
|
42
|
+
["corr-01", "correlated scalar subquery in projection"],
|
|
43
|
+
]);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type CatalogSection, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
export const SEQ_SECTION: CatalogSection = section("SEQ", "Sequences", true, [
|
|
4
|
+
["create-01", "CREATE SEQUENCE defaults start at 1"],
|
|
5
|
+
["create-02", "START WITH sets the first value"],
|
|
6
|
+
["create-03", "INCREMENT BY controls the step"],
|
|
7
|
+
["create-04", "negative INCREMENT counts down from -1"],
|
|
8
|
+
["create-05", "MINVALUE and MAXVALUE bound the range"],
|
|
9
|
+
["cycle-01", "CYCLE wraps to MINVALUE after MAXVALUE"],
|
|
10
|
+
["cycle-02", "descending CYCLE wraps to MAXVALUE"],
|
|
11
|
+
["curr-01", "currval reflects the last nextval"],
|
|
12
|
+
["curr-02", "currval before nextval fails with 55000"],
|
|
13
|
+
["setval-01", "two-argument setval moves the sequence"],
|
|
14
|
+
["setval-02", "setval is_called false replays the value"],
|
|
15
|
+
["setval-03", "setval is_called true skips the value"],
|
|
16
|
+
["last-01", "lastval tracks the most recent nextval"],
|
|
17
|
+
["last-02", "lastval before any nextval fails with 55000"],
|
|
18
|
+
["serial-01", "serial column auto-increments"],
|
|
19
|
+
["serial-02", "bigserial column is bigint typed"],
|
|
20
|
+
["serial-03", "explicit value bypasses the serial default"],
|
|
21
|
+
["serial-04", "serial backing sequence drops with the table"],
|
|
22
|
+
["serial-05", "currval usable after a serial insert"],
|
|
23
|
+
["ident-01", "GENERATED BY DEFAULT AS IDENTITY auto-increments"],
|
|
24
|
+
["default-01", "nextval as a column DEFAULT"],
|
|
25
|
+
["drop-01", "DROP SEQUENCE removes it from pg_class"],
|
|
26
|
+
["drop-02", "DROP SEQUENCE of a missing sequence fails"],
|
|
27
|
+
["exh-01", "ascending exhaustion fails with 2200H"],
|
|
28
|
+
["exh-02", "descending exhaustion fails with 2200H"],
|
|
29
|
+
["alter-01", "ALTER SEQUENCE RESTART resets the sequence"],
|
|
30
|
+
["alter-02", "ALTER SEQUENCE INCREMENT BY changes the step"],
|
|
31
|
+
]);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type CatalogSection, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
const D = "documented_divergence" as const;
|
|
4
|
+
const SNAP_NOTE = "custom PGMM codec, no oracle analog";
|
|
5
|
+
const EXTRA = ["tests/contract/snapshots/"];
|
|
6
|
+
const DIV = "pgmm-snapshot-codec";
|
|
7
|
+
|
|
8
|
+
export const SNP_SECTION: CatalogSection = section("SNP", "Snapshot / restore", true, [
|
|
9
|
+
["rt-01", "round-trip schema and rows", D, SNAP_NOTE, EXTRA, DIV],
|
|
10
|
+
["rt-02", "round-trip all datum kinds", D, SNAP_NOTE, EXTRA, DIV],
|
|
11
|
+
["rt-03", "round-trip sequence counters", D, SNAP_NOTE, EXTRA, DIV],
|
|
12
|
+
["rt-04", "round-trip PRNG and clock", D, SNAP_NOTE, EXTRA, DIV],
|
|
13
|
+
["rt-05", "round-trip enums domains views functions", D, SNAP_NOTE, EXTRA, DIV],
|
|
14
|
+
["byte-01", "byte-identical snapshots for equivalent state", D, SNAP_NOTE, EXTRA, DIV],
|
|
15
|
+
["hdr-01", "PGMM magic and LE u32 version", D, SNAP_NOTE, EXTRA, DIV],
|
|
16
|
+
["hdr-02", "corrupt magic errors distinctly", D, SNAP_NOTE, EXTRA, DIV],
|
|
17
|
+
["hdr-03", "truncated blob errors", D, SNAP_NOTE, EXTRA, DIV],
|
|
18
|
+
["hdr-04", "future version raises snapshot_version", D, SNAP_NOTE, EXTRA, DIV],
|
|
19
|
+
["txn-01", "restore during transaction errors", D, SNAP_NOTE, EXTRA, DIV],
|
|
20
|
+
["rep-01", "restore replaces entire state", D, SNAP_NOTE, EXTRA, DIV],
|
|
21
|
+
]);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type CatalogSection, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
const D = "documented_divergence" as const;
|
|
4
|
+
|
|
5
|
+
export const TOK_SECTION: CatalogSection = section("TOK", "Tokenizer & lexical layer", true, [
|
|
6
|
+
["kw-01", "Keywords are case-insensitive"],
|
|
7
|
+
["ident-01", "Quoted identifiers preserve case"],
|
|
8
|
+
["ident-02", "Embedded quotes in quoted identifiers"],
|
|
9
|
+
["ident-03", "Unquoted identifiers fold to lowercase"],
|
|
10
|
+
["ident-04", "Quoted keywords usable as identifiers"],
|
|
11
|
+
["ident-05", "Identifiers with $ and _"],
|
|
12
|
+
["ident-06", "Unicode identifiers"],
|
|
13
|
+
["ident-07", "Unknown quoted identifier is a column error"],
|
|
14
|
+
["str-01", "Standard string '' escape"],
|
|
15
|
+
["str-02", "String literal with embedded newline"],
|
|
16
|
+
["str-03", "Empty string literal"],
|
|
17
|
+
["str-04", "Newline-separated string literal concatenation"],
|
|
18
|
+
["str-05", "Backslash is literal in standard strings"],
|
|
19
|
+
["str-06", "Same-line adjacent string literals error"],
|
|
20
|
+
["str-07", "Unterminated string literal errors"],
|
|
21
|
+
["estr-01", "E-string tab and newline escapes"],
|
|
22
|
+
["estr-02", "E-string backslash escape"],
|
|
23
|
+
["estr-03", "E-string unicode escapes"],
|
|
24
|
+
["estr-04", "E-string hex and octal escapes"],
|
|
25
|
+
["dollar-01", "Dollar-quoted string $$..$$"],
|
|
26
|
+
["dollar-02", "Tagged dollar quotes including mixed-case tags"],
|
|
27
|
+
["dollar-03", "Multiline dollar-quoted string"],
|
|
28
|
+
["num-01", "Integer literals"],
|
|
29
|
+
["num-02", "Decimal literal forms"],
|
|
30
|
+
["num-03", "Scientific notation"],
|
|
31
|
+
["num-04", "Hexadecimal integer literals"],
|
|
32
|
+
["num-05", "Underscore digit separators"],
|
|
33
|
+
["num-06", "Binary and octal integer literals"],
|
|
34
|
+
["bytea-01", "Bytea hex literal"],
|
|
35
|
+
["cast-01", ":: cast operator"],
|
|
36
|
+
["cmt-01", "Line comments -- to EOL"],
|
|
37
|
+
["cmt-02", "Block comments /* */"],
|
|
38
|
+
["cmt-03", "Nested block comments"],
|
|
39
|
+
[
|
|
40
|
+
"cmt-04",
|
|
41
|
+
"Comment-only script",
|
|
42
|
+
D,
|
|
43
|
+
"memory rejects a statement-free script as an empty statement; PostgreSQL accepts it",
|
|
44
|
+
undefined,
|
|
45
|
+
"empty-script-rejected",
|
|
46
|
+
],
|
|
47
|
+
["op-01", "JSON arrow operator tokens -> and ->>"],
|
|
48
|
+
["op-02", "Containment operator token @>"],
|
|
49
|
+
["op-03", "Comparison operator tokens <> != <= >="],
|
|
50
|
+
["semi-01", "Trailing semicolon on a single query"],
|
|
51
|
+
["ws-01", "Tab and CRLF whitespace between tokens"],
|
|
52
|
+
["uesc-01", "U& unicode escape string"],
|
|
53
|
+
]);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type CatalogSection, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
const D = "documented_divergence" as const;
|
|
4
|
+
const REPORT = ["tests/contract/_reports/session-system.md"];
|
|
5
|
+
|
|
6
|
+
export const TRG_SECTION: CatalogSection = section("TRG", "Triggers", true, [
|
|
7
|
+
["bi-01", "BEFORE INSERT trigger assigns a NEW column"],
|
|
8
|
+
["bi-02", "BEFORE INSERT trigger computes from another NEW column"],
|
|
9
|
+
["bi-03", "BEFORE INSERT returning NULL suppresses the row"],
|
|
10
|
+
["bi-04", "IF ELSIF ELSE chain in a trigger body"],
|
|
11
|
+
["when-01", "WHEN clause limits trigger firing"],
|
|
12
|
+
["when-02", "WHEN clause comparing OLD and NEW on update"],
|
|
13
|
+
["bu-01", "BEFORE UPDATE trigger reads OLD and writes NEW"],
|
|
14
|
+
["bu-02", "BEFORE UPDATE returning NULL suppresses the update"],
|
|
15
|
+
["bu-03", "BEFORE UPDATE trigger can override the assigned value"],
|
|
16
|
+
["bd-01", "BEFORE DELETE returning NULL suppresses the delete"],
|
|
17
|
+
["bd-02", "BEFORE DELETE returning OLD allows the delete"],
|
|
18
|
+
["ai-01", "AFTER INSERT returning NULL does not suppress the row"],
|
|
19
|
+
["multi-01", "one trigger function attached to INSERT and UPDATE"],
|
|
20
|
+
["sel-01", "trigger fires for INSERT ... SELECT rows"],
|
|
21
|
+
["chain-01", "two BEFORE INSERT triggers chain their effects"],
|
|
22
|
+
["raise-01", "RAISE EXCEPTION in BEFORE INSERT blocks the insert"],
|
|
23
|
+
["raise-02", "conditional RAISE EXCEPTION only fires for matching rows"],
|
|
24
|
+
["raise-03", "rows below the RAISE threshold insert normally"],
|
|
25
|
+
["raise-04", "trigger exception recovered with a savepoint"],
|
|
26
|
+
["drop-01", "DROP TRIGGER stops the trigger from firing"],
|
|
27
|
+
["drop-02", "DROP TRIGGER of a missing trigger fails"],
|
|
28
|
+
["drop-03", "DROP TRIGGER IF EXISTS on a missing trigger is a no-op"],
|
|
29
|
+
["life-01", "duplicate trigger name on the same table fails"],
|
|
30
|
+
["life-02", "same trigger name on different tables is allowed"],
|
|
31
|
+
["life-03", "dropping the table removes its triggers implicitly"],
|
|
32
|
+
["event-01", "trigger only fires for its declared event"],
|
|
33
|
+
[
|
|
34
|
+
"order-01",
|
|
35
|
+
"multiple-trigger firing order is creation order, not alphabetical",
|
|
36
|
+
D,
|
|
37
|
+
"memory fires triggers in creation order; PostgreSQL fires them in name order",
|
|
38
|
+
REPORT,
|
|
39
|
+
"trigger-order-creation",
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
"updof-01",
|
|
43
|
+
"UPDATE OF column lists are ignored",
|
|
44
|
+
D,
|
|
45
|
+
"memory fires a BEFORE UPDATE OF a trigger even when the UPDATE only touches other columns",
|
|
46
|
+
REPORT,
|
|
47
|
+
"trigger-update-of-ignored",
|
|
48
|
+
],
|
|
49
|
+
[
|
|
50
|
+
"instead-01",
|
|
51
|
+
"INSTEAD OF triggers on views are unsupported",
|
|
52
|
+
D,
|
|
53
|
+
"CREATE TRIGGER ... INSTEAD OF on a view fails in memory; PostgreSQL supports it",
|
|
54
|
+
undefined,
|
|
55
|
+
"instead-of-triggers-unsupported",
|
|
56
|
+
],
|
|
57
|
+
]);
|