+
+ in PL/pgSQL>
+
As each expression and
SQL command is first
executed in the function, the
PL/pgSQL> interpreter
creates a prepared execution plan (using the
SPI manager's
SPI_prepare
- and SPI_saveplan
- functions).
preparing a query>in
- PL/pgSQL>> Subsequent visits to that expression or command
+ and SPI_saveplan functions).
+ Subsequent visits to that expression or command
reuse the prepared plan. Thus, a function with conditional code
that contains many statements for which execution plans might be
required will only prepare and save those plans that are really
Null, None
If an SQL null value
null value
- sortas="PL/Python">PL/Python is passed to a
+ sortas="PL/Python">in PL/Python is passed to a
function, the argument value will appear as None in
Python. The above function definition will return the wrong answer for null
inputs. We could add STRICT to the function definition
data between function calls. This variable is private static data.
The global dictionary GD is public data,
available to all Python functions within a session. Use with
- PL/Python>
+ in PL/Python>
Prepares and saves a query plan for later execution. The
saved plan will be retained for the life of the current
- session.
preparing a query>in
- PL/Tcl>>
+ session.
preparing a query>
+ in PL/Tcl>>
The query can use parameters, that is, placeholders for
all sales of the product.
+
- If the products table is set up so that,
- say, product_id is the primary key, then it
- would be enough to group by product_id in the
- above example, since name and price would
- be functionally
- dependency on the product ID, and so there
- would be no ambiguity about which name and price value to return
- for each product ID group.
+ If the products table is set up so that, say,
+ product_id is the primary key, then it would be
+ enough to group by product_id in the above example,
+ since name and price would be functionally
+ dependent on the product ID, and so there would be no
+ ambiguity about which name and price value to return for each product
+ ID group.
can be used to specify the default behavior of retaining all rows.)
+
+ in DISTINCT>
+
+
- DISTINCT>
Obviously, two rows are considered distinct if they differ in at
least one column value. Null values are considered equal in this
comparison.
trust other local users, we recommend you use one of
initdb 's -W , --pwprompt
or --pwfile options to assign a password to the
- database superuser.
password>of the
- superuser> Also, specify -A md5> or
+ database superuser.
+ of the superuser>
+
+ Also, specify -A md5> or
-A password> so that the default trust> authentication
mode is not used; or modify the generated pg_hba.conf
file after running initdb , but
Normally, you will want to start the database server when the
- computer boots.
booting>starting
- the server during>> Autostart scripts are operating-system-specific.
+ computer boots.
+ starting the server during>
+
+ Autostart scripts are operating-system-specific.
There are a few distributed with
contrib/start-scripts> directory. Installing one will require
Memory Management
+
+ in SPI
+
PostgreSQL allocates memory within
- contextin SPI , which provide a convenient method of
+ memory contexts , which provide a convenient method of
managing allocations made in many different places that need to
live for differing amounts of time. Destroying a context releases
all the memory that was allocated in it. Thus, it is not necessary
ampersands. The length limitation still applies.
+
+ in identifiers
+
+
- identifiers A variant of quoted
+ A variant of quoted
identifiers allows including escaped Unicode characters identified
by their code points. This variant starts
with U& (upper or lower case U followed by
+
+ arguments for trigger functions>
+
When a trigger is being defined, arguments can be specified for
- it.
trigger>arguments for trigger
- functions> The purpose of including arguments in the
+ it. The purpose of including arguments in the
trigger definition is to allow different triggers with similar
requirements to call the same function. As an example, there
could be a generalized trigger function that takes as its
- A user-defined type must always have input and output
- functions.
input function of
- functionof a data type
+ A user-defined type must always have input and output functions.
These functions determine how the type appears in strings (for input
by the user and output to the user) and how the type is organized in
memory. The input function takes a null-terminated character string
+
+ of user-defined type
+
When you define a new base type,
PostgreSQL automatically provides support
- for arrays of that
- type.
array of user-defined
- type The array type typically
+ for arrays of that type. The array type typically
has the same name as the base type with the underscore character
(_>) prepended.