Commit Graph

148 Commits

Author SHA1 Message Date
Peter Eisentraut 5e5c5cd31a Merge documentation into one book. (Build with "make html".) Replace
vague cross-references with real links.
2003-03-25 16:15:44 +00:00
Peter Eisentraut d258ba01ec Another big editing pass for consistent content and presentation. 2003-03-24 14:32:51 +00:00
Bruce Momjian e02f818311 Add hostmask() function:
+       <entry><function>hostmask</function>(<type>inet</type>)</entry>
+       <entry><type>inet</type></entry>
+       <entry>construct hostmask for network</entry>
+       <entry><literal>hostmask('192.168.23.20/30')</literal></entry>
+       <entry><literal>0.0.0.3</literal></entry>

Greg Wickham
2003-03-21 21:54:29 +00:00
Bruce Momjian 3be6367b9f This patch creates a function named pg_get_triggerdef that takes the oid of
a trigger as its parameter.  It is basically copied from the pg_dump
code.

Christopher Kings-Lynne
2003-03-20 18:58:02 +00:00
Bruce Momjian a18331004a Add start time to pg_stat_activity
Neil Conway
2003-03-20 03:34:57 +00:00
Peter Eisentraut 706a32cdf6 Big editing for consistent content and presentation. 2003-03-13 01:30:29 +00:00
Tom Lane d28cd2273b Improve description of geometric operators. 2003-03-03 03:31:23 +00:00
Bruce Momjian aca86479fd This patch adds a note to the documentation describing why the
performance of min() and max() is slow when applied to the entire table,
and suggesting the simple workaround most experienced Pg users
eventually learn about (SELECT xyz ... ORDER BY xyz LIMIT 1).

Neil Conway
2003-02-19 03:12:22 +00:00
Tom Lane 51972a9d5d COALESCE() and NULLIF() are now first-class expressions, not macros
that turn into CASE expressions.  They evaluate their arguments at most
once.  Patch by Kris Jurka, review and (very light) editorializing by me.
2003-02-16 02:30:39 +00:00
Bruce Momjian 6cb1f4fe44 The "random" regression test uses a function called oidrand(), which
takes two parameters, an OID x and an integer y, and returns "true" with
probability 1/y (the OID argument is ignored). This can be useful -- for
example, it can be used to select a random sampling of the rows in a
table (which is what the "random" regression test uses it for).

This patch removes that function, because it was old and messy. The old
function had the following problems:

- it was undocumented

- it was poorly named

- it was designed to workaround an optimizer bug that no longer exists
(the OID argument is to ensure that the optimizer won't optimize away
calls to the function; AFAIK marking the function as 'volatile' suffices
nowadays)

- it used a different random-number generation technique than the other
PSRNG-related functions in the backend do (it called random() like they
do, but it had its own logic for setting a set and deciding when to
reseed the RNG).

Ok, this patch removes oidrand(), oidsrand(), and userfntest(), and
improves the SGML docs a little bit (un-commenting the setseed()
documentation).

Neil Conway
2003-02-13 05:24:04 +00:00
Tom Lane 77ede8900d Create a GUC variable REGEX_FLAVOR to control the type of regular
expression accepted by the regex operators, per discussion yesterday.

Along the way, reduce deadlock_timeout from PGC_POSTMASTER to PGC_SIGHUP
category.  It is probably best to insist that all backends share the same
setting, but that doesn't mean it has to be frozen at startup.
2003-02-06 20:25:33 +00:00
Tom Lane 7bcc6d98fb Replace regular expression package with Henry Spencer's latest version
(extracted from Tcl 8.4.1 release, as Henry still hasn't got round to
making it a separate library).  This solves a performance problem for
multibyte, as well as upgrading our regexp support to match recent Tcl
and nearly match recent Perl.
2003-02-05 17:41:33 +00:00
Peter Eisentraut ef7422510e Grant options, and cascading revoke. Grant options are allowed only for
users right now, not groups.  Extension of has_foo_privileges functions to
query the grant options.  Extension of aclitem type to store grantor.
2003-01-23 23:39:07 +00:00
Tom Lane 742403bdad Update 'Mathematical Functions' table to reflect 7.3 addition of float8
forms of ceil(), floor(), sign().  Back-patch this and other recent
doc fixes in this file to the 7.3 branch.
2003-01-23 01:22:59 +00:00
Bruce Momjian e87e82d2b7 Attached are two small patches to expose md5 as a user function -- including
documentation and regression test mods. It seemed small and unobtrusive enough
to not require a specific proposal on the hackers list -- but if not, let me
know and I'll make a pitch. Otherwise, if there are no objections please apply.

Joe Conway
2002-12-06 05:20:28 +00:00
Bruce Momjian 23e88e25d6 Document get/set bit/byte functions. 2002-12-05 04:38:30 +00:00
Bruce Momjian a2b4a7071d This minor patch corrects an error in the function docs: it's
"version()", not "version".

