Database Reference
In-Depth Information
implementation follows the standards decreed in SQL/Management of External
Data (MED) .
Many programmers have already developed FDWs for popular data sources that
they freely share. You can try your hand at creating your own FDWs as well. (Be
sure to publicize your success so the community can reap the fruits of your toil.)
Install FDWs using the extension framework. Once they're installed, pgAdmin will
show them listed under a node called Foreign Data Wrappers.
tablespace
A tablespace is the physical location where data is stored. PostgreSQL allows ta‐
blespaces to be independently managed, so you can easily move databases or even
single tables and indexes to different drives.
view
Most relational database products offer views for abstracting queries and allow for
updating data via a view. PostgreSQL offers the same features and allows for auto-
updatable single-table views in versions 9.3 and later that don't require any extra
writing of rules or triggers to make them updatable. For more complex logic or
views involving more than one table, you still need triggers or rules to make the
view updatable. Version 9.3 introduced materialized views, which cache data to
speed up commonly used queries. See “Materialized Views” on page 123 .
function
Functions in PostgreSQL can return a scalar value or sets of records. You can also
write functions to manipulate data; when functions are used in this fashion, other
database engines call them stored procedures.
language
Functions are created in procedural languages (PLs). Out of the box, PostgreSQL
supports three: SQL, PL/pgSQL, and C. You can install additional languages using
the CREATE EXTENSION or CREATE PRODCEDURAL LANGUAGE commands. Languages
currently in vogue are Python, JavaScript, Perl, and R. You'll see plenty of examples
in Chapter 8 .
operator
Operators are symbolic, named functions (e.g., = , && ) that take one or two argu‐
ments and that have the backing of a function. In PostgreSQL, you can invent your
own. When you define a custom type, you can also define operators that work with
that custom type. For example, you can define the = operator for your type. You can
even define an operator with operands of two disparate types.
data type (or just type )
Every database product has a set of data types that it works with: integers, characters,
arrays, etc. PostgreSQL has something called a composite type , which is a type that
has attributes from other types. Imaginary numbers, polar coordinates, and tensors
Search WWH ::




Custom Search