Commit Graph

210 Commits

Author SHA1 Message Date
Tom Lane b5b9e33564 Add documentation for pg_cancel_backend and pg_terminate_backend.
Magnus Hagander
2004-06-24 19:57:14 +00:00
Tom Lane d70a42e642 Represent type-specific length coercion functions as pg_cast entries,
eliminating the former hard-wired convention about their names.  Allow
pg_cast entries to represent both type coercion and length coercion in
a single step --- this is represented by a function that takes an
extra typmod argument, just like a length coercion function.  This
nicely merges the type and length coercion mechanisms into something
at least a little cleaner than we had before.  Make use of the single-
coercion-step behavior to fix integer-to-bit coercion so that coercing
to bit(n) yields the rightmost n bits of the integer instead of the
leftmost n bits.  This should fix recurrent complaints about the odd
behavior of this coercion.  Clean up the documentation of the bit string
functions, and try to put it where people might actually find it.
Also, get rid of the unreliable heuristics in ruleutils.c about whether
to display nested coercion steps; instead require parse_coerce.c to
label them properly in the first place.
2004-06-16 01:27:00 +00:00
Tom Lane 8e7349b738 Fix doc bug: to_timestamp() returns timestamptz, not plain timestamp. 2004-06-14 19:01:09 +00:00
Tom Lane ba0f9ff3ba Code review for recently-added network functions. Get it to work when
log_hostname is enabled, clean up documentation.
2004-06-13 19:56:52 +00:00
Bruce Momjian 70f5a87ecc Small patch that adds some documentation for the area() function.
Specifically, point out that intersecting points in a path will yield
(most likely), unexpected results.  Visually these are identical paths,
but mathematically they're not the same.  Ex:

  area |                                           plan
------
+-----------------------------------------------------------------------
-------------------
    -0 | ((0,0),(0,1),(2,1),(2,2),(1,2),(1,0),(0,0))
     2 | ((0,0),(0,1),(1,1),(1,2),(2,2),(2,1),(1,1),(1,0),(0,0))

The current algorithm for area(PATH) is very quick, but only handles
non-intersecting paths.  I'm going to work on two other functions for
the PATH data type that determines if a PATH is intersecting or not,
and a function that returns the area() for an intersecting PATH.  The
intersecting area() function will be considerably slower (I think it's
going to be O(n!) or worse instead of the current O(n), but that comes
with the territory).

Sean Chittenden
2004-06-02 21:34:49 +00:00
Bruce Momjian 97d625dd1c *) inet_(client|server)_(addr|port)() and necessary documentation for
the four functions.


> Also, please justify the temp-related changes.  I was not aware that we
> had any breakage there.

patch-tmp-schema.txt contains the following bits:

*) Changes pg_namespace_aclmask() so that the superuser is always able
to create objects in the temp namespace.
*) Changes pg_namespace_aclmask() so that if this is a temp namespace,
objects are only allowed to be created in the temp namespace if the
user has TEMP privs on the database.  This encompasses all object
creation, not just TEMP tables.
*) InitTempTableNamespace() checks to see if the current user, not the
session user, has access to create a temp namespace.

The first two changes are necessary to support the third change.  Now
it's possible to revoke all temp table privs from non-super users and
limiting all creation of temp tables/schemas via a function that's
executed with elevated privs (security definer).  Before this change,
it was not possible to have a setuid function to create a temp
table/schema if the session user had no TEMP privs.

patch-area-path.txt contains:

*) Can now determine the area of a closed path.


patch-dfmgr.txt contains:

*) Small tweak to add the library path that's being expanded.

I was using $lib/foo.so and couldn't easily figure out what the error
message, "invalid macro name in dynamic library path" meant without
looking through the source code.  With the path in there, at least I
know where to start looking in my config file.

Sean Chittenden
2004-05-26 18:35:51 +00:00
Bruce Momjian 8096fe45ce The added aggregates are:
(1) boolean-and and boolean-or aggregates named bool_and and bool_or.
    they (SHOULD;-) correspond to standard sql every and some/any aggregates.
    they do not have the right name as there is a problem with
    the standard and the parser for some/any. Tom also think that
    the standard name is misleading because NULL are ignored.
    Also add 'every' aggregate.

(2) bitwise integer aggregates named bit_and and bit_or for
    int2, int4, int8 and bit types. They are not standard, but I find
    them useful. I needed them once.


The patches adds:

- 2 new very short strict functions for boolean aggregates in
  src/backed/utils/adt/bool.c,
  src/include/utils/builtins.h and src/include/catalog/pg_proc.h

- the new aggregates declared in src/include/catalog/pg_proc.h and
  src/include/catalog/pg_aggregate.h

- some documentation and validation about these new aggregates.

