Update SQL query results for lists of operators and functions.
Add a little info on count().
This commit is contained in:
parent
0a95a17da2
commit
ff5edbd9e6
@ -1,6 +1,6 @@
|
|||||||
.\" This is -*-nroff-*-
|
.\" This is -*-nroff-*-
|
||||||
.\" XXX standard disclaimer belongs here....
|
.\" XXX standard disclaimer belongs here....
|
||||||
.\" $Header: /cvsroot/pgsql/src/man/Attic/built-in.3,v 1.5 1997/04/23 03:18:27 scrappy Exp $
|
.\" $Header: /cvsroot/pgsql/src/man/Attic/built-in.3,v 1.6 1997/04/27 19:26:24 thomas Exp $
|
||||||
.TH BUILT-INS INTRO 04/01/97 PostgreSQL PostgreSQL
|
.TH BUILT-INS INTRO 04/01/97 PostgreSQL PostgreSQL
|
||||||
.SH "DESCRIPTION"
|
.SH "DESCRIPTION"
|
||||||
This section describes the data types, functions and operators
|
This section describes the data types, functions and operators
|
||||||
@ -534,30 +534,25 @@ circle
|
|||||||
float8 diameter(circle) diameter of circle
|
float8 diameter(circle) diameter of circle
|
||||||
float8 area(circle) area of circle
|
float8 area(circle) area of circle
|
||||||
.fi
|
.fi
|
||||||
|
.SH "BINARY OPERATORS"
|
||||||
.PP
|
|
||||||
This list was generated from the Postgres system catalogs with the
|
This list was generated from the Postgres system catalogs with the
|
||||||
query:
|
query:
|
||||||
|
|
||||||
.nf
|
.nf
|
||||||
SELECT
|
SELECT t0.typname AS result,
|
||||||
t0.typname AS result,
|
|
||||||
t1.typname AS left_type,
|
t1.typname AS left_type,
|
||||||
t2.typname AS right_type,
|
t2.typname AS right_type,
|
||||||
o.oprname AS operatr,
|
o.oprname AS operatr,
|
||||||
p.proname AS func_name
|
p.proname AS func_name
|
||||||
FROM
|
FROM pg_proc p, pg_type t0,
|
||||||
pg_proc p, pg_type t0,
|
|
||||||
pg_type t1, pg_type t2,
|
pg_type t1, pg_type t2,
|
||||||
pg_operator o
|
pg_operator o
|
||||||
WHERE
|
WHERE p.prorettype = t0.oid AND
|
||||||
p.prorettype = t0.oid AND
|
|
||||||
RegprocToOid(o.oprcode) = p.oid AND
|
RegprocToOid(o.oprcode) = p.oid AND
|
||||||
p.pronargs = 2 AND
|
p.pronargs = 2 AND
|
||||||
o.oprleft = t1.oid AND
|
o.oprleft = t1.oid AND
|
||||||
o.oprright = t2.oid
|
o.oprright = t2.oid
|
||||||
ORDER BY
|
ORDER BY result, left_type, right_type, operatr;
|
||||||
result, left_type, right_type, operatr;
|
|
||||||
.fi
|
.fi
|
||||||
|
|
||||||
These operations are cast in terms of SQL types and so are
|
These operations are cast in terms of SQL types and so are
|
||||||
@ -566,7 +561,7 @@ directly usable as C function prototypes.
|
|||||||
|
|
||||||
.nf
|
.nf
|
||||||
result |left_type |right_type|operatr|func_name
|
result |left_type |right_type|operatr|func_name
|
||||||
---------+----------+----------+-------+---------------
|
---------+----------+----------+-------+-----------------
|
||||||
_aclitem |_aclitem |aclitem |+ |aclinsert
|
_aclitem |_aclitem |aclitem |+ |aclinsert
|
||||||
_aclitem |_aclitem |aclitem |- |aclremove
|
_aclitem |_aclitem |aclitem |- |aclremove
|
||||||
abstime |abstime |reltime |+ |timepl
|
abstime |abstime |reltime |+ |timepl
|
||||||
@ -608,8 +603,10 @@ bool |abstime |abstime |= |abstimeeq
|
|||||||
bool |abstime |abstime |> |abstimegt
|
bool |abstime |abstime |> |abstimegt
|
||||||
bool |abstime |abstime |>= |abstimege
|
bool |abstime |abstime |>= |abstimege
|
||||||
bool |abstime |tinterval |<?> |ininterval
|
bool |abstime |tinterval |<?> |ininterval
|
||||||
|
bool |bool |bool |< |boollt
|
||||||
bool |bool |bool |<> |boolne
|
bool |bool |bool |<> |boolne
|
||||||
bool |bool |bool |= |booleq
|
bool |bool |bool |= |booleq
|
||||||
|
bool |bool |bool |> |boolgt
|
||||||
bool |box |box |&& |box_overlap
|
bool |box |box |&& |box_overlap
|
||||||
bool |box |box |&< |box_overleft
|
bool |box |box |&< |box_overleft
|
||||||
bool |box |box |&> |box_overright
|
bool |box |box |&> |box_overright
|
||||||
@ -691,12 +688,34 @@ bool |char8 |text |!~~ |char8nlike
|
|||||||
bool |char8 |text |~ |char8regexeq
|
bool |char8 |text |~ |char8regexeq
|
||||||
bool |char8 |text |~* |char8icregexeq
|
bool |char8 |text |~* |char8icregexeq
|
||||||
bool |char8 |text |~~ |char8like
|
bool |char8 |text |~~ |char8like
|
||||||
|
bool |circle |circle |!^ |circle_above
|
||||||
|
bool |circle |circle |!\| |circle_below
|
||||||
|
bool |circle |circle |&& |circle_overlap
|
||||||
|
bool |circle |circle |&< |circle_overleft
|
||||||
|
bool |circle |circle |&> |circle_overright
|
||||||
|
bool |circle |circle |< |circle_eq
|
||||||
|
bool |circle |circle |<< |circle_left
|
||||||
|
bool |circle |circle |<= |circle_eq
|
||||||
|
bool |circle |circle |<> |circle_ne
|
||||||
|
bool |circle |circle |= |circle_eq
|
||||||
|
bool |circle |circle |> |circle_eq
|
||||||
|
bool |circle |circle |>= |circle_eq
|
||||||
|
bool |circle |circle |>> |circle_right
|
||||||
|
bool |circle |circle |@ |circle_contained
|
||||||
|
bool |circle |circle |~ |circle_contain
|
||||||
|
bool |circle |circle |~= |circle_same
|
||||||
bool |date |date |< |date_lt
|
bool |date |date |< |date_lt
|
||||||
bool |date |date |<= |date_le
|
bool |date |date |<= |date_le
|
||||||
bool |date |date |<> |date_ne
|
bool |date |date |<> |date_ne
|
||||||
bool |date |date |= |date_eq
|
bool |date |date |= |date_eq
|
||||||
bool |date |date |> |date_gt
|
bool |date |date |> |date_gt
|
||||||
bool |date |date |>= |date_ge
|
bool |date |date |>= |date_ge
|
||||||
|
bool |datetime |datetime |< |datetime_lt
|
||||||
|
bool |datetime |datetime |<= |datetime_le
|
||||||
|
bool |datetime |datetime |<> |datetime_ne
|
||||||
|
bool |datetime |datetime |= |datetime_eq
|
||||||
|
bool |datetime |datetime |> |datetime_gt
|
||||||
|
bool |datetime |datetime |>= |datetime_ge
|
||||||
bool |float4 |float4 |< |float4lt
|
bool |float4 |float4 |< |float4lt
|
||||||
bool |float4 |float4 |<= |float4le
|
bool |float4 |float4 |<= |float4le
|
||||||
bool |float4 |float4 |<> |float4ne
|
bool |float4 |float4 |<> |float4ne
|
||||||
@ -735,6 +754,12 @@ bool |int4 |int4 |> |int4gt
|
|||||||
bool |int4 |int4 |>= |int4ge
|
bool |int4 |int4 |>= |int4ge
|
||||||
bool |int4 |name |!!= |int4notin
|
bool |int4 |name |!!= |int4notin
|
||||||
bool |int4 |oid |= |int4eqoid
|
bool |int4 |oid |= |int4eqoid
|
||||||
|
bool |money |money |< |cash_lt
|
||||||
|
bool |money |money |<= |cash_le
|
||||||
|
bool |money |money |<> |cash_ne
|
||||||
|
bool |money |money |= |cash_eq
|
||||||
|
bool |money |money |> |cash_gt
|
||||||
|
bool |money |money |>= |cash_ge
|
||||||
bool |name |name |< |namelt
|
bool |name |name |< |namelt
|
||||||
bool |name |name |<= |namele
|
bool |name |name |<= |namele
|
||||||
bool |name |name |<> |namene
|
bool |name |name |<> |namene
|
||||||
@ -812,6 +837,18 @@ bool |time |time |<> |time_ne
|
|||||||
bool |time |time |= |time_eq
|
bool |time |time |= |time_eq
|
||||||
bool |time |time |> |time_gt
|
bool |time |time |> |time_gt
|
||||||
bool |time |time |>= |time_ge
|
bool |time |time |>= |time_ge
|
||||||
|
bool |timespan |timespan |< |timespan_lt
|
||||||
|
bool |timespan |timespan |<= |timespan_le
|
||||||
|
bool |timespan |timespan |<> |timespan_ne
|
||||||
|
bool |timespan |timespan |= |timespan_eq
|
||||||
|
bool |timespan |timespan |> |timespan_gt
|
||||||
|
bool |timespan |timespan |>= |timespan_ge
|
||||||
|
bool |timestamp |timestamp |< |timestamplt
|
||||||
|
bool |timestamp |timestamp |<= |timestample
|
||||||
|
bool |timestamp |timestamp |<> |timestampne
|
||||||
|
bool |timestamp |timestamp |= |timestampeq
|
||||||
|
bool |timestamp |timestamp |> |timestampgt
|
||||||
|
bool |timestamp |timestamp |>= |timestampge
|
||||||
bool |tinterval |reltime |#< |intervallenlt
|
bool |tinterval |reltime |#< |intervallenlt
|
||||||
bool |tinterval |reltime |#<= |intervallenle
|
bool |tinterval |reltime |#<= |intervallenle
|
||||||
bool |tinterval |reltime |#<> |intervallenne
|
bool |tinterval |reltime |#<> |intervallenne
|
||||||
@ -837,10 +874,16 @@ char |char |char |* |charmul
|
|||||||
char |char |char |+ |charpl
|
char |char |char |+ |charpl
|
||||||
char |char |char |- |charmi
|
char |char |char |- |charmi
|
||||||
char |char |char |/ |chardiv
|
char |char |char |/ |chardiv
|
||||||
|
date |date |int4 |+ |date_pli
|
||||||
|
date |date |int4 |- |date_mii
|
||||||
|
datetime |datetime |timespan |+ |datetime_add_span
|
||||||
|
datetime |datetime |timespan |- |datetime_sub_span
|
||||||
float4 |float4 |float4 |* |float4mul
|
float4 |float4 |float4 |* |float4mul
|
||||||
float4 |float4 |float4 |+ |float4pl
|
float4 |float4 |float4 |+ |float4pl
|
||||||
float4 |float4 |float4 |- |float4mi
|
float4 |float4 |float4 |- |float4mi
|
||||||
float4 |float4 |float4 |/ |float4div
|
float4 |float4 |float4 |/ |float4div
|
||||||
|
float8 |box |box |<===> |box_distance
|
||||||
|
float8 |circle |circle |<===> |circle_distance
|
||||||
float8 |float4 |float8 |* |float48mul
|
float8 |float4 |float8 |* |float48mul
|
||||||
float8 |float4 |float8 |+ |float48pl
|
float8 |float4 |float8 |+ |float48pl
|
||||||
float8 |float4 |float8 |- |float48mi
|
float8 |float4 |float8 |- |float48mi
|
||||||
@ -854,11 +897,21 @@ float8 |float8 |float8 |+ |float8pl
|
|||||||
float8 |float8 |float8 |- |float8mi
|
float8 |float8 |float8 |- |float8mi
|
||||||
float8 |float8 |float8 |/ |float8div
|
float8 |float8 |float8 |/ |float8div
|
||||||
float8 |float8 |float8 |^ |dpow
|
float8 |float8 |float8 |^ |dpow
|
||||||
|
float8 |lseg |box |<===> |dist_sb
|
||||||
|
float8 |lseg |lseg |<===> |lseg_distance
|
||||||
|
float8 |path |path |<===> |path_distance
|
||||||
|
float8 |point |box |<===> |dist_pl
|
||||||
|
float8 |point |box |<===> |dist_ps
|
||||||
|
float8 |point |box |<===> |dist_pb
|
||||||
|
float8 |point |lseg |<===> |dist_ps
|
||||||
|
float8 |point |path |<===> |dist_ppth
|
||||||
|
float8 |point |point |<===> |point_distance
|
||||||
int2 |int2 |int2 |% |int2mod
|
int2 |int2 |int2 |% |int2mod
|
||||||
int2 |int2 |int2 |* |int2mul
|
int2 |int2 |int2 |* |int2mul
|
||||||
int2 |int2 |int2 |+ |int2pl
|
int2 |int2 |int2 |+ |int2pl
|
||||||
int2 |int2 |int2 |- |int2mi
|
int2 |int2 |int2 |- |int2mi
|
||||||
int2 |int2 |int2 |/ |int2div
|
int2 |int2 |int2 |/ |int2div
|
||||||
|
int4 |date |date |- |date_mi
|
||||||
int4 |int2 |int4 |% |int24mod
|
int4 |int2 |int4 |% |int24mod
|
||||||
int4 |int2 |int4 |* |int24mul
|
int4 |int2 |int4 |* |int24mul
|
||||||
int4 |int2 |int4 |+ |int24pl
|
int4 |int2 |int4 |+ |int24pl
|
||||||
@ -886,7 +939,13 @@ int4 |int4 |int4 |* |int4mul
|
|||||||
int4 |int4 |int4 |+ |int4pl
|
int4 |int4 |int4 |+ |int4pl
|
||||||
int4 |int4 |int4 |- |int4mi
|
int4 |int4 |int4 |- |int4mi
|
||||||
int4 |int4 |int4 |/ |int4div
|
int4 |int4 |int4 |/ |int4div
|
||||||
int4 |point |point |<===> |pointdist
|
money |money |float8 |* |cash_mul
|
||||||
|
money |money |float8 |/ |cash_div
|
||||||
|
money |money |money |+ |cash_pl
|
||||||
|
money |money |money |- |cash_mi
|
||||||
|
timespan |datetime |datetime |- |datetime_sub
|
||||||
|
timespan |timespan |timespan |+ |timespan_add
|
||||||
|
timespan |timespan |timespan |- |timespan_sub
|
||||||
tinterval|abstime |abstime |<#> |mktinterval
|
tinterval|abstime |abstime |<#> |mktinterval
|
||||||
|
|
||||||
|
|
||||||
@ -912,16 +971,18 @@ left_unary|operand |return_type
|
|||||||
@@ |box |point
|
@@ |box |point
|
||||||
@ |float4 |float4
|
@ |float4 |float4
|
||||||
- |float4 |float4
|
- |float4 |float4
|
||||||
|
|/ |float8 |float8
|
||||||
|
@ |float8 |float8
|
||||||
; |float8 |float8
|
; |float8 |float8
|
||||||
: |float8 |float8
|
: |float8 |float8
|
||||||
% |float8 |float8
|
% |float8 |float8
|
||||||
||/ |float8 |float8
|
||/ |float8 |float8
|
||||||
|/ |float8 |float8
|
|
||||||
@ |float8 |float8
|
|
||||||
- |float8 |float8
|
- |float8 |float8
|
||||||
- |int2 |int2
|
- |int2 |int2
|
||||||
- |int4 |int4
|
|
||||||
!! |int4 |int4
|
!! |int4 |int4
|
||||||
|
- |int4 |int4
|
||||||
|
# |polygon |int4
|
||||||
|
- |timespan |timespan
|
||||||
| |tinterval|abstime
|
| |tinterval|abstime
|
||||||
|
|
||||||
.fi
|
.fi
|
||||||
@ -962,25 +1023,41 @@ WHERE a.aggbasetype = t.oid
|
|||||||
ORDER BY aggname, typname;
|
ORDER BY aggname, typname;
|
||||||
|
|
||||||
aggname|typname
|
aggname|typname
|
||||||
-------+-------
|
-------+--------
|
||||||
avg |float4
|
avg |float4
|
||||||
avg |float8
|
avg |float8
|
||||||
avg |int2
|
avg |int2
|
||||||
avg |int4
|
avg |int4
|
||||||
|
avg |money
|
||||||
|
max |abstime
|
||||||
|
max |date
|
||||||
|
max |datetime
|
||||||
max |float4
|
max |float4
|
||||||
max |float8
|
max |float8
|
||||||
max |int2
|
max |int2
|
||||||
max |int4
|
max |int4
|
||||||
|
max |money
|
||||||
|
max |timespan
|
||||||
|
min |abstime
|
||||||
|
min |date
|
||||||
|
min |datetime
|
||||||
min |float4
|
min |float4
|
||||||
min |float8
|
min |float8
|
||||||
min |int2
|
min |int2
|
||||||
min |int4
|
min |int4
|
||||||
|
min |money
|
||||||
|
min |timespan
|
||||||
sum |float4
|
sum |float4
|
||||||
sum |float8
|
sum |float8
|
||||||
sum |int2
|
sum |int2
|
||||||
sum |int4
|
sum |int4
|
||||||
|
sum |money
|
||||||
|
|
||||||
\fBcount\fR is also available.
|
\fBcount\fR is also available, where
|
||||||
|
.BR count(*)
|
||||||
|
returns a count of all rows while
|
||||||
|
.BR count(column_name)
|
||||||
|
returns a count of all non-null fields in the specified column.
|
||||||
|
|
||||||
.fi
|
.fi
|
||||||
.in
|
.in
|
||||||
@ -991,10 +1068,10 @@ For examples on specifying literals of built-in types, see
|
|||||||
.PP
|
.PP
|
||||||
Although most of the input and output functions correponding to the
|
Although most of the input and output functions correponding to the
|
||||||
base types (e.g., integers and floating point numbers) do some
|
base types (e.g., integers and floating point numbers) do some
|
||||||
error-checking, none of them are particularly rigorous about it. More
|
error-checking, some are not particularly rigorous about it. More
|
||||||
importantly, almost none of the operators and functions (e.g.,
|
importantly, few of the operators and functions (e.g.,
|
||||||
addition and multiplication) perform any error-checking at all.
|
addition and multiplication) perform any error-checking at all.
|
||||||
Consequently, many of the numeric operations will (for example)
|
Consequently, many of the numeric operators can (for example)
|
||||||
silently underflow or overflow.
|
silently underflow or overflow.
|
||||||
.PP
|
.PP
|
||||||
Some of the input and output functions are not invertible. That is,
|
Some of the input and output functions are not invertible. That is,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user