E.6. Version 8.2
Date de sortie
E.6.1. Overview
Cette version ajoute beaucoup de nouvelles fonctionnalités et
d'améliorations de performances demandées par les utilisateurs.
Parmi celles-ci :
-
Amélioration du langage de requêtes avec
INSERT/UPDATE/DELETE
RETURNING
, les listes VALUES multi-lignes et les alias optionnels de
table cible pour
UPDATE
/
DELETE
-
Création d'index sans blocage des opérations concurrentes
INSERT
/
UPDATE
/
DELETE
-
Beaucoup d'améliorations dans l'optimisation des requêtes,
avec un support d'un réordonnancement des jointures externes
-
Amélioration des performances du tri avec un usage plus
restreint de la mémoire
-
Verrouillage plus efficace avec une meilleure gestion de la
concurrence
-
Un VACUUM plus efficace
-
Une administration plus simple des serveurs de secours
semi-automatique (
warm standby servers
)
-
Support d'un facteur de remplissage (FILLFACTOR) pour les tables et index
-
Ajout dans la configuration de la surveillance, des journaux
et des performances
-
Plus de contrôle sur la création et la suppression des objets
-
Les relations d'héritage des tables peuvent être définies et
supprimées sur des tables déjà existantes
-
COPY TO
peut
copier le résultat de toute instruction
SELECT
-
Améliorations sur les tableaux, dont le support des éléments
NULL
-
Amélioration des fonctions d'agrégat, avec les agrégats à
entrées multiples et les fonctions statistiques de SQL:2003
-
Beaucoup d'améliorations dans les modules contrib/
E.6.2. Migration vers la version 8.2
Une sauvegarde/restauration utilisant pg_dump est requise pour ceux qui souhaitent
migrer leurs données d'une version précédente.
Prenez note des incompatibilités suivantes :
-
Initialise par défaut
escape_string_warning
à on
(Bruce)
Un avertissement est affiché si des échappements par
antislash sont utilisés dans des chaînes non échappées
(ne commençant pas par E).
-
Modifie la syntaxe du
constructeur de lignes (ROW(...)) pour que les éléments de liste
foo.* soient étendues en une liste
de leurs champs membres, plutôt que de créer un champ de type
ligne imbriqué comme précédemment (Tom)
Le nouveau comportement est plus utile car il permet, par
exemple, aux déclencheurs de détecter les modifications de
données avec IF row(new.*) IS DISTINCT
FROM row(old.*). L'ancien comportement est toujours
disponible en oubliant .*.
-
Fait en sorte que la comparaisons de
lignes suive la sémantique du standard SQL et lui permettent d'être utilisée
dans les parcours d'index (Tom)
Auparavant, les comparaisons d'égalité et de différence de
lignes suivaient le standard mais les comparaisons de type
< <= > >= ne le faisaient pas. Une comparaison de
ligne peut maintenant être utilisé en tant que contrainte
d'index pour un index multi-colonne correspondant à la valeur
de la ligne.
-
Les tests row IS [NOT]
NULL
suivent la sémantique du standard
SQL (Tom)
Le comportement précédent se conformait au standard pour les
cas simples avec IS NULL, mais
IS NOT NULL renvoyait true si aucun
champ de ligne n'était différent de NULL alors que le
standard demande qu'il renvoit NULL seulement quand tous les
champs sont différents de NULL.
-
SET
CONSTRAINT
affecte seulement une seule
contrainte (Kris Jurka)
Dans les versions précédentes,
SET CONSTRAINT
modifiait
toutes les contraintes avec un nom qui correspondait. Dans
cette version, le chemin de recherche du schéma est utilisé
pour modifier seulement la première contrainte qui
correspond. Une spécification du schéma est aussi possible.
Ceci permet un meilleur respect du standard SQL.
-
Suppression de la règle RULE pour
les tables pour des raisons de sécurité (Tom)
À partir de cette version, seul le propriétaire d'une table
peut créer ou modifier les règles d'une table. Pour la
compatibilité ascendante,
GRANT
/
REVOKE RULE
est toujours
accepté mais ne fait rien.
-
Améliorations de la comparaison de tableau (Tom)
Maintenant, les dimensions des tableaux sont aussi comparées.
-
Modification de la concaténation
de tableaux pour que le comportement corresponde à celui
indiqué dans la documentation (Tom)
Le comportement précédent est modifié quand la concaténation
modifie la limite basse du tableau.
-
Les options en ligne de commande de postmaster et
postgres
sont maintenant identiques
(Peter)
Ceci permet au postmaster de passer les arguments à chaque
processus fils sans utiliser -o.
-
Le lien symbolique postmaster est maintenant obsolète
(Peter)
Les commandes postmaster et
postgres agissent maintenant
de façon identique, le comportement étant déterminé par les
options en ligne de commande. Le lien sympbolique
postmaster est conservé pour
compatibilité mais n'est plus vraiment nécessaire.
-
log_duration
affiche la durée même si la
requête n'est pas affichée (Tom)
Dans les versions précédentes, log_duration affichait seulement la durée
quand la requête apparaissait auparavant dans les journaux.
-
to_char(time)
et
to_char(interval)
traitent HH et HH12 comme des
intervals sur 12h.
La plupart des applications devrait utiliser HH24 sauf si elles veulent un affichage sur
12h.
-
Zero unmasked bits in conversion from
INET
to
CIDR
(Tom)
Ceci vous assure que la valeur convertie est réellement
valide pour CIDR.
-
Suppression de la variable de configuration australian_timezones (Joachim Wieland)
Cette variable a été rendue obsolète par une fonctionnalité
plus générale dans la configuration des abréviations de
fuseaux horaires.
-
Amélioration de l'estimation du coût pour les parcours
d'index de boucles imbriquées (Tom)
Ceci élimine le besoin de configurer des valeurs ridiculement
petites de
random_page_cost
. Si vous avez utilisé une
valeur trop petite de random_page_cost, merci de vérifier vos cas de
tests.
-
Modification de PQdsplen() dans
libpq
pour que cette fonction
renvoie une valeur utile (Martijn van Oosterhout)
-
Déclare que PQgetssl() (
libpq
) renvoie void * à la place de SSL
* (Martijn van Oosterhout)
Ceci permet aux applications d'utiliser la fonction sans
inclure les en-têtes d'OpenSSL.
-
les modules chargeables, en langage C, doivent maintenant
inclure un appel à la macro
PG_MODULE_MAGIC
pour une vérification de
la compatibilité de la version (Martijn van Oosterhout)
-
Pour des raisons de sécurité, les modules utilisés par une
fonction PL/PerlU ne sont plus disponibles pour les fonctions
PL/Perl (Andrew)
Note
Ceci implique aussi que les données ne peuvent plus êtres
partagées entre une fonction PL/Perl et une fonction
PL/PerlU. Certaines installations Perl n'ont pas été
compilées avec les bons drapeaux pour permettre à
plusieurs interpréteurs d'exister au sein d'un même
processus. Dans ce cas, PL/Perl et PL/PerlU ne peuvent
pas être utilisés dans un même processus fils. La
solution est d'obtenir une installation Perl qui supporte
plusieurs interpréteurs.
-
Dans contrib/xml2/, renommage de
xml_valid() en xml_is_well_formed() (Tom)
xml_valid() restera pour des
raisons de compatibilité ascendante mais son comportement
changera pour réaliser une vérification de schéma dans une
prochaine version.
-
Suppression de contrib/ora2pg/,
maintenant sur
http://www.samse.fr/GPL/ora2pg
-
Suppression des modules contrib qui ont migré sur PgFoundry :
adddepend, dbase, dbmirror,
fulltextindex, mac, userlock
-
Suppression des modules contrib abandonnés : mSQL-interface, tips
-
Suppression des ports QNX
et BEOS (Bruce)
Ces ports n'ont plus de mainteneurs actifs.
E.6.3. Modifications
Vous trouverez ci-dessous une liste détaillée des modifications
appliquées à PostgreSQL™
8.2.
E.6.3.1. Améliorations des
performances
-
Autorise le planificateur à réordonner les jointures externes dans
certaines circonstances (Tom)
Dans les versions précédentes, les jointures externes ont
toujours été évaluées dans l'ordre donné par la requête.
Cette modification permet à l'optimiseur de requête de
considérer la modification de l'ordre des jointures
externes quand il peut s'assurer que ce changement peut se
faire sans altérer la signification de la requête. Ceci
peut faire une différence considérable au niveau des
performances pour les requêtes impliquant plusieurs
jointures externes ou un mixe entre jointures internes et
jointures externes.
-
Amélioration de l'efficacité des clauses
IN (liste d'expressions) (Tom)
-
Amélioration de la vitesse des tris et réduction de
l'utilisation mémoire (Simon, Tom)
-
Amélioration des performances des sous-transaction (Alvaro,
Itagaki Takahiro, Tom)
-
Ajout de FILLFACTOR pour la
création des tables et index
(ITAGAKI Takahiro)
Ceci amène un espace libre plus important dans chaque page
de table et d'index, donnant des performances améliorées au
fur et à mesure que la base grossit. C'est tout
particulièrement vrai dans le cas d'un cluster.
-
Amélioration des valeurs par défaut pour les paramètres
shared_buffers
et
max_fsm_pages
(Andrew)
-
Amélioration de la performance des verrous en cassant les
tables du gestionnaire de verrous en plusieurs sections
(Tom)
Le verrouillage est ainsi plus fin, réduisant du coup les
problèmes.
-
Réduction des besoins en verrou pour les parcours
séquentiels (Qingqing Zhou)
-
Réduction du verrouillage requis pour la création et la
destruction de bases de données (Tom)
-
Amélioration de la sélectivité de l'optimiseur pour les
estimations de
LIKE
,
ILIKE
et
des expressions
rationnelles (Tom)
-
Amélioration de la planification des jointures des
tables héritées et des vues
UNION
ALL
(Tom)
-
Permet l'application de l'exclusion
des contraintes aux requêtes
UPDATE
et
DELETE
avec héritage (Tom)
SELECT
honorait déjà cette exclusion.
-
Amélioration de la planification des clauses WHERE constantes comme une condition qui
dépend seulement des variables héritées d'un niveau de
requête externe (Tom)
-
Les instructions préparées, sans nom et au niveau protocole
sont re-planifiées pour chaque ensemble de valeurs
BIND (Tom)
Ceci améliore les performances car les valeurs exactes des
paramètres peuvent être utilisées dans le plan.
-
Accélère l'opération VACUUM des index B-Tree (Heikki
Linnakangas, Tom)
-
Évite un parcours supplémentaire des tables sans index
pendant un
VACUUM
(Greg Stark)
-
Amélioration de l'indexage multi-colonnes
GiST
(Oleg, Teodor)
-
Suppression des entrées mortes des index avant la
séparation d'une page B-Tree (Junji Teramoto)
E.6.3.2. Modifications serveur
-
Permet de forcer un basculement vers un nouveau journal de
transactions (Simon, Tom)
Ceci est utile pour conserver la synchronisation des
serveurs esclaves en attente et du maître. Le changement du
journal de transaction survient aussi automatiquement lors
de l'exécution de
pg_stop_backup()
. Ceci vous assure que
tous les journaux de transactions nécessaires à la
récupération sont archivés immédiatement.
-
Ajout des fonctions d'information sur les WAL (Simon)
Ajout de fonctions d'interrogation sur le point d'insertion
du journal de transaction en cours et de détermination des
noms des fichiers WAL à
partir des emplacements WAL hexadécimaux affichés par la
fonction
pg_stop_backup()
mais aussi par
d'autres fonctions en relation.
-
Amélioration de la récupération après un arrêt brutal lors
d'une ré-exécution d'un WAL (Simon)
Maintenant, le serveur réalise des points de vérification
durant la récupération des WAL. Donc, en cas d'arrêt brutal, la
récupération des WAL
restants est raccourcie. Ceci élimine aussi le besoin pour
les serveurs en attente de rejouer tous les journaux depuis
la sauvegarde de base s'ils s'arrêtent brutalement.
-
Improve reliability of long-term WAL replay (Heikki, Simon, Tom)
Formerly, trying to roll forward through more than 2
billion transactions would not work due to XID wraparound.
This meant warm standby servers had to be reloaded from
fresh base backups periodically.
-
Add
archive_timeout
to force transaction log
file switches at a given interval (Simon)
This enforces a maximum replication delay for warm standby
servers.
-
Add native
LDAP
authentication (Magnus
Hagander)
This is particularly useful for platforms that do not
support PAM, such as
Windows.
-
Add
GRANT CONNECT ON DATABASE
(Gevik
Babakhani)
This gives SQL-level control over database access. It works
as an additional filter on top of the existing
pg_hba.conf
controls.
-
Add support for
SSL Certificate Revocation List
(CRL) files (Libor Hoho)
The server and libpq both
recognize CRL files now.
-
GiST
indexes are now clusterable
(Teodor)
-
Remove routine autovacuum server log entries (Bruce)
pg_stat_activity
now shows autovacuum activity.
-
Track maximum XID age within individual tables, instead of
whole databases (Alvaro)
This reduces the overhead involved in preventing
transaction ID wraparound, by avoiding unnecessary VACUUMs.
-
Add last vacuum and analyze timestamp columns to the stats
collector (Larry Rosenman)
These values now appear in the
pg_stat_*_tables
system views.
-
Improve performance of statistics monitoring, especially
stats_command_string
(Tom, Bruce)
This release enables stats_command_string by default, now that
its overhead is minimal. This means
pg_stat_activity
will now show all active queries
by default.
-
Add a waiting column to
pg_stat_activity
(Tom)
This allows pg_stat_activity to show all the
information included in the ps display.
-
Add configuration parameter
update_process_title
to control whether the
ps display is updated for
every command (Bruce)
On platforms where it is expensive to update the
ps display, it may be
worthwhile to turn this off and rely solely on pg_stat_activity for status
information.
-
Allow units to be specified in configuration settings
(Peter)
For example, you can now set
shared_buffers
to 32MB
rather than mentally converting sizes.
-
Add support for include
directives in postgresql.conf
(Joachim Wieland)
-
Improve logging of protocol-level prepare/bind/execute
messages (Bruce, Tom)
Such logging now shows statement names, bind parameter
values, and the text of the query being executed. Also, the
query text is properly included in logged error messages
when enabled by log_min_error_statement.
-
Prevent
max_stack_depth
from being set to unsafe values
On platforms where we can determine the actual kernel stack
depth limit (which is most), make sure that the initial
default value of max_stack_depth
is safe, and reject attempts to set it to unsafely large
values.
-
Enable highlighting of error location in query in more
cases (Tom)
The server is now able to report a specific error location
for some semantic errors (such as unrecognized column
name), rather than just for basic syntax errors as before.
-
Fix « failed to re-find parent
key » errors in
VACUUM
(Tom)
-
Clean out pg_internal.init cache
files during server restart (Simon)
This avoids a hazard that the cache files might contain
stale data after PITR recovery.
-
Fix race condition for truncation of a large relation
across a gigabyte boundary by
VACUUM
(Tom)
-
Fix bug causing needless deadlock errors on row-level locks
(Tom)
-
Fix bugs affecting multi-gigabyte hash indexes (Tom)
-
Each backend process is now its own process group leader
(Tom)
This allows query cancel to abort subprocesses invoked from
a backend or archive/recovery process.
-
Add
INSERT
/
UPDATE
/
DELETE
RETURNING (Jonah Harris, Tom)
This allows these commands to return values, such as the
computed serial key for a new row. In the
UPDATE
case, values from
the updated version of the row are returned.
-
Add support for multiple-row
VALUES
clauses, per SQL standard (Joe,
Tom)
This allows
INSERT
to insert multiple
rows of constants, or queries to generate result sets using
constants. For example, INSERT ...
VALUES (...), (...), ...., and SELECT * FROM (VALUES (...), (...), ....) AS
alias(f1, ...).
-
Allow
UPDATE
and
DELETE
to use an
alias for the target table (Atsushi Ogawa)
The SQL standard does not permit an alias in these
commands, but many database systems allow one anyway for
notational convenience.
-
Allow
UPDATE
to set
multiple columns with a list of values (Susanne Ebrecht)
This is basically a short-hand for assigning the columns
and values in pairs. The syntax is UPDATE tab SET (
column
, ...) = (
val
, ...).
-
Make row comparisons work per standard (Tom)
The forms <, <=, >, >= now compare rows
lexicographically, that is, compare the first elements, if
equal compare the second elements, and so on. Formerly they
expanded to an AND condition across all the elements, which
was neither standard nor very useful.
-
Add
CASCADE
option to
TRUNCATE
(Joachim Wieland)
This causes
TRUNCATE
to automatically
include all tables that reference the specified table(s)
via foreign keys. While convenient, this is a dangerous
tool -- use with caution!
-
Support FOR UPDATE and FOR SHARE in the same
SELECT
command (Tom)
-
Add
IS NOT DISTINCT FROM
(Pavel Stehule)
This operator is similar to equality (=), but evaluates to true when both left and
right operands are NULL, and to
false when just one is, rather than yielding NULL in these cases.
-
Improve the length output used by
UNION
/INTERSECT/EXCEPT
(Tom)
When all corresponding columns are of the same defined
length, that length is used for the result, rather than a
generic length.
-
Allow
ILIKE
to
work for multi-byte encodings (Tom)
Internally, ILIKE now calls
lower() and then uses LIKE. Locale-specific regular expression
patterns still do not work in these encodings.
-
Enable
standard_conforming_strings
to
be turned on (Kevin Grittner)
This allows backslash escaping in strings to be disabled,
making PostgreSQL™
more standards-compliant. The default is off for backwards compatibility, but future
releases will default this to on.
-
Do not flatten subqueries that contain volatile functions in their target lists
(Jaime Casanova)
This prevents surprising behavior due to multiple
evaluation of a volatile function
(such as random() or nextval()). It may cause performance
degradation in the presence of functions that are
unnecessarily marked as volatile.
-
Add system views
pg_prepared_statements
and
pg_cursors
to show prepared statements
and open cursors (Joachim Wieland, Neil)
These are very useful in pooled connection setups.
-
Support portal parameters in
EXPLAIN
and
EXECUTE
(Tom)
This allows, for example, JDBC
?
parameters to work in these commands.
-
If SQL-level
PREPARE
parameters
are unspecified, infer their types from the content of the
query (Neil)
Protocol-level
PREPARE
already did this.
-
Allow LIMIT and OFFSET to exceed two billion (Dhanaraj M)
E.6.3.4. Object
Manipulation Changes
-
Add TABLESPACE clause to
CREATE
TABLE AS
(Neil)
This allows a tablespace to be specified for the new table.
-
Add ON COMMIT clause to
CREATE
TABLE AS
(Neil)
This allows temporary tables to be truncated or dropped on
transaction commit. The default behavior is for the table
to remain until the session ends.
-
Add INCLUDING CONSTRAINTS to
CREATE TABLE
LIKE
(Greg Stark)
This allows easy copying of CHECK
constraints to a new table.
-
Allow the creation of placeholder (shell) types
(Martijn van Oosterhout)
A shell type declaration creates a type name, without
specifying any of the details of the type. Making a shell
type is useful because it allows cleaner declaration of the
type's input/output functions, which must exist before the
type can be defined « for
real ». The syntax is
CREATE TYPE
typename
.
-
Aggregate functions now support
multiple input parameters (Sergey Koposov, Tom)
-
Add new aggregate creation syntax (Tom)
The new syntax is
CREATE
AGGREGATE
aggname
(
input_type
)
(
parameter_list
)
.
This more naturally supports the new multi-parameter
aggregate functionality. The previous syntax is still
supported.
-
Add
ALTER ROLE
PASSWORD NULL
to remove a previously
set role password (Peter)
-
Add
DROP
object IF EXISTS for many object
types (Andrew)
This allows
DROP
operations on
non-existent objects without generating an error.
-
Add
DROP OWNED
to
drop all objects owned by a role (Alvaro)
-
Add
REASSIGN
OWNED
to reassign ownership of all objects owned
by a role (Alvaro)
This, and DROP OWNED above,
facilitate dropping roles.
-
Add
GRANT ON
SEQUENCE
syntax (Bruce)
This was added for setting sequence-specific permissions.
GRANT ON TABLE for sequences is
still supported for backward compatibility.
-
Add
USAGE
permission for
sequences that allows only currval() and nextval(), not setval() (Bruce)
USAGE permission allows more
fine-grained control over sequence access. Granting
USAGE allows users to increment a
sequence, but prevents them from setting the sequence to an
arbitrary value using setval().
-
Add
ALTER TABLE [ NO ]
INHERIT
(Greg Stark)
This allows inheritance to be adjusted dynamically, rather
than just at table creation and destruction. This is very
valuable when using inheritance to implement table
partitioning.
-
Allow comments on global objects to be stored
globally (Kris Jurka)
Previously, comments attached to databases were stored in
individual databases, making them ineffective, and there
was no provision at all for comments on roles or
tablespaces. This change adds a new shared catalog
pg_shdescription
and stores
comments on databases, roles, and tablespaces therein.
E.6.3.5. Utility Command Changes
-
Add option to allow indexes to be created without blocking
concurrent writes to the table (Greg Stark, Tom)
The new syntax is
CREATE INDEX
CONCURRENTLY
. The default behavior is
still to block table modification while a index is being
created.
-
Provide
advisory locking functionality (Abhijit Menon-Sen, Tom)
This is a new locking API designed to replace what used to
be in /contrib/userlock. The userlock code is now on
pgfoundry.
-
Allow
COPY
to dump a
SELECT
query
(Zoltan Boszormenyi, Karel Zak)
This allows
COPY
to dump arbitrary
SQL queries. The syntax
is COPY (SELECT ...) TO.
-
Make the
COPY
command return a
command tag that includes the number of rows copied (Volkan
YAZICI)
-
Allow
VACUUM
to expire rows
without being affected by other concurrent
VACUUM
operations (Hannu
Krossing, Alvaro, Tom)
-
Make
initdb
detect
the operating system locale and set the default DateStyle accordingly (Peter)
This makes it more likely that the installed postgresql.conf
DateStyle value will be as desired.
-
Reduce number of progress messages displayed by
initdb (Tom)
E.6.3.6. Date/Time Changes
-
Allow full timezone names in
timestamp
input values (Joachim Wieland)
For example, '2006-05-24 21:11
America/New_York'::timestamptz.
-
Support configurable timezone abbreviations (Joachim
Wieland)
A desired set of timezone abbreviations can be chosen via
the configuration parameter
timezone_abbreviations
.
-
Add
pg_timezone_abbrevs
and
pg_timezone_names
views to show
supported timezones (Magnus Hagander)
-
Add
clock_timestamp()
,
statement_timestamp()
, and
transaction_timestamp()
(Bruce)
clock_timestamp() is the current
wall-clock time, statement_timestamp() is the time the
current statement arrived at the server, and transaction_timestamp() is an alias for
now().
-
Allow
to_char()
to print localized month and day names
(Euler Taveira de Oliveira)
-
Allow
to_char(time)
and
to_char(interval)
to output AM/PM specifications (Bruce)
Intervals and times are treated as 24-hour periods, e.g.
25 hours is considered
AM.
-
Add new function
justify_interval()
to adjust interval
units (Mark Dilger)
-
Allow timezone offsets up to 14:59 away from GMT
Kiribati uses GMT+14, so we'd better accept that.
-
Interval computation improvements (Michael Glaesemann,
Bruce)
E.6.3.7. Other
Data Type and Function Changes
-
Allow arrays to contain NULL
elements (Tom)
-
Allow assignment to array elements not contiguous with the
existing entries (Tom)
The intervening array positions will be filled with nulls.
This is per SQL standard.
-
New built-in operators
for array-subset comparisons (@>, <@,
&&) (Teodor, Tom)
These operators can be indexed for many data types using
GiST or GIN indexes.
-
Add convenient arithmetic operations
on INET/CIDR values (Stephen R. van den Berg)
The new operators are & (and),
| (or), ~
(not), inet
+
int8,
inet
-
int8, and inet
-
inet.
-
Add new
aggregate functions from SQL:2003 (Neil)
The new functions are var_pop(),
var_samp(), stddev_pop(), and stddev_samp(). var_samp() and stddev_samp() are merely renamings of the
existing aggregates variance()
and stddev(). The latter names
remain available for backward compatibility.
-
Add SQL:2003 statistical
aggregates (Sergey Koposov)
New functions: regr_intercept(),
regr_slope(), regr_r2(), corr(), covar_samp(), covar_pop(), regr_avgx(), regr_avgy(), regr_sxy(), regr_sxx(), regr_syy(), regr_count().
-
Allow domains to be based on other domains
(Tom)
-
Properly enforce domain
CHECK
constraints everywhere (Neil, Tom)
For example, the result of a user-defined function that is
declared to return a domain type is now checked against the
domain's constraints. This closes a significant hole in the
domain implementation.
-
Fix problems with dumping renamed
SERIAL
columns (Tom)
The fix is to dump a SERIAL
column by explicitly specifying its DEFAULT and sequence elements, and
reconstructing the SERIAL column
on reload using a new
ALTER
SEQUENCE OWNED BY
command. This also
allows dropping a SERIAL column
specification.
-
Add a server-side sleep function
pg_sleep()
(Joachim Wieland)
-
Add all comparison operators for the
tid
(tuple id) data type (Mark Kirkwood,
Greg Stark, Tom)
E.6.3.8. PL/PgSQL Server-Side Language
Changes
-
Add TG_table_name and TG_table_schema to trigger parameters
(Andrew)
TG_relname is now deprecated.
Comparable changes have been made in the trigger parameters
for the other PLs as well.
-
Allow FOR statements to return
values to scalars as well as records and row types (Pavel
Stehule)
-
Add a BY clause to the FOR loop, to control the iteration increment
(Jaime Casanova)
-
Add STRICT to
SELECT
INTO
(Matt Miller)
STRICT mode throws an exception if
more or less than one row is returned by the
SELECT
, for Oracle PL/SQL™ compatibility.
E.6.3.9. PL/Perl Server-Side Language
Changes
-
Add table_name and table_schema to trigger parameters (Adam
Sjogren)
-
Add prepared queries (Dmitry Karasik)
-
Make $_TD trigger data a global
variable (Andrew)
Previously, it was lexical, which caused unexpected sharing
violations.
-
Run PL/Perl and PL/PerlU in separate interpreters, for
security reasons (Andrew)
In consequence, they can no longer share data nor loaded
modules. Also, if Perl has not been compiled with the
requisite flags to allow multiple interpreters, only one of
these languages can be used in any given backend process.
E.6.3.10. PL/Python Server-Side
Language Changes
-
Named parameters are passed as ordinary variables, as well
as in the args[] array (Sven
Suursoho)
-
Add table_name and table_schema to trigger parameters (Andrew)
-
Allow returning of composite types and result sets (Sven
Suursoho)
-
Return result-set as list,
iterator, or generator (Sven Suursoho)
-
Allow functions to return void
(Neil)
-
Python 2.5 is now supported (Tom)
-
Add new command \password for
changing role password with client-side password encryption
(Peter)
-
Allow \c to connect to a new host
and port number (David, Volkan YAZICI)
-
Add tablespace display to \l+
(Philip Yarra)
-
Improve \df slash command to
include the argument names and modes (OUT or INOUT) of
the function (David Fetter)
-
Support binary
COPY
(Andreas Pflug)
-
Add option to run the entire session in a single
transaction (Simon)
Use option -1 or --single-transaction.
-
Support for automatically retrieving
SELECT
results in batches
using a cursor (Chris Mair)
This is enabled using
\set
FETCH_COUNT
n
. This feature
allows large result sets to be retrieved in psql without attempting to buffer the
entire result set in memory.
-
Make multi-line values align in the proper column (Martijn
van Oosterhout)
Field values containing newlines are now displayed in a
more readable fashion.
-
Save multi-line statements as a single entry, rather than
one line at a time (Sergey E. Koposov)
This makes up-arrow recall of queries easier. (This is not
available on Windows, because that platform uses the native
command-line editing present in the operating system.)
-
Make the line counter 64-bit so it can handle files with
more than two billion lines (David Fetter)
-
Report both the returned data and the command status tag
for
INSERT
/
UPDATE
/
DELETE RETURNING
(Tom)
-
Allow complex selection of objects to be included or
excluded by pg_dump (Greg
Sabino Mullane)
pg_dump now supports
multiple -n (schema) and
-t (table) options, and adds
-N and -T
options to exclude objects. Also, the arguments of these
switches can now be wild-card expressions rather than
single object names, for example -t
'foo*', and a schema can be part of a -t or -T switch,
for example -t schema1.table1.
-
Add
pg_restore
--no-data-for-failed-tables option to
suppress loading data if table creation failed (i.e., the
table already exists) (Martin Pitt)
-
Add
pg_restore
option to run the
entire session in a single transaction (Simon)
Use option -1 or --single-transaction.
| |