Neil Conway
2002-11-23 04:04:43 +00:00
Tom Lane 75394d3f5b Fix breakage in new-in-7.3 timetz_zone() function: was giving random
results due to doing arithmetic on uninitialized values.  Add some
documentation about the AT TIME ZONE construct.  Update some other
date/time documentation that seemed out of date for 7.3.
2002-11-21 23:31:20 +00:00
Peter Eisentraut 1b342df00a Merge documentation updates from 7.3 branch. 2002-11-11 20:14:04 +00:00
Tom Lane 3a0fde3b51 Make link to schema inspection functions more clear. 2002-10-24 21:10:58 +00:00
Bruce Momjian fb5e61fd2d Fix markup error. 2002-10-05 23:43:42 +00:00
Bruce Momjian 0c88e38eda Add more documentation about CURRENT_TIMESTAMP.
Also, code < and > as &lt;/&gt; for cleaner SGML.
2002-10-05 19:03:16 +00:00
Peter Eisentraut 8c3ab663ab Tweak conversion names to follow the established naming scheme, and
document that scheme.
2002-09-24 20:14:59 +00:00
Tom Lane 9946b83ded Bring SIMILAR TO and SUBSTRING into some semblance of conformance with
the SQL99 standard.  (I'm not sure that the character-class features are
quite right, but that can be fixed later.)  Document SQL99 and POSIX
regexps as being different features; provide variants of SUBSTRING for
each.
2002-09-22 17:27:25 +00:00
Peter Eisentraut bc49968764 Add more appropriate markup. 2002-09-21 18:32:54 +00:00
Bruce Momjian 708a000efe Mention that pg_get_viewdef(name) is deprecated.
Rod Taylor
2002-09-20 03:44:06 +00:00
Bruce Momjian 81186865fe Joe Conway wrote:
> Hannu Krosing wrote:
 >
 >> It seems that my last mail on this did not get through to the list
 >> ;(
 >>
 >> Please consider renaming the new builtin function
 >> split(text,text,int)
 >>
 >> to something else, perhaps
 >>
 >> split_part(text,text,int)
 >>
 >> (like date_part)
 >>
 >> The reason for this request is that 3 most popular scripting
 >> languages (perl, python, php) all have also a function with similar
 >> signature, but returning an array instead of single element and the
 >> (optional) third argument is limit (maximum number of splits to
 >> perform)
 >>
 >> I think that it would be good to have similar function in (some
 >> future release of) postgres, but if we now let in a function with
 >> same name and arguments but returning a single string instead an
 >> array of them, then we will need to invent a new and not so easy to
 >> recognise name for the "real" split function.
 >>
 >
 > This is a good point, and I'm not opposed to changing the name, but
 > it is too bad your original email didn't get through before beta1 was
 >  rolled. The change would now require an initdb, which I know we were
 >  trying to avoid once beta started (although we could change it
 > without *requiring* an initdb I suppose).
 >
 > I guess if we do end up needing an initdb for other reasons, we
 > should make this change too. Any other opinions? Is split_part an
 > acceptable name?
 >
 > Also, if we add a todo to produce a "real" split function that
 > returns an array, similar to those languages, I'll take it for 7.4.

No one commented on the choice of name, so the attached patch changes
the name of split(text,text,int) to split_part(text,text,int) per
Hannu's recommendation above. This can be applied without an initdb if
current beta testers are advised to run:

   update pg_proc set proname = 'split_part' where proname = 'split';

in the case they want to use this function. Regression and doc fix is
also included in the patch.

Joe Conway
2002-09-12 00:21:25 +00:00
Bruce Momjian 6a5733a1ea Fix atan() description.
Bruno Wolff III
2002-09-11 02:56:46 +00:00
Bruce Momjian e82bcba5e0 Here's a doc patch for the new string functions recently committed --
replace, split, and to_hex. The patch also moves encode and decode into
alphabetical order (since everything else in the table was).

Joe Conway
2002-09-02 05:53:23 +00:00
Bruce Momjian 548d646e65 Add log_duration to GUC/postgresql.conf.
Rename debug_print_query to log_statement and rename show_query_stats to
show_statement_stats.
2002-09-01 23:26:06 +00:00
Tom Lane bf59ccc7d8 A few more fixes for the <replaceable>able> fiasco. 2002-08-29 05:17:55 +00:00
Bruce Momjian 090884bed3 Fix for documention:
>>" It's also possible to select no escape character by writing ESCAPE ''.
>>In this case there is no way to turn off the special meaning of
>>underscore and percent signs in the pattern."

Joe Conway
2002-08-22 04:56:44 +00:00
Bruce Momjian c76f5aa530 > > I had great difficulty in finding how to change the search path, so here
> > is a patch to add some cross-referencing.

Oliver Elphick
2002-08-22 04:52:17 +00:00
Bruce Momjian 0f9f2feee4 Fix bad markup detected by Alvaro Herrera 2002-08-21 16:08:19 +00:00
Bruce Momjian cbe19208ee Fix markup, Alvaro Herrera. 2002-08-21 05:25:49 +00:00
Bruce Momjian de9801fc62 Add current_database().
> Quick system function to pull out the current database.
>
> I've used this a number of times to allow stored procedures to find out
> where they are.  Especially useful for those that do logging or hit a
> remote server.
>
> It's called current_database() to match with current_user().

It's also a necessity for an informational schema.  The catalog
(database) name is required in a number of places.

Rod Taylor
2002-08-20 04:46:00 +00:00
Tom Lane a208ea72bc Modify pg_dump to dump foreign-key constraints as constraints, not as
sets of triggers.  Also modify psql \d command to show foreign key
constraints as such and hide the triggers.  pg_get_constraintdef()
function added to backend to support these.  From Rod Taylor, code
review and some editorialization by Tom Lane.
2002-08-16 23:01:21 +00:00
Tatsuo Ishii 969e0246ed Add Cyrillic and other encodings for encoding conversion.
Patches submitted by Kaori Inaba (i-kaori@sra.co.jp).
2002-08-14 02:45:10 +00:00
Tom Lane 4ab8e69094 has_table_privilege spawns scions has_database_privilege, has_function_privilege,
has_language_privilege, has_schema_privilege to let SQL queries test
all the new privilege types in 7.3.  Also, add functions pg_table_is_visible,
pg_type_is_visible, pg_function_is_visible, pg_operator_is_visible,
pg_opclass_is_visible to test whether objects contained in schemas are
visible in the current search path.  Do some minor cleanup to centralize
accesses to pg_database, as well.
2002-08-09 16:45:16 +00:00
Tom Lane d176fad580 Some improvements in geometric-operators documentation. 2002-08-08 14:29:07 +00:00
Tatsuo Ishii 6206a880cf Add SQL99 CONVERT() function. 2002-08-06 05:40:47 +00:00
Bruce Momjian d7859a9570 Rename backend_pid to pg_backend_pid, move docs to monitoring section. 2002-08-04 19:51:30 +00:00
Bruce Momjian 7ef5634701 Here is a doc patch for the SHOW X changes and new config-settings
functions. If there are no objections, please apply.

Joe Conway
2002-08-04 03:53:11 +00:00
Bruce Momjian 52457ca6af Move backend_pid to functions/misc. 2002-07-31 02:27:29 +00:00
Tom Lane e11f167718 Document quote_ident and quote_literal in the main list of string functions,
as suggested by Josh Berkus.
2002-06-24 22:17:01 +00:00
Bruce Momjian eb1ad5b4b5 Patch for current_schemas to optionally include implicit ...
Second cut attached. This one just adds a boolean option to the existing
function to indicate that implicit schemas are to be included (or not).
I remembered the docs as well this time :-)