Fabien COELHO
2004-05-26 15:26:28 +00:00
Bruce Momjian d5003e5221 Document &< and &> properly.
William White <bwhite@frognet.net>
2004-05-19 23:56:38 +00:00
Neil Conway 0079547bcb Implement the width_bucket() function, per SQL2003. This commit only adds
a variant of the function for the 'numeric' datatype; it would be possible
to add additional variants for other datatypes, but I haven't done so yet.

This commit includes regression tests and minimal documentation; if we
want developers to actually use this function in applications, we'll
probably need to document what it does more fully.
2004-05-14 21:42:30 +00:00
Tom Lane 2f63232d30 Promote row expressions to full-fledged citizens of the expression syntax,
rather than allowing them only in a few special cases as before.  In
particular you can now pass a ROW() construct to a function that accepts
a rowtype parameter.  Internal generation of RowExprs fixes a number of
corner cases that used to not work very well, such as referencing the
whole-row result of a JOIN or subquery.  This represents a further step in
the work I started a month or so back to make rowtype values into
first-class citizens.
2004-05-10 22:44:49 +00:00
Neil Conway 9a939886ac Fix typo. 2004-05-10 21:08:28 +00:00
Neil Conway 3b8151a5ee Fix a typo in the documentation. 2004-05-05 09:33:38 +00:00
Neil Conway fc7fd50182 Add ceiling() as an alias for ceil(), and power() as an alias for pow().
Regression tests and documentation have both been updated.

SQL2003 requires that both ceiling() and ceil() be present, so I have
documented both spellings. SQL2003 doesn't mention pow() as far as I
can see, so I decided to replace pow() with power() in the documentation:
there is little reason to encourage the continued usage of a function
that isn't compliant with the standard, given a standard-compliant
alternative.

RELEASE NOTES: should state that pow() is considered deprecated
(although I don't see the need to ever remove it.)
2004-04-23 20:32:20 +00:00
Bruce Momjian 1934055cbe Please find a small patch to fix the brain damage "century" and
"millennium" date part implementation in postgresql, both in the code
and the documentation, so that it conforms to the official definition.
If you do not agree with the official definition, please send your
complaint to "pope@vatican.org". I'm not responsible for them;-)

With the previous version, the centuries and millenniums had a wrong
number and started the wrong year. Moreover century number 0, which does
not exist in reality, lasted 200 years. Also, millennium number 0 lasted
2000 years.

If you want postgresql to have it's own definition of "century" and
"millennium" that does not conform to the one of the society, just give
them another name. I would suggest "pgCENTURY" and "pgMILLENNIUM";-)

IMO, if someone may use the options, it means that postgresql is used for
historical data, so it make sense to have an historical definition. Also,
I just want to divide the year by 100 or 1000, I can do that quite easily.

BACKWARD INCOMPATIBLE CHANGE

Fabien Coelho - coelho@cri.ensmp.fr
2004-04-10 18:02:59 +00:00
Bruce Momjian fd071bd478 Fix to_char for 1 BC. Previously it returned 1 AD.
Fix to_char(year) for BC dates.  Previously it returned one less than
the current year.

Add documentation mentioning that there is no 0 AD.
2004-03-30 15:53:18 +00:00
Tom Lane 6c7e6d2baa Add a usage example for has_function_privilege(). 2004-03-19 19:13:26 +00:00
Neil Conway ae22a6c185 Fix a typo. 2004-03-10 20:10:26 +00:00
Neil Conway 80ec228389 Refer to GUC variables using <xref> tags rather than <varname> tags,
where appropriate. Add "id" and "xreflabel" tags to the descriptions
of the GUC variables to facilitate this. Also make a few minor docs
cleanups.
2004-03-09 16:57:47 +00:00
Neil Conway ab8faed00d Editorialization of some text discussing 'IS NULL' vs. '= NULL'. 2004-03-07 01:01:44 +00:00
Bruce Momjian 1973971821 Per a brief conversation with Tom, I've created a patch for adding
support for 'week' within the date_trunc function.

Within the patch I added a couple of test cases and associated target
output, and changed the documentation to add 'week' appropriately.

