The to_ascii function supports conversion from
- LATIN1>, LATIN2>, and WIN1250> only.
+ LATIN1>, LATIN2>, LATIN9>,
+ and WIN1250> encodings only.
There are three separate approaches to pattern matching provided
by
PostgreSQL: the traditional
- more recent <literal>>SIMILAR TO operator (since
+ more recent <function>SIMILAR TO operator (added in
SQL:1999), and
POSIX-style regular expressions.
Additionally, a pattern matching function,
substring, is available, using either
- <literal>SIMILAR TO>-style or POSIX-style regular
+ <function>SIMILAR TO>-style or POSIX-style regular
expressions.
LIKE pattern matches always cover the entire
- string. To match a pattern anywhere within a string, the
+ string. To match a sequence anywhere within a string, the
pattern must therefore start and end with a percent sign.
The key word ILIKE can be used instead of
- LIKE to make the match case insensitive according
+ LIKE to make the match case-insensitive according
to the active locale. This is not in the
SQL standard but is a
pattern. But if the pattern contains any parentheses, the portion
of the text that matched the first parenthesized subexpression (the
one whose left parenthesis comes first) is
- returned. You can always put parentheses around the whole expression
+ returned. You can put parentheses around the whole expression
if you want to use parentheses within it without triggering this
- exception. Also see the non-capturing parentheses described below.
+ exception. If you need parentheses in the pattern before the
+ subexpression you want to extract, see the non-capturing parentheses
+ described below.
The forms using {>...>}>
- are known as bound>s.
+ are known as bounds>.
The numbers m> and n> within a bound are
unsigned decimal integers with permissible values from 0 to 255 inclusive.
Normally the flavor of RE being used is determined by
regex_flavor>.
However, this can be overridden by a director> prefix.
- If an RE of any flavor begins with ***:>,
- the rest of the RE is taken as an ARE.
- If an RE of any flavor begins with ***=>,
+ If an RE begins with ***:>,
+ the rest of the RE is taken as an ARE regardless of
+ regex_flavor>.
+ If an RE begins with ***=>,
the rest of the RE is taken to be a literal string,
with all characters considered ordinary characters.
Embedded options take effect at the )> terminating the sequence.
- They are available only at the start of an ARE,
- and may not be used later within it.
+ They may appear only at the start of an ARE (after the
+ ***:> director if any).
- white space and comments are illegal within multi-character symbols,
- like the ARE (?:> or the BRE \(>
+ white space and comments cannot appear within multi-character symbols,
+ such as (?:>
- Expanded-syntax white-space characters are blank, tab, newline, and
+ For this purpose, white-space characters are blank, tab, newline, and
any character that belongs to the space> character class.
- Usage notes for the date/time formatting:
+ Usage notes for date/time formatting:
- Usage notes for the numeric formatting:
+ Usage notes for numeric formatting:
The extract function retrieves subfields
- from date/time values, such as year or hour.
- source is a value expression that
- evaluates to type timestamp or interval.
- (Expressions of type date or time will
+ such as year or hour from date/time values.
+ source must be a value expression of
+ type timestamp, time, or interval.
+ (Expressions of type date will
be cast to timestamp and can therefore be used as
well.) field is an identifier or
string that selects what field to extract from the source value.
- <note>
+ <tip>
You do not want to use the third form when specifying a DEFAULT>
clause while creating a table. The system will convert now
because they are function calls. Thus they will give the desired
behavior of defaulting to the time of row insertion.
- note>
+ tip>
shows the functions
available for use with array types. See
- for more discussion and examples for the use of these functions.
+ for more discussion and examples of the use of these functions.
anyarray
-
- concatenate two arrays, returning NULL
- for NULL inputs
-
+ concatenate two arrays
array_cat(ARRAY[1,2,3], ARRAY[4,5])
{1,2,3,4,5}
anyarray
-
- append an element to the end of an array, returning
- NULL for NULL inputs
-
+ append an element to the end of an array
array_append(ARRAY[1,2], 3)
{1,2,3}
anyarray
-
- append an element to the beginning of an array, returning
- NULL for NULL inputs
-
+ append an element to the beginning of an array
array_prepend(1, ARRAY[2,3])
{1,2,3}
text
-
- returns a text representation of array dimension lower and upper bounds,
- generating an ERROR for NULL inputs
-
+ returns a text representation of array's dimensions
array_dims(array[[1,2,3], [4,5,6]])
[1:2][1:3]
integer
-
- returns lower bound of the requested array dimension, returning
- NULL for NULL inputs
-
+ returns lower bound of the requested array dimension
array_lower(array_prepend(0, ARRAY[1,2,3]), 1)
0
integer
-
- returns upper bound of the requested array dimension, returning
- NULL for NULL inputs
-
+ returns upper bound of the requested array dimension
array_upper(ARRAY[1,2,3,4], 1)
4
text
-
- concatenates array elements using provided delimiter, returning
- NULL for NULL inputs
-
+ concatenates array elements using provided delimiter
array_to_string(array[1, 2, 3], '~^~')
1~^~2~^~3
text[]
-
- splits string into array elements using provided delimiter, returning
- NULL for NULL inputs
-
+ splits string into array elements using provided delimiter
string_to_array( 'xx~^~yy~^~zz', '~^~')
{xx,yy,zz}
It should be noted that except for count,
these functions return a null value when no rows are selected. In
particular, sum of no rows returns null, not
- zero as one might expect. The function coalesce may be
+ zero as one might expect. The coalesce function may be
used to substitute zero for null when necessary.
- The session_user is the user that initiated a
- database connection; it is fixed for the duration of that
- connection. The current_user is the user identifier
+ The session_user is normally the user who initiated
+ the current database connection; but superusers can change this setting
+ with .
+ The current_user is the user identifier
that is applicable for permission checking. Normally, it is equal
to the session user, but it changes during the execution of
functions with the attribute SECURITY DEFINER.
inet_server_addr returns the IP address on which
the server accepted the current connection, and
inet_server_port returns the port number.
- All these functions return NULL if the connection is via a Unix-domain
- socket.
+ All these functions return NULL if the current connection is via a
+ Unix-domain socket.
- To evaluate whether a user holds a grant option on the privilege,
+ To test whether a user holds a grant option on the privilege,
append WITH GRANT OPTION to the privilege key
word; for example 'UPDATE WITH GRANT OPTION'.
-
+
Indexes
- Once the index is created, no further intervention is required: the
+ Once an index is created, no further intervention is required: the
system will update the index when the table is modified, and it will
use the index in queries when it thinks this would be more efficient
than a sequential table scan. But you may have to run the
- It is especially fatal to use proportionally reduced data sets.
+ It is especially fatal to use very small test data sets.
While selecting 1000 out of 100000 rows could be a candidate for
an index, selecting 1 out of 100 rows will hardly be, because the
100 rows will probably fit within a single disk page, and there
- In
PostgreSQL, you can
use all four
- possible transaction isolation levels. Internally, there are only
- two distinct isolation levels, which correspond to the levels Read
+ In
PostgreSQL, you can
request any of the
+ four standard transaction isolation levels. But internally, there are
+ only two distinct isolation levels, which correspond to the levels Read
Committed and Serializable. When you select the level Read
Uncommitted you really get Read Committed, and when you select
Repeatable Read you really get Serializable, so the actual
define which phenomena must not happen, they do not define which
phenomena must happen. The reason that
PostgreSQL>
only provides two isolation levels is that this is the only
- sensible way to map the isolation levels to the multiversion
+ sensible way to map the standard isolation levels to the multiversion
concurrency control architecture. The behavior of the available
isolation levels is detailed in the following subsections.