mirror of
https://github.com/hanzoai/postgres.git
synced 2026-10-30 18:33:07 +00:00
This module allows plan advice strings to be provided automatically from an in-memory advice stash. Advice stashes are stored in dynamic shared memory and must be recreated and repopulated after a server restart. If pg_stash_advice.stash_name is set to the name of an advice stash, and if query identifiers are enabled, the query identifier for each query will be looked up in the advice stash and the associated advice string, if any, will be used each time that query is planned. Reviewed-by: Lukas Fittl <[email protected]> Reviewed-by: Alexandra Wang <[email protected]> Reviewed-by: David G. Johnston <[email protected]> Reviewed-by: Jakub Wartak <[email protected]> Discussion: http://postgr.es/m/CA+TgmoaeNuHXQ60P3ZZqJLrSjP3L1KYokW9kPfGbWDyt+1t=Ng@mail.gmail.com
17 lines
584 B
Plaintext
17 lines
584 B
Plaintext
/*
|
|
* This test must be run in a database with UTF-8 encoding,
|
|
* because other encodings don't support all the characters used.
|
|
*/
|
|
SELECT getdatabaseencoding() <> 'UTF8'
|
|
AS skip_test \gset
|
|
\if :skip_test
|
|
\quit
|
|
\endif
|
|
SET client_encoding = utf8;
|
|
-- Non-ASCII stash names should be rejected.
|
|
SELECT pg_create_advice_stash('café');
|
|
ERROR: advice stash name must not contain non-ASCII characters
|
|
SET pg_stash_advice.stash_name = 'café';
|
|
ERROR: invalid value for parameter "pg_stash_advice.stash_name": "café"
|
|
DETAIL: advice stash name must not contain non-ASCII characters
|