From 0ecdb5ca5d6b56eae872778ed0494a25c6b58028 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Wed, 16 Nov 2005 03:56:08 +0000 Subject: [PATCH] Properly document return value of strpos(). --- doc/src/sgml/func.sgml | 61 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 4 deletions(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 5773ee7f15..9f27778b66 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -32,7 +32,9 @@ PostgreSQL documentation SQL standard. Some of the extended functionality is present in other SQL database management systems, and in many cases this functionality is compatible and - consistent between the various implementations. + consistent between the various implementations. This chapter is also + not exhaustive; additional functions appear in relevant sections of + the manual. @@ -1315,7 +1317,7 @@ PostgreSQL documentation strpos(string, substring) - text + int Location of specified substring (same as position(substring in @@ -4458,6 +4460,17 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})'); + + + In conversions from string to timestamp or + date, the CC field is ignored if there + is a YYY, YYYY or + Y,YYY field. If CC is used with + YY or Y then the year is computed + as (CC-1)*100+YY. + + + Millisecond (MS) and microsecond (US) @@ -5449,6 +5462,12 @@ SELECT EXTRACT(SECOND FROM TIME '17:12:28.5'); week starts on Monday.) In other words, the first Thursday of a year is in week 1 of that year. (for timestamp values only) + + Because of this, it is possible for early January dates to be part of the + 52nd or 53rd week of the previous year. For example, 2005-01-01 + is part of the 53rd week of year 2004, and 2006-01-01 is part of + the 52nd week of year 2005. + SELECT EXTRACT(WEEK FROM TIMESTAMP '2001-02-16 20:38:40'); @@ -5890,7 +5909,7 @@ SELECT TIMESTAMP 'now'; >^ Is above? - circle '((0,5),1)' >^ circle '((0,0),1)' + circle '((0,5),1)' >^ circle '((0,0),1)' ?# @@ -6096,7 +6115,7 @@ SELECT TIMESTAMP 'now'; circle(point, double precision) circle - point and radius to circle + center and radius to circle circle(point '(0,0)', 2.0) @@ -6117,12 +6136,31 @@ SELECT TIMESTAMP 'now'; polygon to path path(polygon '((0,0),(1,1),(2,0))') + + point(double + precision, double precision) + point + construct point + point(23.4, -44.5) + + + point(box) + point + center of box + point(box '((-1,0),(1,0))') + point(circle) point center of circle point(circle '((0,0),2.0)') + + point(lseg) + point + center of lseg + point(lseg '((-1,0),(1,0))') + point(lseg, lseg) point @@ -8486,6 +8524,10 @@ SELECT pg_type_is_visible('myschema.widget'::regtype); this way — if the name can be recognized at all, it must be visible. + + format_type + + pg_get_viewdef @@ -8535,6 +8577,11 @@ SELECT pg_type_is_visible('myschema.widget'::regtype); + + format_type(type_oid, typemod) + text + get SQL name of a data type + pg_get_viewdef(view_name) text @@ -8624,6 +8671,12 @@ SELECT pg_type_is_visible('myschema.widget'::regtype); + + format_type returns the SQL name of a data type that + is identified by its type OID and possibly a type modifier. Pass NULL + for the type modifier if no specific modifier is known. + + pg_get_viewdef, pg_get_ruledef, -- 2.39.5