From 053287962b7d62fd0f22433917c9517dd4621616 Mon Sep 17 00:00:00 2001 From: Guillaume Lelarge Date: Wed, 11 Feb 2015 21:47:47 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20en=20version=209.2.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- postgresql/auto-explain.xml | 76 +-- postgresql/config.xml | 6 +- postgresql/datatype.xml | 33 +- postgresql/datetime.xml | 29 +- postgresql/func.xml | 253 +++++--- postgresql/installation.xml | 2 +- postgresql/legal.xml | 2 +- postgresql/libpq.xml | 7 +- postgresql/maintenance.xml | 11 +- postgresql/pageinspect.xml | 7 +- postgresql/pgcrypto.xml | 2 +- postgresql/plpgsql.xml | 4 +- postgresql/plpython.xml | 6 +- postgresql/queries.xml | 170 +++--- postgresql/ref/create_sequence.xml | 6 +- postgresql/ref/psql-ref.xml | 112 ++-- postgresql/regress.xml | 14 - postgresql/release-9.0.xml | 726 +++++++++++++++++++++++ postgresql/release-9.1.xml | 812 ++++++++++++++++++++++++- postgresql/release-9.2.xml | 917 +++++++++++++++++++++++++++++ postgresql/runtime.xml | 26 +- postgresql/storage.xml | 2 +- postgresql/syntax.xml | 49 ++ postgresql/typeconv.xml | 97 ++- postgresql/version.xml | 2 +- postgresql/xfunc.xml | 14 + 26 files changed, 3067 insertions(+), 318 deletions(-) diff --git a/postgresql/auto-explain.xml b/postgresql/auto-explain.xml index 9a84d96af..b0ed1247f 100644 --- a/postgresql/auto-explain.xml +++ b/postgresql/auto-explain.xml @@ -85,6 +85,8 @@ nœud du plan est calculé pour tous les ordres exécutés, qu'ils durent suffisamment longtemps pour être réellement tracés, ou non. Ceci peut avoir des conséquences très négatives sur les performances. + Turning off auto_explain.log_timing ameliorates the + performance cost, at the price of obtaining less information. @@ -92,78 +94,78 @@ - auto_explain.log_verbose (boolean) + auto_explain.log_buffers (boolean) - paramètre de configuration auto_explain.log_verbose + paramètre de configuration auto_explain.log_buffers - auto_explain.log_verbose entraîne l'écriture - du résultat de EXPLAIN VERBOSE - au lieu du résultat de la commande simple EXPLAIN, - lorsqu'un plan d'exécution est tracé. Ce paramètre est désactivé par défaut. - Seuls les super-utilisateurs peuvent modifier ce paramètre. + auto_explain.log_buffers controls whether buffer + usage statistics are printed when an execution plan is logged; it's + equivalent to the BUFFERS option of EXPLAIN. + This parameter has no effect + unless auto_explain.log_analyze is enabled. + This parameter is off by default. - auto_explain.log_buffers (boolean) + auto_explain.log_timing (boolean) - paramètre de configuration auto_explain.log_buffers + paramètre de configuration auto_explain.log_timing - auto_explain.log_buffers permet d'obtenir la même - sortie qu'un EXPLAIN (ANALYZE, BUFFERS), plutôt que - la sortie EXPLAIN habituelle quand un plan d'exécution - est tracé. Ce paramètre est désactivé par défaut. Seuls les - superutilisateurs peuvent modifier cette configuration. Ce paramètre n'a - pas d'effet sauf si le paramètre - auto_explain.log_analyze est activé. + auto_explain.log_timing controls whether per-node + timing information is printed when an execution plan is logged; it's + equivalent to the TIMING option of EXPLAIN. + The overhead of repeatedly reading the system clock can slow down + queries significantly on some systems, so it may be useful to set this + parameter to off when only actual row counts, and not exact times, are + needed. + This parameter has no effect + unless auto_explain.log_analyze is enabled. + This parameter is on by default. + Only superusers can change this setting. - auto_explain.log_format (enum) + auto_explain.log_verbose (enum) - paramètre de configuration auto_explain.log_format + paramètre de configuration auto_explain.log_verbose - auto_explain.log_format sélectionne le format de - sortie du EXPLAIN à utiliser. Les valeurs autorisées - sont text, xml, - json et yaml. La valeur par défaut - est text. Seuls les super-utilisateurs peuvent modifier ce paramètre. + auto_explain.log_verbose controls whether verbose + details are printed when an execution plan is logged; it's + equivalent to the VERBOSE option of EXPLAIN. + This parameter is off by default. - auto_explain.log_timing (boolean) + auto_explain.log_format (boolean) - paramètre de configuration auto_explain.log_timing + paramètre de configuration auto_explain.log_format - auto_explain.log_timing entraîne une sortie identique - à un EXPLAIN (ANALYZE, TIMING off), plutôt qu'un simple - EXPLAIN (ANALYZE). La surcharge causée par la lecture - répétée de l'horloge système peut fortement ralentir la requête sur - certains systèmes, donc il peut être utile de configurer ce paramètre à - FALSE quand seul le décompte de lignes a une importance, - et pas la durée d'exécution. Ce paramètre est seulement activable quand - auto_explain.log_analyze est lui-aussi activée. Par - défaut, ce paramètre vaut TRUE. + auto_explain.log_format selects the + EXPLAIN output format to be used. + The allowed values are text, xml, + json, and yaml. The default is text. + Only superusers can change this setting. @@ -189,8 +191,9 @@ - Ces paramètres doivent être configurés dans le fichier - postgresql.conf. + In ordinary usage, these parameters are set + in postgresql.conf, although superusers can alter them + on-the-fly within their own sessions. Voici un exemple typique d'utilisation : @@ -208,6 +211,7 @@ postgres=# LOAD 'auto_explain'; postgres=# SET auto_explain.log_min_duration = 0; + postgres=# SET auto_explain.log_analyze = true; postgres=# SELECT count(*) FROM pg_class, pg_index WHERE oid = indrelid AND indisunique; diff --git a/postgresql/config.xml b/postgresql/config.xml index 559d13461..c1ebf235b 100644 --- a/postgresql/config.xml +++ b/postgresql/config.xml @@ -5529,7 +5529,7 @@ SET XML OPTION { DOCUMENT | CONTENT }; entier ; il y a aussi 'Australia' et 'India'. D'autres listes peuvent être définies pour une installation particulière. Voir pour plus d'informations. + linkend="datetime-config-files"/> pour plus d'informations. @@ -5793,8 +5793,8 @@ SET XML OPTION { DOCUMENT | CONTENT }; est d'autoriser le chargement de bibliothèques de débogage ou de mesure de performance dans certaines sessions spécifiques sans commande LOAD explicite. Par exemple, le débogage - peut être activé pour toutes les sessions d'un nom d'utilisateur - donné en configurant ce paramètre avec ALTER ROLE SET. + peut être activé pour une session en configurant ce paramètre avec la + variable d'environnement PGOPTIONS. diff --git a/postgresql/datatype.xml b/postgresql/datatype.xml index e535d4276..65fc34dbb 100644 --- a/postgresql/datatype.xml +++ b/postgresql/datatype.xml @@ -2413,7 +2413,7 @@ des références au 1er janvier 2000 ? arbitraires, particulièrement en respect des règles de changement d'heure (heure d'été/heure d'hiver). PostgreSQL utilise la très répandue base de données - de fuseaux horaires zoneinfo (Olson) pour gérer les informations + de fuseaux horaires IANA (Olson) pour gérer les informations sur les règles de fuseau horaire historiques. Pour les dates se situant dans le futur, PostgreSQL part de l'assomption que les dernières règles connues pour un fuseau continueront à s'appliquer dans le futur. @@ -2480,7 +2480,7 @@ des références au 1er janvier 2000 ? pg_timezone_names (voir ). PostgreSQL utilise les données - zoneinfo pour cela, les mêmes noms sont donc + IANA pour cela, les mêmes noms sont donc reconnus par de nombreux autres logiciels ; @@ -2515,7 +2515,7 @@ des références au 1er janvier 2000 ? USA. Si un nom de changement d'heure est présent, il est interprété selon les règles régissant les changements d'heure utilisées dans l'entrée posixrules de la base - de données des fuseaux horaires, zoneinfo. Dans une + de données des fuseaux horaires IANA. Dans une installation PostgreSQL standard, posixrules est identique à US/Eastern, pour que les spécifications POSIX des fuseaux horaires correspondent @@ -2528,9 +2528,26 @@ des références au 1er janvier 2000 ? En résumé, il y a une différence entre les abréviations et - les noms complets : les abréviations représentent toujours un décalage - fixe par rapport à UTC alors que la plupart des noms complets impliquent une règle de - changement d'heure et donc deux décalages possibles. + les noms complets + and full names: abbreviations represent a specific offset from UTC, + whereas many of the full names imply a local daylight-savings time + rule, and so have two possible UTC offsets. As an example, + 2014-06-04 12:00 America/New_York represents noon local + time in New York, which for this particular date was Eastern Daylight + Time (UTC-4). So 2014-06-04 12:00 EDT specifies that + same time instant. But 2014-06-04 12:00 EST specifies + noon Eastern Standard Time (UTC-5), regardless of whether daylight + savings was nominally in effect on that date. + + + + To complicate matters, some jurisdictions have used the same timezone + abbreviation to mean different UTC offsets at different times; for + example, in Moscow MSK has meant UTC+3 in some years and + UTC+4 in others. PostgreSQL interprets such + abbreviations according to whatever they meant (or had most recently + meant) on the specified date; but, as with the EST example + above, this is not necessarily the same as local civil time on that date. @@ -2549,14 +2566,14 @@ des références au 1er janvier 2000 ? - Dans tous les cas, les noms des fuseaux horaires sont + Dans tous les cas, les noms des fuseaux horaires et les abréviations sont insensibles à la casse. (C'est un changement par rapport aux versions de PostgreSQL antérieures à la 8.2 qui étaient sensibles à la casse dans certains cas et pas dans d'autres.) - Ni les noms complets ni les abréviations ne sont codés en dur dans le + Ni les noms de fuseau horaire ni les abréviations ne sont codés en dur dans le serveur ; ils sont obtenus à partir des fichiers de configuration stockés sous .../share/timezone/ et .../share/timezonesets/ du répertoire d'installation diff --git a/postgresql/datetime.xml b/postgresql/datetime.xml index 705cf74a1..02add758e 100644 --- a/postgresql/datetime.xml +++ b/postgresql/datetime.xml @@ -393,24 +393,29 @@ suivant. autres lignes doivent suivre l'un des formats suivants : -nom_fuseau_horaire décalage -nom_fuseau_horaire décalage D +abréviation_zone décalage +abréviation_zone décalage D +abréviation_zone nom_fuseau_horaire @INCLUDE nom_fichier @OVERRIDE - Un nom_fuseau_horaire n'est que - l'abréviation définie. Le décalage est le - décalage en secondes à partir d'UTC, une valeur positive signifiant à + Un abréviation_zone n'est que + l'abréviation en cours de définition. Le décalage est le + décalage équivalent en secondes à partir d'UTC, une valeur positive signifiant à l'est de Greenwich, une valeur négative à l'ouest. Ainsi, -18000 représente cinq heures à l'ouest de Greenwich, soit l'heure standard de la côte ouest nord américaine. D indique que le nom du fuseau représente une heure - soumise à des règles de changement d'heure plutôt que l'heure standard. Comme tous les - décalages de fuseau horaire ont des limites de 15 minutes, le nombre - de secondes doit être un multiple de 900. + soumise à des règles de changement d'heure plutôt que l'heure standard. + Alternatively, a time_zone_name can + be given, in which case that time zone definition is consulted, and the + abbreviation's meaning in that zone is used. This alternative is + recommended only for abbreviations whose meaning has historically varied, + as looking up the meaning is noticeably more expensive than just using + a fixed integer value. @@ -432,7 +437,7 @@ suivant. quasi-totalité du monde. Les fichiers supplémentaires Australia et India sont fournis pour ces régions : ces fichiers incluent le fichier Default puis - ajoutent ou modifient les fuseaux horaires si nécessaire. + ajoutent ou modifient les abréviations si nécessaire. @@ -440,7 +445,7 @@ suivant. des fichiers Africa.txt, America.txt, etc. qui contiennent des informations sur les abréviations connues et utilisées en accord avec la base de données de fuseaux horaires - zoneinfo. Les définitions des noms de zone trouvées dans ces + IANA. Les définitions des noms de zone trouvées dans ces fichiers peuvent être copiées et collées dans un fichier de configuration personnalisé si nécessaire. Il ne peut pas être fait directement référence à ces fichiers dans le paramètre @@ -449,8 +454,8 @@ suivant. - Si une erreur survient lors de la lecture des jeux de données de - fuseaux horaires, aucune nouvelle valeur n'est acceptée mais les anciennes + Si une erreur survient lors de la lecture de l'ensemble des + abréviations, aucune nouvelle valeur n'est acceptée mais les anciennes sont conservées. Si l'erreur survient au démarrage de la base, celui-ci échoue. diff --git a/postgresql/func.xml b/postgresql/func.xml index e637693ee..a8e3a0a8a 100644 --- a/postgresql/func.xml +++ b/postgresql/func.xml @@ -824,19 +824,6 @@ seulement le sont ? --> 0.785398163397448 - - - - random - - random() - - dp - valeur au hasard entre 0.0 (compris) et 1.0 (non compris) - random() - - - @@ -860,22 +847,6 @@ seulement le sont ? --> 42.44 - - - - - setseed - - setseed(dp) - - void - initialise les appels à - random() à suivre - (valeur entre -1.0 et 1.0, inclusif) - setseed(0.54823) - - - @@ -948,6 +919,106 @@ champs, adressable en tant qu'entité.) --> + + shows functions for + generating random numbers. + + + + Random Functions + + + + + Function + Return Type + Description + + + + + + + random + + random() + + dp + random value in the range 0.0 <= x < 1.0 + + + + + + setseed + + setseed(dp) + + void + set seed for subsequent random() calls (value between -1.0 and + 1.0, inclusive) + + + +
+ + + The characteristics of the values returned by + random() depend + on the system implementation. It is not suitable for cryptographic + applications; see module for an alternative. + + + + shows functions for + generating random numbers. + + + + Random Functions + + + + + Function + Return Type + Description + + + + + + + random + + random() + + dp + random value in the range 0.0 <= x < 1.0 + + + + + + setseed + + setseed(dp) + + void + set seed for subsequent random() calls (value between -1.0 and + 1.0, inclusive) + + + +
+ + + The characteristics of the values returned by + random() depend + on the system implementation. It is not suitable for cryptographic + applications; see module for an alternative. + + Pour finir, le affiche les fonctions trigonométriques disponibles. Toutes les fonctions trigonométriques prennent @@ -5464,19 +5535,19 @@ anorexie, modération :-) ? -->
IYYY - année ISO (quatre chiffres ou plus) + ISO 8601 week-numbering year (4 or more digits) IYY - trois derniers chiffres de l'année ISO + last 3 digits of ISO 8601 week-numbering year IY - deux derniers chiffres de l'année ISO + last 2 digits of ISO 8601 week-numbering year I - dernier chiffre de l'année ISO + last digit of ISO 8601 week-numbering year BC, bc, @@ -5562,8 +5633,7 @@ anorexie, modération :-) ? --> IDDD - jour ISO de l'année (001-371 ; le jour 1 de l'année est - le lundi de la première semaine ISO.) + day of ISO 8601 week-numbering year (001-371; day 1 of the year is Monday of the first ISO week) DD @@ -5576,7 +5646,7 @@ anorexie, modération :-) ? --> ID - jour ISO de la semaine du lundi (1) au + jour ISO 8601 de la semaine du lundi (1) au dimanche (7) @@ -5591,7 +5661,7 @@ anorexie, modération :-) ? --> IW - numéro ISO de la semaine dans l'année (01 - 53 ; le premier + week number of ISO 8601 week-numbering year (01 - 53 ; le premier jeudi de la nouvelle année est dans la semaine 1) @@ -5796,7 +5866,7 @@ MON') renvoie une erreur car to_timestamp - Une date de semaine ISO (distinct de la date grégorienne) peut être + An ISO 8601 week-numbering date (distinct de la date grégorienne) peut être passée à to_timestamp et to_date de deux façons : @@ -5817,14 +5887,25 @@ MON') renvoie une erreur car to_timestamp - Essayer de construire une date en utilisant un mélange de champs de semaine - ISO et de date grégorienne n'a pas de sens et renverra du coup une erreur. - Dans le contexte d'une année ISO, le concept d'un mois ou - du jour d'un mois n'a pas de signification. Dans le - contexte d'une année grégorienne, la semaine ISO n'a pas de signification. - Les utilisateurs doivent éviter de mixer les spécifications grégoriennes - et les dates ISO. + Attempting to enter a date using a mixture of ISO 8601 week-numbering + fields and Gregorian date fields is nonsensical, and will cause an + error. In the context of an ISO 8601 week-numbering year, the + concept of a month or day of month has no + meaning. In the context of a Gregorian year, the ISO week has no + meaning. + + + While to_date will reject a mixture of + Gregorian and ISO week-numbering date + fields, to_char will not, since output format + specifications like YYYY-MM-DD (IYYY-IDDD) can be + useful. But avoid writing something like IYYY-MM-DD; + that would yield surprising results near the start of the year. + (See for more + information.) + + @@ -7013,11 +7094,11 @@ SELECT EXTRACT(ISOYEAR FROM DATE '2006-01-02'); - Chaque année ISO commence avec le lundi de la - semaine contenant le 4 janvier, donc soit début janvier, soit - fin décembre. L'année ISO peut être différente de - l'année grégorienne. Voir le champ week pour plus - d'informations. + Each ISO 8601 week-numbering year begins with the + Monday of the week containing the 4th of January, so in early + January or late December the ISO year may be + different from the Gregorian year. See the week + field for more information. Ce champ n'est disponible que depuis la version 8.3 de PostgreSQL. @@ -7176,14 +7257,14 @@ SELECT EXTRACT(SECOND FROM TIME '17:12:28.5'); week - Le numéro de la semaine dans l'année, à laquelle appartient le jour. - Par définition (ISO 8601), les semaines commencent + Le numéro de la semaine dans l'année ISO 8601 week-numbering, à laquelle appartient le jour. + Par définition, les semaines ISO commencent le lundi et la première semaine d'une année contient le 4 janvier de cette année. Autrement dit, le premier jeudi d'une année se trouve dans la première semaine de cette année. - Dans la définition ISO, il est possible que les premiers jours de janvier + Dans la week-numbering system ISO, il est possible que les premiers jours de janvier fassent partie de la semaine 52 ou 53 de l'année précédente. Il est aussi possibles que les derniers jours de décembre fassent partie de la première semaine de l'année suivante. Par exemple, 2005-01-01 @@ -10358,12 +10439,13 @@ END - Comme décrit dans , les fonctions et les - opérateurs marqués IMMUTABLE peuvent être évalués quand - la requête est planifiée plutôt que quand elle est exécutée. Cela signifie - que les parties constantes d'une sous-expression qui n'est pas évaluée - durant l'exécution de la requête pourrait toujours être évaluée pendant la - planification de la requête. + As described in , there are various + situations in which subexpressions of an expression are evaluated at + different times, so that the principle that CASE + evaluates only necessary subexpressions is not ironclad. For + example a constant 1/0 subexpression will usually result in + a division-by-zero failure at planning time, even if it's within + a CASE arm that would never be entered at run time. @@ -11225,11 +11307,11 @@ END smallint, int, bigint, real, - double precision, numeric ou interval + double precision, numeric, interval + ou money numeric pour tout argument de type entier, - double precision pour tout argument en virgule flottante, sinon identique au type de données de l'argument la moyenne arithmétique de toutes les valeurs en @@ -15427,7 +15509,8 @@ off bigint Espace disque utilisé par le fork indiqué, 'main', - 'fsm' ou 'vm', d'une table ou index d'OID ou de nom indiqué. + 'fsm', 'vm' ou 'init', + d'une table ou index d'OID ou de nom indiqué. @@ -15536,18 +15619,40 @@ off
- pg_relation_size accepte l'OID ou le nom d'une table, d'un - index ou d'une table toast et renvoie la taille sur disque en octets. Indiquer - 'main' ou laisser le second argument renvoie la taille du - morceau de données principal de la relation. Indiquer - 'fsm' renvoie la taille de la carte des espaces libres - (voir ) associée à cette relation. Indiquer - 'vm' renvoie la taille de la carte de visibilité - (voir ) associée avec la relation. Notez que - cette fonction affiche la taille d'un seul fichier ; dans la plupart - des cas, c'est plus simple à utiliser que les fonctions de haut-niveau - comme pg_total_relation_size ou - pg_table_size. + pg_relation_size accepts the OID or name of a table, index + or toast table, and returns the on-disk size in bytes of one fork of + that relation. (Note that for most purposes it is more convenient to + use the higher-level functions pg_total_relation_size + or pg_table_size, which sum the sizes of all forks.) + With one argument, it returns the size of the main data fork of the + relation. The second argument can be provided to specify which fork + to examine: + + + + 'main' returns the size of the main + data fork of the relation. + + + + + 'fsm' returns the size of the Free Space Map + (see ) associated with the relation. + + + + + 'vm' returns the size of the Visibility Map + (see ) associated with the relation. + + + + + 'init' returns the size of the initialization fork, + if any, (see ) associated with the relation. + + + diff --git a/postgresql/installation.xml b/postgresql/installation.xml index 34769eb3c..9515c995d 100644 --- a/postgresql/installation.xml +++ b/postgresql/installation.xml @@ -1064,7 +1064,7 @@ su - postgres PostgreSQL inclut sa propre base de données des fuseaux horaires, nécessaire pour les opérations sur les dates et les heures. Cette base de données est en fait compatible avec la base - de fuseaux horaires zoneinfo fournie par de nombreux + de fuseaux horaires IANA fournie par de nombreux systèmes d'exploitation comme FreeBSD, Linux et Solaris, donc ce serait redondant de l'installer une nouvelle fois. Quand cette option est utilisée, la base des fuseaux horaires, fournie par le système, dans diff --git a/postgresql/legal.xml b/postgresql/legal.xml index c8400634c..1f500c5d7 100644 --- a/postgresql/legal.xml +++ b/postgresql/legal.xml @@ -5,7 +5,7 @@ révision $Revision$ --> - 1996-2014 + 1996-2015 The PostgreSQL Global Development Group diff --git a/postgresql/libpq.xml b/postgresql/libpq.xml index c0d6b136b..8c9dde1db 100644 --- a/postgresql/libpq.xml +++ b/postgresql/libpq.xml @@ -133,7 +133,10 @@ PGconn *PQconnectdbParams(const char * const *keywords, Quand expand_dbname est différent de zéro, la valeur du mot-clé dbname peut être reconnue comme une - chaîne de connexion. Les formats possibles sont disponibles dans + chaîne de connexion. Only the first occurrence of + dbname is expanded this way, any subsequent + dbname value is processed as plain database name. + Les formats possibles sont disponibles dans avec de nombreux détails. @@ -6380,7 +6383,7 @@ la variable d'environnement PGSERVICE. sur ~/.pg_service.conf ou à l'emplacement indiqué par la variable d'environnement PGSERVICEFILE. Il peut aussi être un fichier global au système dans le répertoire - etc/pg_service.conf ou dans le répertoire indiqué par + `pg_config --sysconfdir`/pg_service.conf ou dans le répertoire indiqué par la variable d'environnement PGSYSCONFDIR. Si les définitions de service de même nom existent dans le fichier utilisateur et système, le fichier utilisateur est utilisé. diff --git a/postgresql/maintenance.xml b/postgresql/maintenance.xml index b44e3e53d..4c8902ea0 100644 --- a/postgresql/maintenance.xml +++ b/postgresql/maintenance.xml @@ -762,10 +762,13 @@ HINT: Stop the postmaster and use a standalone backend to VACUUM in "mydb". - Lorsque plusieurs processus autovacuum sont en cours d'exécution, la - limite de coût est répartie parmi tous les processus pour - que l'impact total sur le système soit identique quelque soit le nombre - de processus en cours d'exécution. + Lorsque plusieurs processus autovacuum sont en cours d'exécution, les + paramètres de délai par coût est répartie parmi tous les processus pour + que l'impact total au niveau entrées/sorties disques sur le système soit identique quelque soit le nombre + de processus en cours d'exécution. However, any workers processing tables whose + autovacuum_vacuum_cost_delay or + autovacuum_vacuum_cost_limit have been set are not considered + in the balancing algorithm. diff --git a/postgresql/pageinspect.xml b/postgresql/pageinspect.xml index b1cc76e0f..2262b02be 100644 --- a/postgresql/pageinspect.xml +++ b/postgresql/pageinspect.xml @@ -29,13 +29,14 @@ - get_raw_page lit le bloc spécifié de la table nommée + get_raw_page lit le bloc spécifié de la relation nommée et renvoie une copie en tant que valeur de type bytea. Ceci permet la récupération de la copie cohérente à un instant t d'un bloc spécifique. fork devrait être 'main' pour les - données, et 'fsm' pour la carte des espaces libres, ou - 'vm' pour la carte de visibilité. + données, et 'fsm' pour la carte des espaces libres, + 'vm' pour la carte de visibilité, ou 'init' + pour la partie initialisation. diff --git a/postgresql/pgcrypto.xml b/postgresql/pgcrypto.xml index 216106bff..d242050d6 100644 --- a/postgresql/pgcrypto.xml +++ b/postgresql/pgcrypto.xml @@ -756,7 +756,7 @@ - enable-session-key + sess-key Utilise la clé de session séparée. Le chiffrement par clé publique utilise diff --git a/postgresql/plpgsql.xml b/postgresql/plpgsql.xml index 403c8815f..ba6e74d94 100644 --- a/postgresql/plpgsql.xml +++ b/postgresql/plpgsql.xml @@ -493,8 +493,8 @@ $$ LANGUAGE plpgsql; CREATE FUNCTION extended_sales(p_itemno int) RETURNS TABLE(quantity int, total numeric) AS $$ BEGIN - RETURN QUERY SELECT quantity, quantity * price FROM sales - WHERE itemno = p_itemno; + RETURN QUERY SELECT s.quantity, s.quantity * s.price FROM sales AS s + WHERE s.itemno = p_itemno; END; $$ LANGUAGE plpgsql;
diff --git a/postgresql/plpython.xml b/postgresql/plpython.xml index ab718e07a..45d6e3da1 100644 --- a/postgresql/plpython.xml +++ b/postgresql/plpython.xml @@ -1040,7 +1040,11 @@ rv = plpy.execute(plan, ["name"], 5) ). Par exemple : CREATE FUNCTION usesavedplan() RETURNS trigger AS $$ - plan = SD.setdefault("plan", plpy.prepare("SELECT 1")) + if "plan" in SD: + plan = SD["plan"] + else: + plan = plpy.prepare("SELECT 1") + SD["plan"] = plan # reste de la fonction $$ LANGUAGE plpythonu; diff --git a/postgresql/queries.xml b/postgresql/queries.xml index 3cd1159b9..1a83f934e 100644 --- a/postgresql/queries.xml +++ b/postgresql/queries.xml @@ -111,14 +111,16 @@ et utiliser la commande SELECT comme une calculatrice : référence dont les tables sont séparées par des virgules. FROM reference_table , reference_table , ... - Une référence de table pourrait être un nom de table (avec en option - le nom du schéma) ou une table dérivée comme une sous-requête, une table - jointe ou une combinaison complexe de celles-ci. Si plus d'une référence de - tables est listée dans la clause FROM, elle sont jointes pour - former une table virtuelle intermédiaire qui pourrait être le sujet des + Une référence de table pourrait être un nom de table (avec en option le nom + du schéma) ou une table dérivée comme une sous-requête, une construction + JOIN ou une combinaison complexe de celles-ci. Si plus + d'une référence de tables est listée dans la clause FROM, + les tables sont jointes (autrement dit le produit cartésien de leurs lignes + est réalisé ; voir ci-dessous). Le résultat du FROM + forme une table virtuelle intermédiaire qui pourrait être le sujet des transformations des clauses WHERE, GROUP BY - et HAVING, et est finalement le résultat des expressions de - table. + et HAVING, et est finalement le résultat des expressions + de table. @@ -157,6 +159,16 @@ et utiliser la commande SELECT comme une calculatrice : dérivées) suivant les règles du type de jointure particulier. Les jointures internes (inner), externes (outer) et croisées (cross) sont disponibles. + The general syntax of a joined table is + +T1 join_type T2 join_condition + + Joins of all types can be chained together, or nested: either or + both T1 and + T2 can be joined tables. Parentheses + can be used around JOIN clauses to control the join + order. In the absence of parentheses, JOIN clauses + nest left-to-right. @@ -204,6 +216,26 @@ et utiliser la commande SELECT comme une calculatrice : T2. C'est aussi équivalent à FROM T1 INNER JOIN T2 ON TRUE (voir ci-dessous). + It is also equivalent to + FROM T1, + T2. + + + This latter equivalence does not hold exactly when more than two + tables appear, because JOIN binds more tightly than + comma. For example + FROM T1 CROSS JOIN + T2 INNER JOIN T3 + ON condition + is not the same as + FROM T1, + T2 INNER JOIN T3 + ON condition + because the condition can + reference T1 in the first case but not + the second. + + @@ -251,55 +283,6 @@ et utiliser la commande SELECT comme une calculatrice : comme l'explique le paragraphe ci-dessous. - - La clause ON est le type le plus général de condition de - jointure : il prend une expression booléenne du même genre que - celle utilisée dans une clause WHERE. Une paires de lignes - de T1 et T2 correspondent si - l'expression ON est évaluée à vraie (true) pour ces deux - lignes. - - - - USING est la notation raccourcie : elle prend une - liste de noms de colonnes, séparés par des virgules, que les tables - jointes ont en commun, et forme une condition de jointure spécifiant - l'égalité de chacune de ces paires de colonnes. De plus, la sortie de - JOIN USING a une colonne pour chaque paires égales des - colonnes en entrée, suivies par toutes les autres colonnes de chaque - table. Du coup, USING (a, b, c) est équivalent à - ON (t1.a = t2.a AND t1.b = t2.b AND t1.c = t2.c) avec - l'exception que si ON est utilisé, il y aura deux colonnes - a, b, puis c dans le résultat, alors - qu'avec USING, il n'y en aurait eu qu'une de chaque - (et elles apparaîtront en premier si SELECT * est - utilisé). - - - - - join - natural - - - natural join - - - jointure - naturelle - - - jointure naturelle - - Enfin, NATURAL est un format raccourci de - USING : il forme une liste USING - consistant de tous les noms de colonnes apparaissant à la fois dans - les deux tables en entrée. Comme avec USING, ces colonnes - apparaissent seulement une fois dans la table de sortie. S'il n'y - a pas de colonnes communes, NATURAL se comporte - comme CROSS JOIN. - - Les types possibles de jointures qualifiées sont : @@ -396,20 +379,71 @@ et utiliser la commande SELECT comme une calculatrice : - + + + La clause ON est le type le plus général de condition de + jointure : il prend une expression booléenne du même genre que + celle utilisée dans une clause WHERE. Une paires de lignes + de T1 et T2 correspondent si + l'expression ON est évaluée à vraie (true) pour ces deux + lignes. + + + + The USING clause is a shorthand that allows you to take + advantage of the specific situation where both sides of the join use + the same name for the joining column(s). It takes a + comma-separated list of the shared column names + and forms a join condition that includes an equality comparison + for each one. For example, joining T1 + and T2 with USING (a, b) produces + the join condition ON T1.a + = T2.a AND T1.b + = T2.b. + + + + Furthermore, the output of JOIN USING suppresses + redundant columns: there is no need to print both of the matched + columns, since they must have equal values. While JOIN + ON produces all columns from T1 followed by all + columns from T2, JOIN USING produces one + output column for each of the listed column pairs (in the listed + order), followed by any remaining columns from T1, + followed by any remaining columns from T2. + + + + + join + natural + + + natural join + + Finally, NATURAL is a shorthand form of + USING: it forms a USING list + consisting of all column names that appear in both + input tables. As with USING, these columns appear + only once in the output table. If there are no common + column names, NATURAL behaves like + CROSS JOIN. + + + + + USING is reasonably safe from column changes + in the joined relations since only the listed columns + are combined. NATURAL is considerably more risky since + any schema changes to either relation that cause a new matching + column name to be present will cause the join to combine that new + column as well. + + + - - Les jointures de tous les types peuvent être chaînées ensemble ou - imbriquées : soit les deux soit une des deux, parmi - T1 et T2, peuvent - être des tables. Les parenthèses peuvent être utilisées autour des clauses - JOIN pour contrôler l'ordre de jointure. En l'absence de - parenthèses, les clauses JOIN sont imbriquées de gauche à - droite. - - Pour rassembler tout ceci, supposons que nous avons une table t1 : @@ -519,6 +553,8 @@ et utiliser la commande SELECT comme une calculatrice : ON est traitée avant la jointure alors qu'une restriction placée dans la clause WHERE est traitée après la jointure. + That does not matter with inner joins, but it matters a lot with outer + joins. diff --git a/postgresql/ref/create_sequence.xml b/postgresql/ref/create_sequence.xml index de34c1f36..c5e8b3683 100644 --- a/postgresql/ref/create_sequence.xml +++ b/postgresql/ref/create_sequence.xml @@ -227,11 +227,7 @@ Les séquences sont fondées sur l'arithmétique bigint, leur échelle ne peut donc pas excéder l'échelle d'un entier sur huit octets - (-9223372036854775808 à 9223372036854775807). Sur certaines vieilles - plateformes, il peut ne pas y avoir de support compilateur pour les - entiers codés sur huit octets. Dans ce cas les séquences utilisent l'arithmétique - des entiers traditionnels (type integer) (de -2147483648 à - +2147483647). + (de -9223372036854775808 à 9223372036854775807). diff --git a/postgresql/ref/psql-ref.xml b/postgresql/ref/psql-ref.xml index c7d6638ed..24156ad07 100644 --- a/postgresql/ref/psql-ref.xml +++ b/postgresql/ref/psql-ref.xml @@ -54,9 +54,9 @@ - Affiche toutes les lignes en entrée sur la sortie standard lorsqu'elles - sont lues. Ceci est plus utile dans le traitement de scripts que dans - le mode interactif. C'est équivalent à initialiser la variable + Affiche toutes les lignes non vides en entrée sur la sortie standard + lorsqu'elles sont lues. (This does not apply to lines read + interactively.) C'est équivalent à initialiser la variable ECHO à all. @@ -170,7 +170,7 @@ EOF commandes antislash. Vous pouvez utiliser ceci pour étudier les opérations internes de psql. Ceci est équivalent à initialiser la variable ECHO_HIDDEN - dans psql. + à on. @@ -278,7 +278,7 @@ EOF - N'utilise pas readline pour l'édition de ligne et n'utilise pas + N'utilise pas Readline pour l'édition de ligne et n'utilise pas l'historique. Ceci est utile quand on veut désactiver la gestion de la tabulation pour l'action copie/colle. @@ -337,9 +337,9 @@ EOF Indique que psql doit travailler silencieusement. Par défaut, il affiche des messages de bienvenue et des informations diverses. Si cette option est utilisée, rien de ceci - n'est affiché. C'est utile avec l'option . À l'intérieur - de psql, vous pouvez aussi initialiser la - variable QUIET pour arriver au même effet. + n'est affiché. C'est utile avec l'option . C'est + équivalent à configurer la variable QUIET à + on. @@ -634,7 +634,8 @@ EOF défaut est déterminé au moment de la compilation. Comme le serveur de bases de données utilise la même valeur par défaut, vous n'aurez pas besoin de spécifier le port dans la plupart des cas. Le nom de l'utilisateur par - défaut est votre nom d'utilisateur Unix, de même pour le nom de la base de + défaut est votre nom d'utilisateur du système d'exploitation, de même pour + le nom de la base de données par défaut. Notez que vous ne pouvez pas simplement vous connecter à n'importe quelle base de données avec n'importe quel nom d'utilisateur. Votre administrateur de bases de données doit vous avoir informé de vos droits @@ -1668,17 +1669,14 @@ Tue Oct 26 21:40:57 CEST 1999 - \g [ { nomfichier | - |commande } ] - + \g [ nomfichier ] + \g [ |commande ] Envoie le tampon de requête en entrée vers le serveur et stocke en option la sortie de la requête dans nomfichier ou envoie dans un tube la - sortie vers un autre shell Unix exécutant commande. Un simple \g est virtuellement équivalent à un point-virgule. Un \g avec argument est une alternative en un @@ -1713,7 +1711,7 @@ Tue Oct 26 21:40:57 CEST 1999 - \H + \H ou \html Active le format d'affichage HTML des requêtes. Si @@ -1727,8 +1725,8 @@ Tue Oct 26 21:40:57 CEST 1999 - \i nomfichier + \i ou \include nomfichier Lit l'entrée à partir du fichier - \ir nom_fichier + \ir ou \include_relative nom_fichier La commande \ir est similaire à \i, @@ -1865,19 +1863,15 @@ lo_import 152801 - \o [ {nomfichier | - |commande} ] - + \o or \out [ nomfichier ] + \o or \out [ |commande ] - Sauvegarde les résultats des requêtes suivantes dans le fichier nomfichier ou envoie via un tube les - résultats à venir dans un shell Unix séparé pour exécuter command. Si aucun argument n'est - spécifié, l'affichage de la requête est redirigé vers la sortie - standard. + Arranges to save future query results to the file filename or pipe future results + to the shell command command. If no argument is + specified, the query output is reset to the standard output. @@ -1899,7 +1893,7 @@ lo_import 152801 - \p + \p ou \print Affiche le tampon de requête actuel sur la sortie standard. @@ -2330,7 +2324,7 @@ lo_import 152801 - \r + \r ou \reset Réinitialise (efface) le tampon de requêtes. @@ -2344,12 +2338,13 @@ lo_import 152801 class="parameter">nomfichier ] - Affiche ou sauvegarde l'historique des lignes de commandes dans - nomfichier. Si nomfichier est omis, l'historique est - écrit sur la sortie standard. Cette option est seulement disponible si - psql est configuré pour utiliser la - bibliothèque GNU Readline. + Print psql's command line history + to filename. + If filename is omitted, + the history is written to the standard output (using the pager if + appropriate). This command is not available + if psql was built + without Readline support. @@ -2402,7 +2397,7 @@ lo_import 152801 - \setenv [ nom [ valeur ] ] + \setenv nom [ valeur ] @@ -2496,13 +2491,13 @@ testdb=> \setenv LESS -imx4F - \w nomfichier - \w |commande + \w ou \write nomfichier + \w ou \write |commande Place le tampon de requête en cours dans le fichier nomfichier ou l'envoie via un tube à la - commande Unix commande. + commande shell commande. @@ -2543,7 +2538,7 @@ testdb=> \setenv LESS -imx4F class="parameter">commande ] - Lance un shell Unix séparé ou exécute la commande Unix + Lance un shell Unix séparé ou exécute la commande shell commande. Les arguments ne sont pas interprétés, le shell les voit tel quel. @@ -2799,14 +2794,13 @@ bar ECHO - Si cette variable est initialisée à all, toutes les lignes saisies - au clavier ou provenant d'un script sont écrites sur la sortie standard avant - d'être analysées ou exécutées. Pour sélectionner ce comportement au - lancement du programme, utilisez l'option . Si - ECHO vaut queries, - psql - affiche simplement toutes les requêtes au moment de leur envoi au - serveur. L'option pour ceci est . + Si cette variable est initialisée à all, toutes les lignes + non vides en entrées sont écrites sur la sortie standard comme elles sont + lues (ceci ne s'applique pas aux lignes lues interactivement). Pour + sélectionner ce comportement au lancement du programme, utilisez l'option + . Si ECHO vaut queries, + psql affiche chaque requête sur la sortie standard + tel qu'elle est envoyée au serveur. L'option pour ceci est . @@ -2815,7 +2809,7 @@ bar ECHO_HIDDEN - Quand cette variable est initialisée et qu'une commande antislash est + Quand cette variable est initialisée à on et qu'une commande antislash est envoyée à la base de données, la requête est d'abord affichée. De cette façon, vous pouvez étudier le fonctionnement interne de PostgreSQL et fournir des fonctionnalités @@ -3045,9 +3039,9 @@ bar QUIET - Cette variable est équivalente à l'option en ligne - de commande. Elle n'est probablement pas très utile en mode - interactif. + Configurer cette variable à on est équivalent à l'option + en ligne de commande. Elle n'est probablement pas très + utile en mode interactif. @@ -3056,8 +3050,8 @@ bar SINGLELINE - Cette variable est équivalente à l'option en ligne - de commande. + Configurer cette variable à on est équivalent à l'option + en ligne de commande. @@ -3066,8 +3060,8 @@ bar SINGLESTEP - Cette variable est équivalente à l'option en ligne - de commande. + Configurer cette variable à on est équivalente à l'option + en ligne de commande. diff --git a/postgresql/regress.xml b/postgresql/regress.xml index 8207f63e2..408669031 100644 --- a/postgresql/regress.xml +++ b/postgresql/regress.xml @@ -54,20 +54,6 @@ représente un problème sérieux. - - - Sur les systèmes ne disposant pas de sockets de domaine Unix, la méthode de - tests démarre un serveur temporaire configuré pour accepter toute connexion - provenant de la machine locale. Tout utilisateur local peut obtenir les - droits superutilisateur de la base de données en se connectant à ce serveur - et pourrait en principe exploiter tous les droits de l'utilisateur du système - d'exploitation exécutant les tests. De ce fait, il n'est pas recommandé - d'utiliser gmake check sur un système partagé avec - d'autres utilisateurs. À la place, lancez les tests après avoir terminé - l'installation, comme indiqué dans la section suivante. - - - Comme cette méthode de tests exécute un serveur temporaire, cela ne fonctionnera pas si vous avez construit le serveur en tant que root, étant diff --git a/postgresql/release-9.0.xml b/postgresql/release-9.0.xml index f7ded6c0a..0ff1736d6 100644 --- a/postgresql/release-9.0.xml +++ b/postgresql/release-9.0.xml @@ -2,6 +2,732 @@ + + Release 9.0.19 + + + Release Date + 2015-02-05 + + + + This release contains a variety of fixes from 9.0.18. + For information about new features in the 9.0 major release, see + . + + + + Migration to Version 9.0.19 + + + A dump/restore is not required for those running 9.0.X. + + + + However, if you are upgrading from a version earlier than 9.0.18, + see . + + + + + + Changes + + + + + + Fix buffer overruns in to_char() + (Bruce Momjian) + + + + When to_char() processes a numeric formatting template + calling for a large number of digits, PostgreSQL + would read past the end of a buffer. When processing a crafted + timestamp formatting template, PostgreSQL would write + past the end of a buffer. Either case could crash the server. + We have not ruled out the possibility of attacks that lead to + privilege escalation, though they seem unlikely. + (CVE-2015-0241) + + + + + + Fix buffer overrun in replacement *printf() functions + (Tom Lane) + + + + PostgreSQL includes a replacement implementation + of printf and related functions. This code will overrun + a stack buffer when formatting a floating point number (conversion + specifiers e, E, f, F, + g or G) with requested precision greater than + about 500. This will crash the server, and we have not ruled out the + possibility of attacks that lead to privilege escalation. + A database user can trigger such a buffer overrun through + the to_char() SQL function. While that is the only + affected core PostgreSQL functionality, extension + modules that use printf-family functions may be at risk as well. + + + + This issue primarily affects PostgreSQL on Windows. + PostgreSQL uses the system implementation of these + functions where adequate, which it is on other modern platforms. + (CVE-2015-0242) + + + + + + Fix buffer overruns in contrib/pgcrypto + (Marko Tiikkaja, Noah Misch) + + + + Errors in memory size tracking within the pgcrypto + module permitted stack buffer overruns and improper dependence on the + contents of uninitialized memory. The buffer overrun cases can + crash the server, and we have not ruled out the possibility of + attacks that lead to privilege escalation. + (CVE-2015-0243) + + + + + + Fix possible loss of frontend/backend protocol synchronization after + an error + (Heikki Linnakangas) + + + + If any error occurred while the server was in the middle of reading a + protocol message from the client, it could lose synchronization and + incorrectly try to interpret part of the message's data as a new + protocol message. An attacker able to submit crafted binary data + within a command parameter might succeed in injecting his own SQL + commands this way. Statement timeout and query cancellation are the + most likely sources of errors triggering this scenario. Particularly + vulnerable are applications that use a timeout and also submit + arbitrary user-crafted data as binary query parameters. Disabling + statement timeout will reduce, but not eliminate, the risk of + exploit. Our thanks to Emil Lenngren for reporting this issue. + (CVE-2015-0244) + + + + + + Fix information leak via constraint-violation error messages + (Stephen Frost) + + + + Some server error messages show the values of columns that violate + a constraint, such as a unique constraint. If the user does not have + SELECT privilege on all columns of the table, this could + mean exposing values that the user should not be able to see. Adjust + the code so that values are displayed only when they came from the SQL + command or could be selected by the user. + (CVE-2014-8161) + + + + + + Lock down regression testing's temporary installations on Windows + (Noah Misch) + + + + Use SSPI authentication to allow connections only from the OS user + who launched the test suite. This closes on Windows the same + vulnerability previously closed on other platforms, namely that other + users might be able to connect to the test postmaster. + (CVE-2014-0067) + + + + + + Avoid possible data corruption if ALTER DATABASE SET + TABLESPACE is used to move a database to a new tablespace and then + shortly later move it back to its original tablespace (Tom Lane) + + + + + + Avoid corrupting tables when ANALYZE inside a transaction + is rolled back (Andres Freund, Tom Lane, Michael Paquier) + + + + If the failing transaction had earlier removed the last index, rule, or + trigger from the table, the table would be left in a corrupted state + with the relevant pg_class flags not set though they + should be. + + + + + + Fix use-of-already-freed-memory problem in EvalPlanQual processing + (Tom Lane) + + + + In READ COMMITTED mode, queries that lock or update + recently-updated rows could crash as a result of this bug. + + + + + + Fix planning of SELECT FOR UPDATE when using a partial + index on a child table (Kyotaro Horiguchi) + + + + In READ COMMITTED mode, SELECT FOR UPDATE must + also recheck the partial index's WHERE condition when + rechecking a recently-updated row to see if it still satisfies the + query's WHERE condition. This requirement was missed if the + index belonged to an inheritance child table, so that it was possible + to incorrectly return rows that no longer satisfy the query condition. + + + + + + Fix corner case wherein SELECT FOR UPDATE could return a row + twice, and possibly miss returning other rows (Tom Lane) + + + + In READ COMMITTED mode, a SELECT FOR UPDATE + that is scanning an inheritance tree could incorrectly return a row + from a prior child table instead of the one it should return from a + later child table. + + + + + + Reject duplicate column names in the referenced-columns list of + a FOREIGN KEY declaration (David Rowley) + + + + This restriction is per SQL standard. Previously we did not reject + the case explicitly, but later on the code would fail with + bizarre-looking errors. + + + + + + Fix bugs in raising a numeric value to a large integral power + (Tom Lane) + + + + The previous code could get a wrong answer, or consume excessive + amounts of time and memory before realizing that the answer must + overflow. + + + + + + In numeric_recv(), truncate away any fractional digits + that would be hidden according to the value's dscale field + (Tom Lane) + + + + A numeric value's display scale (dscale) should + never be less than the number of nonzero fractional digits; but + apparently there's at least one broken client application that + transmits binary numeric values in which that's true. + This leads to strange behavior since the extra digits are taken into + account by arithmetic operations even though they aren't printed. + The least risky fix seems to be to truncate away such hidden + digits on receipt, so that the value is indeed what it prints as. + + + + + + Reject out-of-range numeric timezone specifications (Tom Lane) + + + + Simple numeric timezone specifications exceeding +/- 168 hours (one + week) would be accepted, but could then cause null-pointer dereference + crashes in certain operations. There's no use-case for such large UTC + offsets, so reject them. + + + + + + Fix bugs in tsquery @> tsquery + operator (Heikki Linnakangas) + + + + Two different terms would be considered to match if they had the same + CRC. Also, if the second operand had more terms than the first, it + would be assumed not to be contained in the first; which is wrong + since it might contain duplicate terms. + + + + + + Improve ispell dictionary's defenses against bad affix files (Tom Lane) + + + + + + Allow more than 64K phrases in a thesaurus dictionary (David Boutin) + + + + The previous coding could crash on an oversize dictionary, so this was + deemed a back-patchable bug fix rather than a feature addition. + + + + + + Fix namespace handling in xpath() (Ali Akbar) + + + + Previously, the xml value resulting from + an xpath() call would not have namespace declarations if + the namespace declarations were attached to an ancestor element in the + input xml value, rather than to the specific element being + returned. Propagate the ancestral declaration so that the result is + correct when considered in isolation. + + + + + + Fix planner problems with nested append relations, such as inherited + tables within UNION ALL subqueries (Tom Lane) + + + + + + Fail cleanly when a GiST index tuple doesn't fit on a page, rather + than going into infinite recursion (Andrew Gierth) + + + + + + Exempt tables that have per-table cost_limit + and/or cost_delay settings from autovacuum's global cost + balancing rules (Álvaro Herrera) + + + + The previous behavior resulted in basically ignoring these per-table + settings, which was unintended. Now, a table having such settings + will be vacuumed using those settings, independently of what is going + on in other autovacuum workers. This may result in heavier total I/O + load than before, so such settings should be re-examined for sanity. + + + + + + Avoid wholesale autovacuuming when autovacuum is nominally off + (Tom Lane) + + + + Even when autovacuum is nominally off, we will still launch autovacuum + worker processes to vacuum tables that are at risk of XID wraparound. + However, such a worker process then proceeded to vacuum all tables in + the target database, if they met the usual thresholds for + autovacuuming. This is at best pretty unexpected; at worst it delays + response to the wraparound threat. Fix it so that if autovacuum is + turned off, workers only do anti-wraparound vacuums and + not any other work. + + + + + + Fix race condition between hot standby queries and replaying a + full-page image (Heikki Linnakangas) + + + + This mistake could result in transient errors in queries being + executed in hot standby. + + + + + + Fix several cases where recovery logic improperly ignored WAL records + for COMMIT/ABORT PREPARED (Heikki Linnakangas) + + + + The most notable oversight was + that recovery_min_apply_delay failed to delay application + of a two-phase commit. + + + + + + Avoid creating unnecessary .ready marker files for + timeline history files (Fujii Masao) + + + + + + Fix possible null pointer dereference when an empty prepared statement + is used and the log_statement setting is mod + or ddl (Fujii Masao) + + + + + + Change pgstat wait timeout warning message to be LOG level, + and rephrase it to be more understandable (Tom Lane) + + + + This message was originally thought to be essentially a can't-happen + case, but it occurs often enough on our slower buildfarm members to be + a nuisance. Reduce it to LOG level, and expend a bit more effort on + the wording: it now reads using stale statistics instead of + current ones because stats collector is not responding. + + + + + + Fix SPARC spinlock implementation to ensure correctness if the CPU is + being run in a non-TSO coherency mode, as some non-Solaris kernels do + (Andres Freund) + + + + + + Warn if OS X's setlocale() starts an unwanted extra + thread inside the postmaster (Noah Misch) + + + + + + Fix processing of repeated dbname parameters + in PQconnectdbParams() (Alex Shulgin) + + + + Unexpected behavior ensued if the first occurrence + of dbname contained a connection string or URI to be + expanded. + + + + + + Ensure that libpq reports a suitable error message on + unexpected socket EOF (Marko Tiikkaja, Tom Lane) + + + + Depending on kernel behavior, libpq might return an + empty error string rather than something useful when the server + unexpectedly closed the socket. + + + + + + Clear any old error message during PQreset() + (Heikki Linnakangas) + + + + If PQreset() is called repeatedly, and the connection + cannot be re-established, error messages from the failed connection + attempts kept accumulating in the PGconn's error + string. + + + + + + Properly handle out-of-memory conditions while parsing connection + options in libpq (Alex Shulgin, Heikki Linnakangas) + + + + + + Fix array overrun in ecpg's version + of ParseDateTime() (Michael Paquier) + + + + + + In initdb, give a clearer error message if a password + file is specified but is empty (Mats Erik Andersson) + + + + + + Fix psql's \s command to work nicely with + libedit, and add pager support (Stepan Rutz, Tom Lane) + + + + When using libedit rather than readline, \s printed the + command history in a fairly unreadable encoded format, and on recent + libedit versions might fail altogether. Fix that by printing the + history ourselves rather than having the library do it. A pleasant + side-effect is that the pager is used if appropriate. + + + + This patch also fixes a bug that caused newline encoding to be applied + inconsistently when saving the command history with libedit. + Multiline history entries written by older psql + versions will be read cleanly with this patch, but perhaps not + vice versa, depending on the exact libedit versions involved. + + + + + + Improve consistency of parsing of psql's special + variables (Tom Lane) + + + + Allow variant spellings of on and off (such + as 1/0) for ECHO_HIDDEN + and ON_ERROR_ROLLBACK. Report a warning for unrecognized + values for COMP_KEYWORD_CASE, ECHO, + ECHO_HIDDEN, HISTCONTROL, + ON_ERROR_ROLLBACK, and VERBOSITY. Recognize + all values for all these variables case-insensitively; previously + there was a mishmash of case-sensitive and case-insensitive behaviors. + + + + + + Fix psql's expanded-mode display to work + consistently when using border = 3 + and linestyle = ascii or unicode + (Stephen Frost) + + + + + + Fix possible deadlock during parallel restore of a schema-only dump + (Robert Haas, Tom Lane) + + + + + + Fix core dump in pg_dump --binary-upgrade on zero-column + composite type (Rushabh Lathia) + + + + + + Fix block number checking + in contrib/pageinspect's get_raw_page() + (Tom Lane) + + + + The incorrect checking logic could prevent access to some pages in + non-main relation forks. + + + + + + Fix contrib/pgcrypto's pgp_sym_decrypt() + to not fail on messages whose length is 6 less than a power of 2 + (Marko Tiikkaja) + + + + + + Handle unexpected query results, especially NULLs, safely in + contrib/tablefunc's connectby() + (Michael Paquier) + + + + connectby() previously crashed if it encountered a NULL + key value. It now prints that row but doesn't recurse further. + + + + + + Avoid a possible crash in contrib/xml2's + xslt_process() (Mark Simonetti) + + + + libxslt seems to have an undocumented dependency on + the order in which resources are freed; reorder our calls to avoid a + crash. + + + + + + Numerous cleanups of warnings from Coverity static code analyzer + (Andres Freund, Tatsuo Ishii, Marko Kreen, Tom Lane, Michael Paquier) + + + + These changes are mostly cosmetic but in some cases fix corner-case + bugs, for example a crash rather than a proper error report after an + out-of-memory failure. None are believed to represent security + issues. + + + + + + Detect incompatible OpenLDAP versions during build (Noah Misch) + + + + With OpenLDAP versions 2.4.24 through 2.4.31, + inclusive, PostgreSQL backends can crash at exit. + Raise a warning during configure based on the + compile-time OpenLDAP version number, and test the crashing scenario + in the contrib/dblink regression test. + + + + + + In non-MSVC Windows builds, ensure libpq.dll is installed + with execute permissions (Noah Misch) + + + + + + Make pg_regress remove any temporary installation it + created upon successful exit (Tom Lane) + + + + This results in a very substantial reduction in disk space usage + during make check-world, since that sequence involves + creation of numerous temporary installations. + + + + + + Support time zone abbreviations that change UTC offset from time to + time (Tom Lane) + + + + Previously, PostgreSQL assumed that the UTC offset + associated with a time zone abbreviation (such as EST) + never changes in the usage of any particular locale. However this + assumption fails in the real world, so introduce the ability for a + zone abbreviation to represent a UTC offset that sometimes changes. + Update the zone abbreviation definition files to make use of this + feature in timezone locales that have changed the UTC offset of their + abbreviations since 1970 (according to the IANA timezone database). + In such timezones, PostgreSQL will now associate the + correct UTC offset with the abbreviation depending on the given date. + + + + + + Update time zone abbreviations lists (Tom Lane) + + + + Add CST (China Standard Time) to our lists. + Remove references to ADT as Arabia Daylight Time, an + abbreviation that's been out of use since 2007; therefore, claiming + there is a conflict with Atlantic Daylight Time doesn't seem + especially helpful. + Fix entirely incorrect GMT offsets for CKT (Cook Islands), FJT, and FJST + (Fiji); we didn't even have them on the proper side of the date line. + + + + + + Update time zone data files to tzdata release 2015a. + + + + The IANA timezone database has adopted abbreviations of the form + AxST/AxDT + for all Australian time zones, reflecting what they believe to be + current majority practice Down Under. These names do not conflict + with usage elsewhere (other than ACST for Acre Summer Time, which has + been in disuse since 1994). Accordingly, adopt these names into + our Default timezone abbreviation set. + The Australia abbreviation set now contains only CST, EAST, + EST, SAST, SAT, and WST, all of which are thought to be mostly + historical usage. Note that SAST has also been changed to be South + Africa Standard Time in the Default abbreviation set. + + + + Also, add zone abbreviations SRET (Asia/Srednekolymsk) and XJT + (Asia/Urumqi), and use WSST/WSDT for western Samoa. Also, there were + DST law changes in Chile, Mexico, the Turks & Caicos Islands + (America/Grand_Turk), and Fiji. There is a new zone + Pacific/Bougainville for portions of Papua New Guinea. Also, numerous + corrections for historical (pre-1970) time zone data. + + + + + + + + Release 9.0.18 diff --git a/postgresql/release-9.1.xml b/postgresql/release-9.1.xml index 1b7be890e..09c5cb9d6 100644 --- a/postgresql/release-9.1.xml +++ b/postgresql/release-9.1.xml @@ -2,6 +2,816 @@ + + Release 9.1.15 + + + Release Date + 2015-02-05 + + + + This release contains a variety of fixes from 9.1.14. + For information about new features in the 9.1 major release, see + . + + + + Migration to Version 9.1.15 + + + A dump/restore is not required for those running 9.1.X. + + + + However, if you are upgrading from a version earlier than 9.1.14, + see . + + + + + + Changes + + + + + + Fix buffer overruns in to_char() + (Bruce Momjian) + + + + When to_char() processes a numeric formatting template + calling for a large number of digits, PostgreSQL + would read past the end of a buffer. When processing a crafted + timestamp formatting template, PostgreSQL would write + past the end of a buffer. Either case could crash the server. + We have not ruled out the possibility of attacks that lead to + privilege escalation, though they seem unlikely. + (CVE-2015-0241) + + + + + + Fix buffer overrun in replacement *printf() functions + (Tom Lane) + + + + PostgreSQL includes a replacement implementation + of printf and related functions. This code will overrun + a stack buffer when formatting a floating point number (conversion + specifiers e, E, f, F, + g or G) with requested precision greater than + about 500. This will crash the server, and we have not ruled out the + possibility of attacks that lead to privilege escalation. + A database user can trigger such a buffer overrun through + the to_char() SQL function. While that is the only + affected core PostgreSQL functionality, extension + modules that use printf-family functions may be at risk as well. + + + + This issue primarily affects PostgreSQL on Windows. + PostgreSQL uses the system implementation of these + functions where adequate, which it is on other modern platforms. + (CVE-2015-0242) + + + + + + Fix buffer overruns in contrib/pgcrypto + (Marko Tiikkaja, Noah Misch) + + + + Errors in memory size tracking within the pgcrypto + module permitted stack buffer overruns and improper dependence on the + contents of uninitialized memory. The buffer overrun cases can + crash the server, and we have not ruled out the possibility of + attacks that lead to privilege escalation. + (CVE-2015-0243) + + + + + + Fix possible loss of frontend/backend protocol synchronization after + an error + (Heikki Linnakangas) + + + + If any error occurred while the server was in the middle of reading a + protocol message from the client, it could lose synchronization and + incorrectly try to interpret part of the message's data as a new + protocol message. An attacker able to submit crafted binary data + within a command parameter might succeed in injecting his own SQL + commands this way. Statement timeout and query cancellation are the + most likely sources of errors triggering this scenario. Particularly + vulnerable are applications that use a timeout and also submit + arbitrary user-crafted data as binary query parameters. Disabling + statement timeout will reduce, but not eliminate, the risk of + exploit. Our thanks to Emil Lenngren for reporting this issue. + (CVE-2015-0244) + + + + + + Fix information leak via constraint-violation error messages + (Stephen Frost) + + + + Some server error messages show the values of columns that violate + a constraint, such as a unique constraint. If the user does not have + SELECT privilege on all columns of the table, this could + mean exposing values that the user should not be able to see. Adjust + the code so that values are displayed only when they came from the SQL + command or could be selected by the user. + (CVE-2014-8161) + + + + + + Lock down regression testing's temporary installations on Windows + (Noah Misch) + + + + Use SSPI authentication to allow connections only from the OS user + who launched the test suite. This closes on Windows the same + vulnerability previously closed on other platforms, namely that other + users might be able to connect to the test postmaster. + (CVE-2014-0067) + + + + + + Avoid possible data corruption if ALTER DATABASE SET + TABLESPACE is used to move a database to a new tablespace and then + shortly later move it back to its original tablespace (Tom Lane) + + + + + + Avoid corrupting tables when ANALYZE inside a transaction + is rolled back (Andres Freund, Tom Lane, Michael Paquier) + + + + If the failing transaction had earlier removed the last index, rule, or + trigger from the table, the table would be left in a corrupted state + with the relevant pg_class flags not set though they + should be. + + + + + + Ensure that unlogged tables are copied correctly + during CREATE DATABASE or ALTER DATABASE SET + TABLESPACE (Pavan Deolasee, Andres Freund) + + + + + + Fix DROP's dependency searching to correctly handle the + case where a table column is recursively visited before its table + (Petr Jelinek, Tom Lane) + + + + This case is only known to arise when an extension creates both a + datatype and a table using that datatype. The faulty code might + refuse a DROP EXTENSION unless CASCADE is + specified, which should not be required. + + + + + + Fix use-of-already-freed-memory problem in EvalPlanQual processing + (Tom Lane) + + + + In READ COMMITTED mode, queries that lock or update + recently-updated rows could crash as a result of this bug. + + + + + + Fix planning of SELECT FOR UPDATE when using a partial + index on a child table (Kyotaro Horiguchi) + + + + In READ COMMITTED mode, SELECT FOR UPDATE must + also recheck the partial index's WHERE condition when + rechecking a recently-updated row to see if it still satisfies the + query's WHERE condition. This requirement was missed if the + index belonged to an inheritance child table, so that it was possible + to incorrectly return rows that no longer satisfy the query condition. + + + + + + Fix corner case wherein SELECT FOR UPDATE could return a row + twice, and possibly miss returning other rows (Tom Lane) + + + + In READ COMMITTED mode, a SELECT FOR UPDATE + that is scanning an inheritance tree could incorrectly return a row + from a prior child table instead of the one it should return from a + later child table. + + + + + + Reject duplicate column names in the referenced-columns list of + a FOREIGN KEY declaration (David Rowley) + + + + This restriction is per SQL standard. Previously we did not reject + the case explicitly, but later on the code would fail with + bizarre-looking errors. + + + + + + Fix bugs in raising a numeric value to a large integral power + (Tom Lane) + + + + The previous code could get a wrong answer, or consume excessive + amounts of time and memory before realizing that the answer must + overflow. + + + + + + In numeric_recv(), truncate away any fractional digits + that would be hidden according to the value's dscale field + (Tom Lane) + + + + A numeric value's display scale (dscale) should + never be less than the number of nonzero fractional digits; but + apparently there's at least one broken client application that + transmits binary numeric values in which that's true. + This leads to strange behavior since the extra digits are taken into + account by arithmetic operations even though they aren't printed. + The least risky fix seems to be to truncate away such hidden + digits on receipt, so that the value is indeed what it prints as. + + + + + + Reject out-of-range numeric timezone specifications (Tom Lane) + + + + Simple numeric timezone specifications exceeding +/- 168 hours (one + week) would be accepted, but could then cause null-pointer dereference + crashes in certain operations. There's no use-case for such large UTC + offsets, so reject them. + + + + + + Fix bugs in tsquery @> tsquery + operator (Heikki Linnakangas) + + + + Two different terms would be considered to match if they had the same + CRC. Also, if the second operand had more terms than the first, it + would be assumed not to be contained in the first; which is wrong + since it might contain duplicate terms. + + + + + + Improve ispell dictionary's defenses against bad affix files (Tom Lane) + + + + + + Allow more than 64K phrases in a thesaurus dictionary (David Boutin) + + + + The previous coding could crash on an oversize dictionary, so this was + deemed a back-patchable bug fix rather than a feature addition. + + + + + + Fix namespace handling in xpath() (Ali Akbar) + + + + Previously, the xml value resulting from + an xpath() call would not have namespace declarations if + the namespace declarations were attached to an ancestor element in the + input xml value, rather than to the specific element being + returned. Propagate the ancestral declaration so that the result is + correct when considered in isolation. + + + + + + Fix planner problems with nested append relations, such as inherited + tables within UNION ALL subqueries (Tom Lane) + + + + + + Fail cleanly when a GiST index tuple doesn't fit on a page, rather + than going into infinite recursion (Andrew Gierth) + + + + + + Exempt tables that have per-table cost_limit + and/or cost_delay settings from autovacuum's global cost + balancing rules (Álvaro Herrera) + + + + The previous behavior resulted in basically ignoring these per-table + settings, which was unintended. Now, a table having such settings + will be vacuumed using those settings, independently of what is going + on in other autovacuum workers. This may result in heavier total I/O + load than before, so such settings should be re-examined for sanity. + + + + + + Avoid wholesale autovacuuming when autovacuum is nominally off + (Tom Lane) + + + + Even when autovacuum is nominally off, we will still launch autovacuum + worker processes to vacuum tables that are at risk of XID wraparound. + However, such a worker process then proceeded to vacuum all tables in + the target database, if they met the usual thresholds for + autovacuuming. This is at best pretty unexpected; at worst it delays + response to the wraparound threat. Fix it so that if autovacuum is + turned off, workers only do anti-wraparound vacuums and + not any other work. + + + + + + During crash recovery, ensure that unlogged relations are rewritten as + empty and are synced to disk before recovery is considered complete + (Abhijit Menon-Sen, Andres Freund) + + + + This prevents scenarios in which unlogged relations might contain + garbage data following database crash recovery. + + + + + + Fix race condition between hot standby queries and replaying a + full-page image (Heikki Linnakangas) + + + + This mistake could result in transient errors in queries being + executed in hot standby. + + + + + + Fix several cases where recovery logic improperly ignored WAL records + for COMMIT/ABORT PREPARED (Heikki Linnakangas) + + + + The most notable oversight was + that recovery_min_apply_delay failed to delay application + of a two-phase commit. + + + + + + Avoid creating unnecessary .ready marker files for + timeline history files (Fujii Masao) + + + + + + Fix possible null pointer dereference when an empty prepared statement + is used and the log_statement setting is mod + or ddl (Fujii Masao) + + + + + + Change pgstat wait timeout warning message to be LOG level, + and rephrase it to be more understandable (Tom Lane) + + + + This message was originally thought to be essentially a can't-happen + case, but it occurs often enough on our slower buildfarm members to be + a nuisance. Reduce it to LOG level, and expend a bit more effort on + the wording: it now reads using stale statistics instead of + current ones because stats collector is not responding. + + + + + + Fix SPARC spinlock implementation to ensure correctness if the CPU is + being run in a non-TSO coherency mode, as some non-Solaris kernels do + (Andres Freund) + + + + + + Warn if OS X's setlocale() starts an unwanted extra + thread inside the postmaster (Noah Misch) + + + + + + Fix processing of repeated dbname parameters + in PQconnectdbParams() (Alex Shulgin) + + + + Unexpected behavior ensued if the first occurrence + of dbname contained a connection string or URI to be + expanded. + + + + + + Ensure that libpq reports a suitable error message on + unexpected socket EOF (Marko Tiikkaja, Tom Lane) + + + + Depending on kernel behavior, libpq might return an + empty error string rather than something useful when the server + unexpectedly closed the socket. + + + + + + Clear any old error message during PQreset() + (Heikki Linnakangas) + + + + If PQreset() is called repeatedly, and the connection + cannot be re-established, error messages from the failed connection + attempts kept accumulating in the PGconn's error + string. + + + + + + Properly handle out-of-memory conditions while parsing connection + options in libpq (Alex Shulgin, Heikki Linnakangas) + + + + + + Fix array overrun in ecpg's version + of ParseDateTime() (Michael Paquier) + + + + + + In initdb, give a clearer error message if a password + file is specified but is empty (Mats Erik Andersson) + + + + + + Fix psql's \s command to work nicely with + libedit, and add pager support (Stepan Rutz, Tom Lane) + + + + When using libedit rather than readline, \s printed the + command history in a fairly unreadable encoded format, and on recent + libedit versions might fail altogether. Fix that by printing the + history ourselves rather than having the library do it. A pleasant + side-effect is that the pager is used if appropriate. + + + + This patch also fixes a bug that caused newline encoding to be applied + inconsistently when saving the command history with libedit. + Multiline history entries written by older psql + versions will be read cleanly with this patch, but perhaps not + vice versa, depending on the exact libedit versions involved. + + + + + + Improve consistency of parsing of psql's special + variables (Tom Lane) + + + + Allow variant spellings of on and off (such + as 1/0) for ECHO_HIDDEN + and ON_ERROR_ROLLBACK. Report a warning for unrecognized + values for COMP_KEYWORD_CASE, ECHO, + ECHO_HIDDEN, HISTCONTROL, + ON_ERROR_ROLLBACK, and VERBOSITY. Recognize + all values for all these variables case-insensitively; previously + there was a mishmash of case-sensitive and case-insensitive behaviors. + + + + + + Fix psql's expanded-mode display to work + consistently when using border = 3 + and linestyle = ascii or unicode + (Stephen Frost) + + + + + + Improve performance of pg_dump when the database + contains many instances of multiple dependency paths between the same + two objects (Tom Lane) + + + + + + Fix possible deadlock during parallel restore of a schema-only dump + (Robert Haas, Tom Lane) + + + + + + Fix core dump in pg_dump --binary-upgrade on zero-column + composite type (Rushabh Lathia) + + + + + + Prevent WAL files created by pg_basebackup -x/-X from + being archived again when the standby is promoted (Andres Freund) + + + + + + Fix upgrade-from-unpackaged script for contrib/citext + (Tom Lane) + + + + + + Fix block number checking + in contrib/pageinspect's get_raw_page() + (Tom Lane) + + + + The incorrect checking logic could prevent access to some pages in + non-main relation forks. + + + + + + Fix contrib/pgcrypto's pgp_sym_decrypt() + to not fail on messages whose length is 6 less than a power of 2 + (Marko Tiikkaja) + + + + + + Fix file descriptor leak in contrib/pg_test_fsync + (Jeff Janes) + + + + This could cause failure to remove temporary files on Windows. + + + + + + Handle unexpected query results, especially NULLs, safely in + contrib/tablefunc's connectby() + (Michael Paquier) + + + + connectby() previously crashed if it encountered a NULL + key value. It now prints that row but doesn't recurse further. + + + + + + Avoid a possible crash in contrib/xml2's + xslt_process() (Mark Simonetti) + + + + libxslt seems to have an undocumented dependency on + the order in which resources are freed; reorder our calls to avoid a + crash. + + + + + + Mark some contrib I/O functions with correct volatility + properties (Tom Lane) + + + + The previous over-conservative marking was immaterial in normal use, + but could cause optimization problems or rejection of valid index + expression definitions. Since the consequences are not large, we've + just adjusted the function definitions in the extension modules' + scripts, without changing version numbers. + + + + + + Numerous cleanups of warnings from Coverity static code analyzer + (Andres Freund, Tatsuo Ishii, Marko Kreen, Tom Lane, Michael Paquier) + + + + These changes are mostly cosmetic but in some cases fix corner-case + bugs, for example a crash rather than a proper error report after an + out-of-memory failure. None are believed to represent security + issues. + + + + + + Detect incompatible OpenLDAP versions during build (Noah Misch) + + + + With OpenLDAP versions 2.4.24 through 2.4.31, + inclusive, PostgreSQL backends can crash at exit. + Raise a warning during configure based on the + compile-time OpenLDAP version number, and test the crashing scenario + in the contrib/dblink regression test. + + + + + + In non-MSVC Windows builds, ensure libpq.dll is installed + with execute permissions (Noah Misch) + + + + + + Make pg_regress remove any temporary installation it + created upon successful exit (Tom Lane) + + + + This results in a very substantial reduction in disk space usage + during make check-world, since that sequence involves + creation of numerous temporary installations. + + + + + + Support time zone abbreviations that change UTC offset from time to + time (Tom Lane) + + + + Previously, PostgreSQL assumed that the UTC offset + associated with a time zone abbreviation (such as EST) + never changes in the usage of any particular locale. However this + assumption fails in the real world, so introduce the ability for a + zone abbreviation to represent a UTC offset that sometimes changes. + Update the zone abbreviation definition files to make use of this + feature in timezone locales that have changed the UTC offset of their + abbreviations since 1970 (according to the IANA timezone database). + In such timezones, PostgreSQL will now associate the + correct UTC offset with the abbreviation depending on the given date. + + + + + + Update time zone abbreviations lists (Tom Lane) + + + + Add CST (China Standard Time) to our lists. + Remove references to ADT as Arabia Daylight Time, an + abbreviation that's been out of use since 2007; therefore, claiming + there is a conflict with Atlantic Daylight Time doesn't seem + especially helpful. + Fix entirely incorrect GMT offsets for CKT (Cook Islands), FJT, and FJST + (Fiji); we didn't even have them on the proper side of the date line. + + + + + + Update time zone data files to tzdata release 2015a. + + + + The IANA timezone database has adopted abbreviations of the form + AxST/AxDT + for all Australian time zones, reflecting what they believe to be + current majority practice Down Under. These names do not conflict + with usage elsewhere (other than ACST for Acre Summer Time, which has + been in disuse since 1994). Accordingly, adopt these names into + our Default timezone abbreviation set. + The Australia abbreviation set now contains only CST, EAST, + EST, SAST, SAT, and WST, all of which are thought to be mostly + historical usage. Note that SAST has also been changed to be South + Africa Standard Time in the Default abbreviation set. + + + + Also, add zone abbreviations SRET (Asia/Srednekolymsk) and XJT + (Asia/Urumqi), and use WSST/WSDT for western Samoa. Also, there were + DST law changes in Chile, Mexico, the Turks & Caicos Islands + (America/Grand_Turk), and Fiji. There is a new zone + Pacific/Bougainville for portions of Papua New Guinea. Also, numerous + corrections for historical (pre-1970) time zone data. + + + + + + + + Release 9.1.14 @@ -8067,7 +8877,7 @@ SELECT * FROM places ORDER BY location <-> point '(101,456)' LIMIT 10; - Add dummy_seclabel + Add dummy_seclabel contrib module (KaiGai Kohei) diff --git a/postgresql/release-9.2.xml b/postgresql/release-9.2.xml index 9b4fa9970..bcdb97c8b 100644 --- a/postgresql/release-9.2.xml +++ b/postgresql/release-9.2.xml @@ -2,6 +2,923 @@ + + Release 9.2.10 + + + Release Date + 2015-02-05 + + + + This release contains a variety of fixes from 9.2.9. + For information about new features in the 9.2 major release, see + . + + + + Migration to Version 9.2.10 + + + A dump/restore is not required for those running 9.2.X. + + + + However, if you are a Windows user and are using the Norwegian + (Bokmål) locale, manual action is needed after the upgrade to + replace any Norwegian (Bokmål)_Norway locale names stored + in PostgreSQL system catalogs with the plain-ASCII + alias Norwegian_Norway. For details see + Changes_To_Norwegian_Locale + + + + Also, if you are upgrading from a version earlier than 9.2.9, + see . + + + + + + Changes + + + + + + Fix buffer overruns in to_char() + (Bruce Momjian) + + + + When to_char() processes a numeric formatting template + calling for a large number of digits, PostgreSQL + would read past the end of a buffer. When processing a crafted + timestamp formatting template, PostgreSQL would write + past the end of a buffer. Either case could crash the server. + We have not ruled out the possibility of attacks that lead to + privilege escalation, though they seem unlikely. + (CVE-2015-0241) + + + + + + Fix buffer overrun in replacement *printf() functions + (Tom Lane) + + + + PostgreSQL includes a replacement implementation + of printf and related functions. This code will overrun + a stack buffer when formatting a floating point number (conversion + specifiers e, E, f, F, + g or G) with requested precision greater than + about 500. This will crash the server, and we have not ruled out the + possibility of attacks that lead to privilege escalation. + A database user can trigger such a buffer overrun through + the to_char() SQL function. While that is the only + affected core PostgreSQL functionality, extension + modules that use printf-family functions may be at risk as well. + + + + This issue primarily affects PostgreSQL on Windows. + PostgreSQL uses the system implementation of these + functions where adequate, which it is on other modern platforms. + (CVE-2015-0242) + + + + + + Fix buffer overruns in contrib/pgcrypto + (Marko Tiikkaja, Noah Misch) + + + + Errors in memory size tracking within the pgcrypto + module permitted stack buffer overruns and improper dependence on the + contents of uninitialized memory. The buffer overrun cases can + crash the server, and we have not ruled out the possibility of + attacks that lead to privilege escalation. + (CVE-2015-0243) + + + + + + Fix possible loss of frontend/backend protocol synchronization after + an error + (Heikki Linnakangas) + + + + If any error occurred while the server was in the middle of reading a + protocol message from the client, it could lose synchronization and + incorrectly try to interpret part of the message's data as a new + protocol message. An attacker able to submit crafted binary data + within a command parameter might succeed in injecting his own SQL + commands this way. Statement timeout and query cancellation are the + most likely sources of errors triggering this scenario. Particularly + vulnerable are applications that use a timeout and also submit + arbitrary user-crafted data as binary query parameters. Disabling + statement timeout will reduce, but not eliminate, the risk of + exploit. Our thanks to Emil Lenngren for reporting this issue. + (CVE-2015-0244) + + + + + + Fix information leak via constraint-violation error messages + (Stephen Frost) + + + + Some server error messages show the values of columns that violate + a constraint, such as a unique constraint. If the user does not have + SELECT privilege on all columns of the table, this could + mean exposing values that the user should not be able to see. Adjust + the code so that values are displayed only when they came from the SQL + command or could be selected by the user. + (CVE-2014-8161) + + + + + + Lock down regression testing's temporary installations on Windows + (Noah Misch) + + + + Use SSPI authentication to allow connections only from the OS user + who launched the test suite. This closes on Windows the same + vulnerability previously closed on other platforms, namely that other + users might be able to connect to the test postmaster. + (CVE-2014-0067) + + + + + + Cope with the Windows locale named Norwegian (Bokmål) + (Heikki Linnakangas) + + + + Non-ASCII locale names are problematic since it's not clear what + encoding they should be represented in. Map the troublesome locale + name to a plain-ASCII alias, Norwegian_Norway. + + + + + + Avoid possible data corruption if ALTER DATABASE SET + TABLESPACE is used to move a database to a new tablespace and then + shortly later move it back to its original tablespace (Tom Lane) + + + + + + Avoid corrupting tables when ANALYZE inside a transaction + is rolled back (Andres Freund, Tom Lane, Michael Paquier) + + + + If the failing transaction had earlier removed the last index, rule, or + trigger from the table, the table would be left in a corrupted state + with the relevant pg_class flags not set though they + should be. + + + + + + Ensure that unlogged tables are copied correctly + during CREATE DATABASE or ALTER DATABASE SET + TABLESPACE (Pavan Deolasee, Andres Freund) + + + + + + Fix DROP's dependency searching to correctly handle the + case where a table column is recursively visited before its table + (Petr Jelinek, Tom Lane) + + + + This case is only known to arise when an extension creates both a + datatype and a table using that datatype. The faulty code might + refuse a DROP EXTENSION unless CASCADE is + specified, which should not be required. + + + + + + Fix use-of-already-freed-memory problem in EvalPlanQual processing + (Tom Lane) + + + + In READ COMMITTED mode, queries that lock or update + recently-updated rows could crash as a result of this bug. + + + + + + Fix planning of SELECT FOR UPDATE when using a partial + index on a child table (Kyotaro Horiguchi) + + + + In READ COMMITTED mode, SELECT FOR UPDATE must + also recheck the partial index's WHERE condition when + rechecking a recently-updated row to see if it still satisfies the + query's WHERE condition. This requirement was missed if the + index belonged to an inheritance child table, so that it was possible + to incorrectly return rows that no longer satisfy the query condition. + + + + + + Fix corner case wherein SELECT FOR UPDATE could return a row + twice, and possibly miss returning other rows (Tom Lane) + + + + In READ COMMITTED mode, a SELECT FOR UPDATE + that is scanning an inheritance tree could incorrectly return a row + from a prior child table instead of the one it should return from a + later child table. + + + + + + Reject duplicate column names in the referenced-columns list of + a FOREIGN KEY declaration (David Rowley) + + + + This restriction is per SQL standard. Previously we did not reject + the case explicitly, but later on the code would fail with + bizarre-looking errors. + + + + + + Restore previous behavior of conversion of domains to JSON + (Tom Lane) + + + + This change causes domains over numeric and boolean to be treated + like their base types for purposes of conversion to JSON. It worked + like that before 9.3.5 and 9.2.9, but was unintentionally changed + while fixing a related problem. + + + + + + Fix bugs in raising a numeric value to a large integral power + (Tom Lane) + + + + The previous code could get a wrong answer, or consume excessive + amounts of time and memory before realizing that the answer must + overflow. + + + + + + In numeric_recv(), truncate away any fractional digits + that would be hidden according to the value's dscale field + (Tom Lane) + + + + A numeric value's display scale (dscale) should + never be less than the number of nonzero fractional digits; but + apparently there's at least one broken client application that + transmits binary numeric values in which that's true. + This leads to strange behavior since the extra digits are taken into + account by arithmetic operations even though they aren't printed. + The least risky fix seems to be to truncate away such hidden + digits on receipt, so that the value is indeed what it prints as. + + + + + + Fix incorrect search for shortest-first regular expression matches + (Tom Lane) + + + + Matching would often fail when the number of allowed iterations is + limited by a ? quantifier or a bound expression. + + + + + + Reject out-of-range numeric timezone specifications (Tom Lane) + + + + Simple numeric timezone specifications exceeding +/- 168 hours (one + week) would be accepted, but could then cause null-pointer dereference + crashes in certain operations. There's no use-case for such large UTC + offsets, so reject them. + + + + + + Fix bugs in tsquery @> tsquery + operator (Heikki Linnakangas) + + + + Two different terms would be considered to match if they had the same + CRC. Also, if the second operand had more terms than the first, it + would be assumed not to be contained in the first; which is wrong + since it might contain duplicate terms. + + + + + + Improve ispell dictionary's defenses against bad affix files (Tom Lane) + + + + + + Allow more than 64K phrases in a thesaurus dictionary (David Boutin) + + + + The previous coding could crash on an oversize dictionary, so this was + deemed a back-patchable bug fix rather than a feature addition. + + + + + + Fix namespace handling in xpath() (Ali Akbar) + + + + Previously, the xml value resulting from + an xpath() call would not have namespace declarations if + the namespace declarations were attached to an ancestor element in the + input xml value, rather than to the specific element being + returned. Propagate the ancestral declaration so that the result is + correct when considered in isolation. + + + + + + Ensure that whole-row variables expose nonempty column names + to functions that pay attention to column names within composite + arguments (Tom Lane) + + + + In some contexts, constructs like row_to_json(tab.*) may + not produce the expected column names. This is fixed properly as of + 9.4; in older branches, just ensure that we produce some nonempty + name. (In some cases this will be the underlying table's column name + rather than the query-assigned alias that should theoretically be + visible.) + + + + + + Fix mishandling of system columns, + particularly tableoid, in FDW queries (Etsuro Fujita) + + + + + + Avoid doing indexed_column = ANY + (array) as an index qualifier if that leads + to an inferior plan (Andrew Gierth) + + + + In some cases, = ANY conditions applied to non-first index + columns would be done as index conditions even though it would be + better to use them as simple filter conditions. + + + + + + Fix planner problems with nested append relations, such as inherited + tables within UNION ALL subqueries (Tom Lane) + + + + + + Fail cleanly when a GiST index tuple doesn't fit on a page, rather + than going into infinite recursion (Andrew Gierth) + + + + + + Exempt tables that have per-table cost_limit + and/or cost_delay settings from autovacuum's global cost + balancing rules (Álvaro Herrera) + + + + The previous behavior resulted in basically ignoring these per-table + settings, which was unintended. Now, a table having such settings + will be vacuumed using those settings, independently of what is going + on in other autovacuum workers. This may result in heavier total I/O + load than before, so such settings should be re-examined for sanity. + + + + + + Avoid wholesale autovacuuming when autovacuum is nominally off + (Tom Lane) + + + + Even when autovacuum is nominally off, we will still launch autovacuum + worker processes to vacuum tables that are at risk of XID wraparound. + However, such a worker process then proceeded to vacuum all tables in + the target database, if they met the usual thresholds for + autovacuuming. This is at best pretty unexpected; at worst it delays + response to the wraparound threat. Fix it so that if autovacuum is + turned off, workers only do anti-wraparound vacuums and + not any other work. + + + + + + During crash recovery, ensure that unlogged relations are rewritten as + empty and are synced to disk before recovery is considered complete + (Abhijit Menon-Sen, Andres Freund) + + + + This prevents scenarios in which unlogged relations might contain + garbage data following database crash recovery. + + + + + + Fix race condition between hot standby queries and replaying a + full-page image (Heikki Linnakangas) + + + + This mistake could result in transient errors in queries being + executed in hot standby. + + + + + + Fix several cases where recovery logic improperly ignored WAL records + for COMMIT/ABORT PREPARED (Heikki Linnakangas) + + + + The most notable oversight was + that recovery_min_apply_delay failed to delay application + of a two-phase commit. + + + + + + Prevent latest WAL file from being archived a second time at completion + of crash recovery (Fujii Masao) + + + + + + Avoid creating unnecessary .ready marker files for + timeline history files (Fujii Masao) + + + + + + Fix possible null pointer dereference when an empty prepared statement + is used and the log_statement setting is mod + or ddl (Fujii Masao) + + + + + + Change pgstat wait timeout warning message to be LOG level, + and rephrase it to be more understandable (Tom Lane) + + + + This message was originally thought to be essentially a can't-happen + case, but it occurs often enough on our slower buildfarm members to be + a nuisance. Reduce it to LOG level, and expend a bit more effort on + the wording: it now reads using stale statistics instead of + current ones because stats collector is not responding. + + + + + + Fix SPARC spinlock implementation to ensure correctness if the CPU is + being run in a non-TSO coherency mode, as some non-Solaris kernels do + (Andres Freund) + + + + + + Warn if OS X's setlocale() starts an unwanted extra + thread inside the postmaster (Noah Misch) + + + + + + Fix processing of repeated dbname parameters + in PQconnectdbParams() (Alex Shulgin) + + + + Unexpected behavior ensued if the first occurrence + of dbname contained a connection string or URI to be + expanded. + + + + + + Ensure that libpq reports a suitable error message on + unexpected socket EOF (Marko Tiikkaja, Tom Lane) + + + + Depending on kernel behavior, libpq might return an + empty error string rather than something useful when the server + unexpectedly closed the socket. + + + + + + Clear any old error message during PQreset() + (Heikki Linnakangas) + + + + If PQreset() is called repeatedly, and the connection + cannot be re-established, error messages from the failed connection + attempts kept accumulating in the PGconn's error + string. + + + + + + Properly handle out-of-memory conditions while parsing connection + options in libpq (Alex Shulgin, Heikki Linnakangas) + + + + + + Fix array overrun in ecpg's version + of ParseDateTime() (Michael Paquier) + + + + + + In initdb, give a clearer error message if a password + file is specified but is empty (Mats Erik Andersson) + + + + + + Fix psql's \s command to work nicely with + libedit, and add pager support (Stepan Rutz, Tom Lane) + + + + When using libedit rather than readline, \s printed the + command history in a fairly unreadable encoded format, and on recent + libedit versions might fail altogether. Fix that by printing the + history ourselves rather than having the library do it. A pleasant + side-effect is that the pager is used if appropriate. + + + + This patch also fixes a bug that caused newline encoding to be applied + inconsistently when saving the command history with libedit. + Multiline history entries written by older psql + versions will be read cleanly with this patch, but perhaps not + vice versa, depending on the exact libedit versions involved. + + + + + + Improve consistency of parsing of psql's special + variables (Tom Lane) + + + + Allow variant spellings of on and off (such + as 1/0) for ECHO_HIDDEN + and ON_ERROR_ROLLBACK. Report a warning for unrecognized + values for COMP_KEYWORD_CASE, ECHO, + ECHO_HIDDEN, HISTCONTROL, + ON_ERROR_ROLLBACK, and VERBOSITY. Recognize + all values for all these variables case-insensitively; previously + there was a mishmash of case-sensitive and case-insensitive behaviors. + + + + + + Fix psql's expanded-mode display to work + consistently when using border = 3 + and linestyle = ascii or unicode + (Stephen Frost) + + + + + + Improve performance of pg_dump when the database + contains many instances of multiple dependency paths between the same + two objects (Tom Lane) + + + + + + Fix pg_dumpall to restore its ability to dump from + pre-8.1 servers (Gilles Darold) + + + + + + Fix possible deadlock during parallel restore of a schema-only dump + (Robert Haas, Tom Lane) + + + + + + Fix core dump in pg_dump --binary-upgrade on zero-column + composite type (Rushabh Lathia) + + + + + + Prevent WAL files created by pg_basebackup -x/-X from + being archived again when the standby is promoted (Andres Freund) + + + + + + Fix failure of contrib/auto_explain to print per-node + timing information when doing EXPLAIN ANALYZE (Tom Lane) + + + + + + Fix upgrade-from-unpackaged script for contrib/citext + (Tom Lane) + + + + + + Fix block number checking + in contrib/pageinspect's get_raw_page() + (Tom Lane) + + + + The incorrect checking logic could prevent access to some pages in + non-main relation forks. + + + + + + Fix contrib/pgcrypto's pgp_sym_decrypt() + to not fail on messages whose length is 6 less than a power of 2 + (Marko Tiikkaja) + + + + + + Fix file descriptor leak in contrib/pg_test_fsync + (Jeff Janes) + + + + This could cause failure to remove temporary files on Windows. + + + + + + Handle unexpected query results, especially NULLs, safely in + contrib/tablefunc's connectby() + (Michael Paquier) + + + + connectby() previously crashed if it encountered a NULL + key value. It now prints that row but doesn't recurse further. + + + + + + Avoid a possible crash in contrib/xml2's + xslt_process() (Mark Simonetti) + + + + libxslt seems to have an undocumented dependency on + the order in which resources are freed; reorder our calls to avoid a + crash. + + + + + + Mark some contrib I/O functions with correct volatility + properties (Tom Lane) + + + + The previous over-conservative marking was immaterial in normal use, + but could cause optimization problems or rejection of valid index + expression definitions. Since the consequences are not large, we've + just adjusted the function definitions in the extension modules' + scripts, without changing version numbers. + + + + + + Numerous cleanups of warnings from Coverity static code analyzer + (Andres Freund, Tatsuo Ishii, Marko Kreen, Tom Lane, Michael Paquier) + + + + These changes are mostly cosmetic but in some cases fix corner-case + bugs, for example a crash rather than a proper error report after an + out-of-memory failure. None are believed to represent security + issues. + + + + + + Detect incompatible OpenLDAP versions during build (Noah Misch) + + + + With OpenLDAP versions 2.4.24 through 2.4.31, + inclusive, PostgreSQL backends can crash at exit. + Raise a warning during configure based on the + compile-time OpenLDAP version number, and test the crashing scenario + in the contrib/dblink regression test. + + + + + + In non-MSVC Windows builds, ensure libpq.dll is installed + with execute permissions (Noah Misch) + + + + + + Make pg_regress remove any temporary installation it + created upon successful exit (Tom Lane) + + + + This results in a very substantial reduction in disk space usage + during make check-world, since that sequence involves + creation of numerous temporary installations. + + + + + + Support time zone abbreviations that change UTC offset from time to + time (Tom Lane) + + + + Previously, PostgreSQL assumed that the UTC offset + associated with a time zone abbreviation (such as EST) + never changes in the usage of any particular locale. However this + assumption fails in the real world, so introduce the ability for a + zone abbreviation to represent a UTC offset that sometimes changes. + Update the zone abbreviation definition files to make use of this + feature in timezone locales that have changed the UTC offset of their + abbreviations since 1970 (according to the IANA timezone database). + In such timezones, PostgreSQL will now associate the + correct UTC offset with the abbreviation depending on the given date. + + + + + + Update time zone abbreviations lists (Tom Lane) + + + + Add CST (China Standard Time) to our lists. + Remove references to ADT as Arabia Daylight Time, an + abbreviation that's been out of use since 2007; therefore, claiming + there is a conflict with Atlantic Daylight Time doesn't seem + especially helpful. + Fix entirely incorrect GMT offsets for CKT (Cook Islands), FJT, and FJST + (Fiji); we didn't even have them on the proper side of the date line. + + + + + + Update time zone data files to tzdata release 2015a. + + + + The IANA timezone database has adopted abbreviations of the form + AxST/AxDT + for all Australian time zones, reflecting what they believe to be + current majority practice Down Under. These names do not conflict + with usage elsewhere (other than ACST for Acre Summer Time, which has + been in disuse since 1994). Accordingly, adopt these names into + our Default timezone abbreviation set. + The Australia abbreviation set now contains only CST, EAST, + EST, SAST, SAT, and WST, all of which are thought to be mostly + historical usage. Note that SAST has also been changed to be South + Africa Standard Time in the Default abbreviation set. + + + + Also, add zone abbreviations SRET (Asia/Srednekolymsk) and XJT + (Asia/Urumqi), and use WSST/WSDT for western Samoa. Also, there were + DST law changes in Chile, Mexico, the Turks & Caicos Islands + (America/Grand_Turk), and Fiji. There is a new zone + Pacific/Bougainville for portions of Papua New Guinea. Also, numerous + corrections for historical (pre-1970) time zone data. + + + + + + + + Release 9.2.9 diff --git a/postgresql/runtime.xml b/postgresql/runtime.xml index 2b102dd34..3f147eab0 100644 --- a/postgresql/runtime.xml +++ b/postgresql/runtime.xml @@ -744,22 +744,26 @@ DETAIL: Failed system call was semget(5440126, 17, 03600). via les interfaces sysctl ou loader. Les paramètres suivants peuvent être configurés en utilisant sysctl : -$ sysctl -w kern.ipc.shmall=32768 -$ sysctl -w kern.ipc.shmmax=134217728 -$ sysctl -w kern.ipc.semmap=256 +# sysctl kern.ipc.shmall=32768 +# sysctl kern.ipc.shmmax=134217728 Pour que ces paramètres persistent après les redémarrages, modifiez /etc/sysctl.conf. - Les paramètres restant, concernant les sémaphores, sont en lecture seule - en ce qui concerne sysctl mais peuvent être modifiés - avant le redémarrage en utilisant l'invite loader : -(loader) set kern.ipc.semmni=256 -(loader) set kern.ipc.semmns=512 -(loader) set kern.ipc.semmnu=256 - De façon similaire, ils peuvent être sauvegardés entre les redémarrages - dans /boot/loader.conf. + These semaphore-related settings are read-only as far as + sysctl is concerned, but can be set in + /boot/loader.conf: + +kern.ipc.semmni=256 +kern.ipc.semmns=512 +kern.ipc.semmnu=256 + + After modifying these values a reboot is required for the new + settings to take effect. + (Note: FreeBSD does not use SEMMAP. Older versions + would accept but ignore a setting for kern.ipc.semmap; + newer versions reject it altogether.) diff --git a/postgresql/storage.xml b/postgresql/storage.xml index 1d47d48d4..6eae4b6cc 100644 --- a/postgresql/storage.xml +++ b/postgresql/storage.xml @@ -259,7 +259,7 @@ utile pour ne pas avoir à se rappeler toutes les différentes règles ci-dessus Gardez néanmoins en tête que cette fonction donne seulement le nom du premier segment du fichier principal de la relation — vous pourriez avoir besoin d'ajouter le numéro de segment et/ou les extensions -_fsm ou _vm pour trouver tous les +_fsm, _vm ou _init pour trouver tous les fichiers associés avec la relation. diff --git a/postgresql/syntax.xml b/postgresql/syntax.xml index f722c78a0..8728c4b4b 100644 --- a/postgresql/syntax.xml +++ b/postgresql/syntax.xml @@ -2246,6 +2246,55 @@ SELECT ROW(table.*) IS NULL FROM table; -- détecte toutes les lignes non NULLy > 1.5*x). + + + CASE is not a cure-all for such issues, however. + One limitation of the technique illustrated above is that it does not + prevent early evaluation of constant subexpressions. + As described in , functions and + operators marked IMMUTABLE can be evaluated when + the query is planned rather than when it is executed. Thus for example + +SELECT CASE WHEN x > 0 THEN x ELSE 1/0 END FROM tab; + + is likely to result in a division-by-zero failure due to the planner + trying to simplify the constant subexpression, + even if every row in the table has x > 0 so that the + ELSE arm would never be entered at run time. + + + + While that particular example might seem silly, related cases that don't + obviously involve constants can occur in queries executed within + functions, since the values of function arguments and local variables + can be inserted into queries as constants for planning purposes. + Within PL/pgSQL functions, for example, using an + IF-THEN-ELSE statement to protect + a risky computation is much safer than just nesting it in a + CASE expression. + + + + Another limitation of the same kind is that a CASE cannot + prevent evaluation of an aggregate expression contained within it, + because aggregate expressions are computed before other + expressions in a SELECT list or HAVING clause + are considered. For example, the following query can cause a + division-by-zero error despite seemingly having protected against it: + +SELECT CASE WHEN min(employees) > 0 + THEN avg(expenses / employees) + END + FROM departments; + + The min() and avg() aggregates are computed + concurrently over all the input rows, so if any row + has employees equal to zero, the division-by-zero error + will occur before there is any opportunity to test the result of + min(). Instead, use a WHERE + clause to prevent problematic input rows from + reaching an aggregate function in the first place. + diff --git a/postgresql/typeconv.xml b/postgresql/typeconv.xml index 4049085ca..bb467bf85 100644 --- a/postgresql/typeconv.xml +++ b/postgresql/typeconv.xml @@ -209,7 +209,9 @@ alors la requête devra s'exécuter sans perte de temps supplémentaire et sans introduire à l'intérieur de celle-ci des appels à des conversions implicites non nécessaires. - + + + De plus, si une requête nécessite habituellement une conversion implicite pour une fonction et si l'utilisateur définit une nouvelle @@ -242,7 +244,7 @@ implicites en utilisant l'ancienne fonction. Résolution de types pour les opérateurs - + Sélectionner les opérateurs à examiner depuis le catalogue système pg_operator. Si un nom non-qualifié @@ -267,7 +269,7 @@ de recherche. - + Vérifier que l'opérateur accepte le type exact des arguments en entrée. Si un opérateur existe (il peut en avoir uniquement un qui @@ -276,7 +278,7 @@ utiliser cet opérateur. - + Si un argument lors d'une invocation d'opérateur binaire est de type unknown (NdT : inconnu), alors considérer pour ce contrôle @@ -286,10 +288,17 @@ une donnée de type unknown ne trouveront jamais une correspondance à ce niveau. + + +If one argument of a binary operator invocation is of the unknown +type and the other is of a domain type, next check to see if there is an +operator accepting exactly the domain's base type on both sides; if so, use it. + + - + Rechercher la meilleure correspondance. @@ -306,9 +315,15 @@ prochaine étape. +If any input argument is of a domain type, treat it as being of the +domain's base type for all subsequent steps. This ensures that domains +act like their base types for purposes of ambiguous-operator resolution. + + + + Parcourir tous les candidats et garder ceux avec la correspondance la -plus exacte par rapport aux types en entrée (les domaines sont -considérés de la même façon que leur type de base pour cette étape). +plus exacte par rapport aux types en entrée. Garder tous les candidats si aucun n'a de correspondance exacte. Si un seul candidat reste, l'utiliser ; sinon, aller à la prochaine étape. @@ -514,6 +529,45 @@ aurions obtenu une erreur car la chaîne n'a pas le bon format pour une interval + +Custom Operator on a Domain Type + + +Users sometimes try to declare operators applying just to a domain type. +This is possible but is not nearly as useful as it might seem, because the +operator resolution rules are designed to select operators applying to the +domain's base type. As an example consider + +CREATE DOMAIN mytext AS text CHECK(...); +CREATE FUNCTION mytext_eq_text (mytext, text) RETURNS boolean AS ...; +CREATE OPERATOR = (procedure=mytext_eq_text, leftarg=mytext, rightarg=text); +CREATE TABLE mytable (val mytext); + +SELECT * FROM mytable WHERE val = 'foo'; + +This query will not use the custom operator. The parser will first see if +there is a mytext = mytext operator +(), which there is not; +then it will consider the domain's base type text, and see if +there is a text = text operator +(), which there is; +so it resolves the unknown-type literal as text and +uses the text = text operator. +The only way to get the custom operator to be used is to explicitly cast +the literal: + +SELECT * FROM mytable WHERE val = text 'foo'; + +so that the mytext = text operator is found +immediately according to the exact-match rule. If the best-match rules +are reached, they actively discriminate against operators on domain types. +If they did not, such an operator would create too many ambiguous-operator +failures, because the casting rules always consider a domain as castable +to or from its base type, and so the domain operator would be considered +usable in all the same cases as a similarly-named operator on the base type. + + + @@ -635,9 +689,15 @@ Si un seul candidat reste, utiliser le ; sinon, aller à la prochaine +If any input argument is of a domain type, treat it as being of the +domain's base type for all subsequent steps. This ensures that domains +act like their base types for purposes of ambiguous-function resolution. + + + + Parcourir tous les candidats et garder ceux avec la correspondance la -plus exacte par rapport aux types en entrée (les domaines sont -considérés de la même façon que leur type de base pour cette étape). +plus exacte par rapport aux types en entrée. Garder tous les candidats si aucun n'a de correspondance exacte. Si un seul candidat reste, utiliser le ; sinon, aller à la prochaine étape. @@ -943,8 +1003,23 @@ tous les types de domaine dans la liste avec les types de base sous-jacents. Si toutes les entrées sont du type unknown, résoudre comme étant du type text (le type préféré de la catégorie -chaîne). Dans le cas contraire, les entrées -unknown seront ignorées. +chaîne). + + + + + +If any input is of a domain type, treat it as being of the +domain's base type for all subsequent steps. + + + Somewhat like the treatment of domain inputs for operators and + functions, this behavior allows a domain type to be preserved through + a UNION or similar construct, so long as the user is + careful to ensure that all inputs are implicitly or explicitly of that + exact type. Otherwise the domain's base type will be preferred. + + diff --git a/postgresql/version.xml b/postgresql/version.xml index 62b61f917..b592bc6ef 100644 --- a/postgresql/version.xml +++ b/postgresql/version.xml @@ -1,2 +1,2 @@ - + diff --git a/postgresql/xfunc.xml b/postgresql/xfunc.xml index c320cc6e2..10250af16 100644 --- a/postgresql/xfunc.xml +++ b/postgresql/xfunc.xml @@ -711,6 +711,20 @@ SELECT mleast(VARIADIC ARRAY[10, -1, 5, 4.4]); argument d'un appel de fonction. + + Specifying VARIADIC in the call is also the only way to + pass an empty array to a variadic function, for example: + + +SELECT mleast(VARIADIC ARRAY[]::numeric[]); + + + Simply writing SELECT mleast() does not work because a + variadic parameter must match at least one actual argument. + (You could define a second function also named mleast, + with no parameters, if you wanted to allow such calls.) + + Les paramètres de l'élément tableau générés à partir d'un paramètre variadic sont traités comme n'ayant pas de noms propres. Cela signifie