Dave Page
2002-06-15 20:03:51 +00:00
Thomas G. Lockhart 133df7ce70 Add LOCALTIME and LOCALTIMESTAMP functions per SQL99 standard.
Remove ODBC-compatible empty parentheses from calls to SQL99 functions
 for which these parentheses do not match the standard.
Update the ODBC driver to ensure compatibility with the ODBC standard
 for these functions (e.g. CURRENT_TIMESTAMP, CURRENT_USER, etc).
Include a new appendix in the User's Guide which lists the labeled features
 for SQL99 (the labeled features replaced the "basic", "intermediate",
 and "advanced" categories from SQL92). features.sgml does not yet split
 this list into "supported" and "unsupported" lists.
2002-06-15 03:00:09 +00:00
Thomas G. Lockhart 062d8b9ebd Fix markup typo. 2002-06-11 16:00:17 +00:00
Thomas G. Lockhart 090dd22de6 Implement SQL99 OVERLAY(). Allows substitution of a substring in a string.
Implement SQL99 SIMILAR TO as a synonym for our existing operator "~".
Implement SQL99 regular expression SUBSTRING(string FROM pat FOR escape).
 Extend the definition to make the FOR clause optional.
 Define textregexsubstr() to actually implement this feature.
Update the regression test to include these new string features.
 All tests pass.
Rename the regular expression support routines from "pg95_xxx" to "pg_xxx".
Define CREATE CHARACTER SET in the parser per SQL99. No implementation yet.
2002-06-11 15:32:33 +00:00
Bruce Momjian 85af3be5e2 Remove mention of timestamp() in SGML docs; doesn't exist anymore. 2002-06-02 21:56:09 +00:00