{"schema": "pgtrue.report/1", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c919-c4e7-7fa6-98a4-011599d5f508", "published": "2026-11-11T04:46:43Z", "publisher": "PostgresAI", "article": {"title": "Don't Do This", "url": "https://wiki.postgresql.org/wiki/Don%27t_Do_This", "date_published": "2026-11-11T03:40:00Z", "author": "Not stated", "publisher": "PostgreSQL wiki"}, "grade": "B", "axes": [{"axis": "Factual", "summary": "B- \u00b7 2 wrong of 17 checked \u00b7 1 caveat \u00b7 partly assessed"}, {"axis": "Applicable", "summary": "A \u00b7 0 checked \u00b7 partly assessed"}, {"axis": "Consistent", "summary": "A \u00b7 0 checked"}, {"axis": "Transparent", "summary": "A \u00b7 0 wrong of 8 checked \u00b7 0 caveats \u00b7 partly assessed"}, {"axis": "Safe", "summary": "A \u00b7 0 checked \u00b7 partly assessed"}], "findings": [{"anchor": "F1", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c919-c4e7-7fa6-98a4-011599d5f508#F1", "claim": "\u2026the ISO convention is for eastward shifts to be denoted as negative.", "title": "The ISO offset explanation reverses east and west", "explanation": "ISO offsets east of UTC are positive. REL_10_23 doc/src/sgml/datatype.sgml:2354-2356 states that convention. POSIX timezone specifications reverse it. Following the parenthetical would select the opposite offset.", "verdict": "False", "sources": [{"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/doc/src/sgml/datatype.sgml#L2354-L2356", "label": "REL_10_23 \u00b7 doc/src/sgml/datatype.sgml:2354-2356"}, {"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/doc/src/sgml/datetime.sgml#L620-L642", "label": "REL_10_23 \u00b7 doc/src/sgml/datetime.sgml:620-642"}, {"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/doc/src/sgml/datatype.sgml#L2354-L2356", "label": "REL_10_23 \u00b7 doc/src/sgml/datatype.sgml:2354-2356"}]}, {"anchor": "F2", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c919-c4e7-7fa6-98a4-011599d5f508#F2", "claim": "Stick to using a-z, 0-9 and underscore for names and you never have to worry about quoting them.", "title": "Lowercase characters alone do not eliminate identifier quoting", "explanation": "Lowercase reserved words still require quotes when used as identifiers. REL_10_23 doc/src/sgml/syntax.sgml:173-177 uses select as its example. Choosing names from the article's character set can still produce parse errors.", "verdict": "Recipe error", "sources": [{"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/doc/src/sgml/syntax.sgml#L173-L177", "label": "REL_10_23 \u00b7 doc/src/sgml/syntax.sgml:173-177"}]}, {"anchor": "F13", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c919-c4e7-7fa6-98a4-011599d5f508#F13", "claim": "\u2026will throw an error if you try and insert a string longer than n characters\u2026", "title": "varchar(n) can truncate overlength input without an error", "explanation": "PostgreSQL truncates excess trailing spaces when assigning to varchar(n). REL_10_23 doc/src/sgml/datatype.sgml:1075\u20131078 documents this exception. A caller relying on an error can accept altered input.", "verdict": "Mostly accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/doc/src/sgml/datatype.sgml#L1067-L1098", "label": "REL_10_23 \u00b7 doc/src/sgml/datatype.sgml:1067-1098"}]}, {"anchor": "F5", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c919-c4e7-7fa6-98a4-011599d5f508#F5", "claim": "With trust authentication, any user can claim to be any other user\u2026", "title": "Trust authentication accepts the requested role without a password", "explanation": "REL_10_23 src/backend/libpq/auth.c:591-593 returns STATUS_OK for trust authentication. The requested role can include a superuser. Network reachability and HBA database/user restrictions still apply. SCRAM authentication exists at the article's PostgreSQL 10 version floor.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/libpq/auth.c#L591-L593", "label": "REL_10_23 \u00b7 src/backend/libpq/auth.c:591-593"}, {"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/doc/src/sgml/client-auth.sgml#L873-L878", "label": "REL_10_23 \u00b7 doc/src/sgml/client-auth.sgml:873-878"}, {"url": "https://github.com/postgres/postgres/blob/5df0e99bea1c3e5fbffa7fbd0982da88ea149bb6/doc/src/sgml/client-auth.sgml#L939-L939", "label": "REL_10_0 \u00b7 doc/src/sgml/client-auth.sgml:939-939"}]}, {"anchor": "F7", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c919-c4e7-7fa6-98a4-011599d5f508#F7", "claim": "\u2026Temporary tables cannot be created or modified on PostgreSQL hot standbys.", "title": "Temporary-table DDL fails on hot standby and updates catalogs on the primary", "explanation": "Hot standby rejects temporary-table DDL and DML. REL_10_23 doc/src/sgml/high-availability.sgml:1787-1802 documents both restrictions. Relation creation updates catalogs in heap.c:1273-1286. RETURN QUERY avoids that table DDL, but its tuplestore can spill according to work_mem in pl_exec.c:3114-3116.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/doc/src/sgml/high-availability.sgml#L1787-L1802", "label": "REL_10_23 \u00b7 doc/src/sgml/high-availability.sgml:1787-1802"}, {"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/catalog/heap.c#L1266-L1286", "label": "REL_10_23 \u00b7 src/backend/catalog/heap.c:1266-1286"}, {"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/pl/plpgsql/src/pl_exec.c#L3087-L3116", "label": "REL_10_23 \u00b7 src/pl/plpgsql/src/pl_exec.c:3087-3116"}, {"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/doc/src/sgml/high-availability.sgml#L1697-L1697", "label": "REL_10_23 \u00b7 doc/src/sgml/high-availability.sgml:1697-1697"}]}, {"anchor": "F8", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c919-c4e7-7fa6-98a4-011599d5f508#F8", "claim": "Because it rounds off the fractional part rather than truncating it\u2026", "explanation": "REL_10_23 src/backend/utils/adt/timestamp.c:337-374 rounds timestamps to the requested precision. Precision 0 uses a 500,000-microsecond offset. The cited range checks precision rounding only.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/utils/adt/timestamp.c#L331-L375", "label": "REL_10_23 \u00b7 src/backend/utils/adt/timestamp.c:331-375"}]}, {"anchor": "F9", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c919-c4e7-7fa6-98a4-011599d5f508#F9", "claim": "Using the --password or -W flags will tell psql to prompt you for a password\u2026", "title": "psql -W requests a password before connecting", "explanation": "REL_10_23 src/bin/psql/startup.c:210-214 prompts before the connection attempt when password prompting is forced. Lines 246-255 request a password after a failed attempt when needed. Peer authentication does not verify the entered password.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/bin/psql/startup.c#L204-L255", "label": "REL_10_23 \u00b7 src/bin/psql/startup.c:204-255"}, {"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/doc/src/sgml/ref/psql-ref.sgml#L494-L526", "label": "REL_10_23 \u00b7 doc/src/sgml/ref/psql-ref.sgml:494-526"}]}, {"anchor": "F10", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c919-c4e7-7fa6-98a4-011599d5f508#F10", "claim": "SQL_ASCII means \"no conversions\"\u2026", "title": "SQL_ASCII conversion preserves bytes", "explanation": "REL_10_23 src/backend/utils/mb/mbutils.c:349-356 returns the original bytes for SQL_ASCII conversions. A conversion from SQL_ASCII validates the destination encoding without translating characters. This supports the article's warning about unknown mixed encodings.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/utils/mb/mbutils.c#L337-L357", "label": "REL_10_23 \u00b7 src/backend/utils/mb/mbutils.c:337-357"}]}, {"anchor": "F11", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c919-c4e7-7fa6-98a4-011599d5f508#F11", "claim": "\u2026char(n) is not a fixed-width type\u2026", "title": "char(n) uses variable-length storage and pads short values", "explanation": "REL_10_23 src/backend/utils/adt/varchar.c:137-182 distinguishes character count from byte length, allocates a varlena datum, and pads spaces. char(n) does not enforce an exact input length. The documentation supports text or unconstrained varchar for most uses.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/utils/adt/varchar.c#L125-L184", "label": "REL_10_23 \u00b7 src/backend/utils/adt/varchar.c:125-184"}, {"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/doc/src/sgml/datatype.sgml#L1068-L1176", "label": "REL_10_23 \u00b7 doc/src/sgml/datatype.sgml:1068-1176"}]}, {"anchor": "F12", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c919-c4e7-7fa6-98a4-011599d5f508#F12", "claim": "\u2026For new applications, identity columns should be used instead.", "title": "Identity columns are available at the PostgreSQL 10 version floor", "explanation": "REL_10_0 doc/src/sgml/ref/create_table.sgml:65 includes identity-column syntax. REL_10_23 documents its implicit sequence and NOT NULL property at lines 688-692. Identity provides the SQL-standard alternative recommended for new applications.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/doc/src/sgml/ref/create_table.sgml#L685-L705", "label": "REL_10_23 \u00b7 doc/src/sgml/ref/create_table.sgml:685-705"}, {"url": "https://github.com/postgres/postgres/blob/5df0e99bea1c3e5fbffa7fbd0982da88ea149bb6/doc/src/sgml/ref/create_table.sgml#L65-L65", "label": "REL_10_0 \u00b7 doc/src/sgml/ref/create_table.sgml:65-65"}]}, {"anchor": "F15", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c919-c4e7-7fa6-98a4-011599d5f508#F15", "claim": "\u2026scram-sha-256 that is available in PostgreSQL 10 and above\u2026", "title": "SCRAM-SHA-256 starts with PostgreSQL 10", "explanation": "PostgreSQL 10 added SCRAM-SHA-256 password negotiation and storage. REL_10_23 doc/src/sgml/release-10.sgml:22412\u201322414 confirms the stated compatibility floor.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/doc/src/sgml/release-10.sgml#L22400-L22430", "label": "REL_10_23 \u00b7 doc/src/sgml/release-10.sgml:22400-22430"}]}, {"anchor": "F16", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c919-c4e7-7fa6-98a4-011599d5f508#F16", "claim": "If you need support to PostgreSQL older than version 10.", "title": "Identity columns require PostgreSQL 10 or later", "explanation": "PostgreSQL 10 introduced identity columns. REL_10_23 doc/src/sgml/release-10.sgml:23028\u201323034 describes their addition and SQL-standard syntax. Supporting older PostgreSQL releases justifies retaining serial.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/doc/src/sgml/release-10.sgml#L23020-L23045", "label": "REL_10_23 \u00b7 doc/src/sgml/release-10.sgml:23020-23045"}]}, {"anchor": "F18", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c919-c4e7-7fa6-98a4-011599d5f508#F18", "claim": "\u2026trailing spaces are treated as semantically insignificant\u2026", "title": "The character-padding quotation preserves the manual's qualifications", "explanation": "PostgreSQL ignores trailing spaces when comparing character values. REL_10_23 doc/src/sgml/datatype.sgml:1118\u20131132 also documents padding, conversion trimming, and pattern-matching qualifications. The article preserves those distinctions.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/doc/src/sgml/datatype.sgml#L1116-L1140", "label": "REL_10_23 \u00b7 doc/src/sgml/datatype.sgml:1116-1140"}]}, {"anchor": "F19", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c919-c4e7-7fa6-98a4-011599d5f508#F19", "claim": "\u2026the plain subplan is horrifically slow (in fact O(N2))\u2026", "title": "A scan subplan can require quadratic work", "explanation": "ExecScanSubPlan rescans the inner result for each invocation. src/backend/executor/nodeSubplan.c:339 iterates through its rows. Worst-case work is O(M \u00d7 N). This becomes O(N\u00b2) when both input sizes grow together.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/executor/nodeSubplan.c#L220-L222", "label": "REL_10_23 \u00b7 src/backend/executor/nodeSubplan.c:220-222"}, {"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/executor/nodeSubplan.c#L339-L341", "label": "REL_10_23 \u00b7 src/backend/executor/nodeSubplan.c:339-341"}]}, {"anchor": "F20", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c919-c4e7-7fa6-98a4-011599d5f508#F20", "claim": "\u2026you might be storing a value half a second in the future.", "title": "Zero timestamp precision can round forward by half a second", "explanation": "timestamp(0) rounds rather than truncates. src/backend/utils/adt/timestamp.c:337 defines a 1,000,000-microsecond scale and a 500,000-microsecond offset. A fractional part of .500000 can round forward by 0.5 seconds.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/utils/adt/timestamp.c#L337-L355", "label": "REL_10_23 \u00b7 src/backend/utils/adt/timestamp.c:337-355"}, {"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/utils/adt/timestamp.c#L366-L369", "label": "REL_10_23 \u00b7 src/backend/utils/adt/timestamp.c:366-369"}]}, {"anchor": "F21", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c919-c4e7-7fa6-98a4-011599d5f508#F21", "claim": "\u2026they will take up exactly the same amount of space\u2026", "title": "A varchar length limit adds no per-value storage", "explanation": "varchar(n), varchar, and text use the same storage for identical stored strings. REL_10_23 doc/src/sgml/datatype.sgml:1144 describes the shared string overhead. The length limit does not reserve n characters.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/doc/src/sgml/datatype.sgml#L1144-L1147", "label": "REL_10_23 \u00b7 doc/src/sgml/datatype.sgml:1144-1147"}]}, {"anchor": "F22", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c919-c4e7-7fa6-98a4-011599d5f508#F22", "claim": "It will save a round trip to the server\u2026", "title": "-W can avoid one unsuccessful connection attempt", "explanation": "Without an available password, psql first discovers that authentication requires one. src/bin/psql/startup.c:246 closes that connection, prompts, and retries. Supplying the password through -W avoids that initial unsuccessful attempt.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/bin/psql/startup.c#L246-L256", "label": "REL_10_23 \u00b7 src/bin/psql/startup.c:246-256"}]}], "grade_reason": "capped by Factual: 2 findings"}