Robert Creager
2004-03-05 02:41:14 +00:00
Dennis Bjorklund 0b1f7cccd7 The trim function doc did not say that the second argument could be
be omitted. This patch fixes that. It also fixes a bug where the
type text was not wrapped as <type>text</type>.
2004-03-04 20:09:29 +00:00
Neil Conway e3f27c1847 Fix a typo in a recent commit to func.sgml that apparently broke the doc
build for some versions of OpenJade (unfortunately, my local version of
OpenJade didn't report the error...) -- thanks to Andrew Dunstan for
the report.
2004-02-29 15:45:53 +00:00
Neil Conway f46a80c362 Fix a few omissions in the initcap() documentation & source code
comments, make some unrelated improvements to the functions
documentation, and perform some minor consistency cleanup
elsewhere. Original initcap() change from Dennis B., additional
changes by Neil C.
2004-02-27 03:59:23 +00:00
Neil Conway 45f5eba90b Document the family() function (added during the 7.4 dev cycle but not
documented), and fix a typo.
2004-02-22 04:14:06 +00:00
Joe Conway 687d7cf355 Documentation for generate_series() functions committed a few days ago. 2004-02-05 22:54:36 +00:00
Tom Lane debeb47c92 Be a little more consistent about which terms are uppercased in
index entries.
2003-12-26 21:30:48 +00:00
Bruce Momjian 1c757c49fa > > I have no idea if this in Oracle or not. But it's something I
> > needed, and other people in the past asked about it too.
>
> It is in Oracle, but you aren't exactly on the spot.  It should be
>
> IYYY - 4 digits  ('2003')
> IYY  - 3 digits  ('003')
> IY   - 2 digits  ('03')
> I    - 1 digit   ('3')

Here is an updated patch that does that.

Kurt Roeckx
2003-12-25 03:36:24 +00:00
Bruce Momjian e9aec81792 Please find enclosed a patch exemplifying typical use of the ARE
Class-Shorthand Escapes<C2><AE>.  I believe it will help intrepid regex
users. :)

David Fetter
2003-12-18 03:59:07 +00:00
Peter Eisentraut 4b1a35b3c2 Add example for converting epoch back to timestamp. 2003-12-16 15:27:58 +00:00
Neil Conway 7fb5a9992c This patch makes some SGML markup more consistent and makes a small
improvement to the SSL auth docs.
2003-12-13 23:59:07 +00:00
PostgreSQL Daemon 969685ad44 $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +00:00
Tom Lane c52204b224 Repair missed renamings of show_statement_stats and show_executor_stats. 2003-11-24 14:49:51 +00:00
Peter Eisentraut 1d27de4cf4 Random copy-editing. 2003-11-04 09:55:39 +00:00
Peter Eisentraut 8442a92e5a Spell checking, consistent terminology. 2003-11-01 01:56:29 +00:00
Tom Lane 6099bc03f3 Adjust documentation examples to match recent error message rewordings.
A couple other minor fixes.
2003-09-30 03:22:33 +00:00
Tom Lane f3ad615ce8 Fix a batch of speling misteaks identified by Peter's spell-checker tool. 2003-09-20 20:12:05 +00:00
Tom Lane f8c365c8db Marginal hacks to make tables format more nicely. 2003-09-13 00:19:43 +00:00
Tom Lane 6e59122490 Update obsolete examples of error messages; various other minor editing. 2003-09-12 22:17:24 +00:00
Bruce Momjian 188eda0df2 Consistenly lowercase GUC variable names, in docs and error messages. 2003-09-11 18:30:39 +00:00
Bruce Momjian ab19254618 Mention that pg_type_is_visible is used for domains as well.
Christopher Kings-Lynne
2003-09-11 17:26:20 +00:00
Tom Lane f176e37975 Document a bunch of formerly-undocumented date/time operators,
including the SQL-spec OVERLAPS construct.
2003-09-08 19:38:02 +00:00
Peter Eisentraut c326d8f4f2 Add/edit index entries. 2003-08-31 17:32:24 +00:00
Tom Lane 432fb5b886 Updates for array documentation, from Joe Conway. 2003-08-19 06:06:48 +00:00
Bruce Momjian a9f9a97906 I almost forgot mark in docs "to_char(interval)" as deprecated function.
This useless routine will removed in 7.5. It's already discussed (see
hackers list archive).

Karel Zak
2003-08-17 04:52:41 +00:00
Tom Lane 18c10877a9 Make various links point to specific places instead of entire parts
(doubtless these are hangovers from the old separate-books days).
2003-08-10 01:20:34 +00:00
Tom Lane 5bfb0540b0 Update docs for 7.4 array features and polymorphic functions.
This is Joe Conway's patch of 7-Aug plus further editorializing
of my own.
2003-08-09 22:50:22 +00:00
Peter Eisentraut 3766e99c41 Add a note that AND and OR are commutative. Apparently, they are not in
certain other products.
2003-08-04 14:00:14 +00:00
Tom Lane a063d4b3ec Very minor editing. 2003-07-31 22:17:11 +00:00
Tom Lane 52347b6637 Add pretty-printing variants of pg_get_viewdef and related functions.
Patch from Andreas Pflug.
2003-07-30 22:56:24 +00:00
Tom Lane 9c2a7c2269 Apply (a somewhat revised version of) Greg Mullane's patch to eliminate
heuristic determination of day vs month in date/time input.  Add the
ability to specify that input is interpreted as yy-mm-dd order (which
formerly worked, but only for yy greater than 31).  DateStyle's input
component now has the preferred spellings DMY, MDY, or YMD; the older
keywords European and US are now aliases for the first two of these.
Per recent discussions on pgsql-general.
2003-07-29 00:03:19 +00:00