Commit 39f69bc3 authored by Thomas G. Lockhart's avatar Thomas G. Lockhart

Start updating for the v7.0 release.

Use "generic functions" for math and other routines.
Use SQL92 "type 'literal'" syntax rather than Postgres "'literal'::type".
parent 2dabd2cd
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<para> <para>
<productname>PostgreSQL</productname> is available without cost. This manual <productname>PostgreSQL</productname> is available without cost. This manual
describes version 6.5 of <productname>PostgreSQL</productname>. describes version 7.0 of <productname>PostgreSQL</productname>.
</para> </para>
<para> <para>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode:sgml
sgml-omittag:nil sgml-omittag:nil
sgml-shorttag:t sgml-shorttag:t
sgml-minimize-attributes:nil sgml-minimize-attributes:nil
...@@ -31,7 +31,7 @@ sgml-indent-data:t ...@@ -31,7 +31,7 @@ sgml-indent-data:t
sgml-parent-document:nil sgml-parent-document:nil
sgml-default-dtd-file:"./reference.ced" sgml-default-dtd-file:"./reference.ced"
sgml-exposed-tags:nil sgml-exposed-tags:nil
sgml-local-catalogs:"/usr/lib/sgml/catalog" sgml-local-catalogs:("/usr/lib/sgml/catalog")
sgml-local-ecat-files:nil sgml-local-ecat-files:nil
End: End:
--> -->
...@@ -38,26 +38,26 @@ ...@@ -38,26 +38,26 @@
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry> COALESCE(<replaceable class="parameter">list</replaceable>) </entry> <entry>COALESCE(<replaceable class="parameter">list</replaceable>)</entry>
<entry> non-NULL </entry> <entry>non-NULL</entry>
<entry> return first non-NULL value in list </entry> <entry>return first non-NULL value in list</entry>
<entry> COALESCE(rle, c2 + 5, 0) </entry> <entry>COALESCE(rle, c2 + 5, 0)</entry>
</row> </row>
<row> <row>
<entry> NULLIF(<replaceable class="parameter">input</replaceable>,<replaceable class="parameter">value</replaceable>) </entry> <entry>NULLIF(<replaceable class="parameter">input</replaceable>,<replaceable class="parameter">value</replaceable>)</entry>
<entry> <replaceable class="parameter">input</replaceable> or NULL </entry> <entry><replaceable class="parameter">input</replaceable> or NULL</entry>
<entry> return NULL if <entry>return NULL if
<replaceable class="parameter">input</replaceable> = <replaceable class="parameter">input</replaceable> =
<replaceable class="parameter">value</replaceable>, <replaceable class="parameter">value</replaceable>,
else <replaceable class="parameter">input</replaceable> else <replaceable class="parameter">input</replaceable>
</entry> </entry>
<entry> NULLIF(c1, 'N/A') </entry> <entry>NULLIF(c1, 'N/A')</entry>
</row> </row>
<row> <row>
<entry> CASE WHEN <replaceable class="parameter">expr</replaceable> THEN <replaceable class="parameter">expr</replaceable> [...] ELSE <replaceable class="parameter">expr</replaceable> END </entry> <entry>CASE WHEN <replaceable class="parameter">expr</replaceable> THEN <replaceable class="parameter">expr</replaceable> [...] ELSE <replaceable class="parameter">expr</replaceable> END</entry>
<entry> <replaceable class="parameter">expr</replaceable> </entry> <entry><replaceable class="parameter">expr</replaceable></entry>
<entry> return expression for first true WHEN clause </entry> <entry>return expression for first true WHEN clause</entry>
<entry> CASE WHEN c1 = 1 THEN 'match' ELSE 'no match' END </entry> <entry>CASE WHEN c1 = 1 THEN 'match' ELSE 'no match' END</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
...@@ -82,70 +82,70 @@ ...@@ -82,70 +82,70 @@
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry> abs(float8) </entry> <entry>abs(float8)</entry>
<entry> float8 </entry> <entry>float8</entry>
<entry> absolute value </entry> <entry>absolute value</entry>
<entry> abs(-17.4) </entry> <entry>abs(-17.4)</entry>
</row> </row>
<row> <row>
<entry> sqrt(float8) </entry> <entry>sqrt(float8)</entry>
<entry> float8 </entry> <entry>float8</entry>
<entry> square root </entry> <entry>square root</entry>
<entry> sqrt(2.0) </entry> <entry>sqrt(2.0)</entry>
</row> </row>
<row> <row>
<entry> exp(float8) </entry> <entry>exp(float8)</entry>
<entry> float8 </entry> <entry>float8</entry>
<entry> raise e to the specified exponent </entry> <entry>raise e to the specified exponent</entry>
<entry> exp(2.0) </entry> <entry>exp(2.0)</entry>
</row> </row>
<row> <row>
<entry> ln(float8) </entry> <entry>ln(float8)</entry>
<entry> float8 </entry> <entry>float8</entry>
<entry> natural logarithm </entry> <entry>natural logarithm</entry>
<entry> ln(2.0) </entry> <entry>ln(2.0)</entry>
</row> </row>
<row> <row>
<entry> log(float8) </entry> <entry>log(float8)</entry>
<entry> float8 </entry> <entry>float8</entry>
<entry> base 10 logarithm </entry> <entry>base 10 logarithm</entry>
<entry> log(2.0) </entry> <entry>log(2.0)</entry>
</row> </row>
<row> <row>
<entry> pow(float8,float8) </entry> <entry>pow(float8,float8)</entry>
<entry> float8 </entry> <entry>float8</entry>
<entry> raise a number to the specified exponent </entry> <entry>raise a number to the specified exponent</entry>
<entry> pow(2.0, 16.0) </entry> <entry>pow(2.0, 16.0)</entry>
</row> </row>
<row> <row>
<entry> round(float8) </entry> <entry>round(float8)</entry>
<entry> float8 </entry> <entry>float8</entry>
<entry> round to nearest integer </entry> <entry>round to nearest integer</entry>
<entry> round(42.4) </entry> <entry>round(42.4)</entry>
</row> </row>
<row> <row>
<entry> trunc(float8) </entry> <entry>trunc(float8)</entry>
<entry> float8 </entry> <entry>float8</entry>
<entry> truncate (towards zero) </entry> <entry>truncate (towards zero)</entry>
<entry> trunc(42.4) </entry> <entry>trunc(42.4)</entry>
</row> </row>
<row> <row>
<entry> float(int) </entry> <entry>float(int)</entry>
<entry> float8 </entry> <entry>float8</entry>
<entry> convert integer to floating point </entry> <entry>convert integer to floating point</entry>
<entry> float(2) </entry> <entry>float(2)</entry>
</row> </row>
<row> <row>
<entry> float4(int) </entry> <entry>float4(int)</entry>
<entry> float4 </entry> <entry>float4</entry>
<entry> convert integer to floating point </entry> <entry>convert integer to floating point</entry>
<entry> float4(2) </entry> <entry>float4(2)</entry>
</row> </row>
<row> <row>
<entry> integer(float) </entry> <entry>integer(float)</entry>
<entry> int </entry> <entry>int</entry>
<entry> convert floating point to integer </entry> <entry>convert floating point to integer</entry>
<entry> integer(2.0) </entry> <entry>integer(2.0)</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
...@@ -153,8 +153,8 @@ ...@@ -153,8 +153,8 @@
</para> </para>
<para> <para>
Most of the functions listed for FLOAT8 are also available for Most of the functions listed for FLOAT8 are also available for
type NUMERIC. type NUMERIC.
</para> </para>
</sect1> </sect1>
...@@ -182,52 +182,52 @@ ...@@ -182,52 +182,52 @@
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry> char_length(string) </entry> <entry>char_length(string)</entry>
<entry> int4 </entry> <entry>int4</entry>
<entry> length of string </entry> <entry>length of string</entry>
<entry> char_length('jose') </entry> <entry>char_length('jose')</entry>
</row> </row>
<row> <row>
<entry> character_length(string) </entry> <entry>character_length(string)</entry>
<entry> int4 </entry> <entry>int4</entry>
<entry> length of string </entry> <entry>length of string</entry>
<entry> char_length('jose') </entry> <entry>char_length('jose')</entry>
</row> </row>
<row> <row>
<entry> lower(string) </entry> <entry>lower(string)</entry>
<entry> string </entry> <entry>string</entry>
<entry> convert string to lower case </entry> <entry>convert string to lower case</entry>
<entry> lower('TOM') </entry> <entry>lower('TOM')</entry>
</row> </row>
<row> <row>
<entry> octet_length(string) </entry> <entry>octet_length(string)</entry>
<entry> int4 </entry> <entry>int4</entry>
<entry> storage length of string </entry> <entry>storage length of string</entry>
<entry> octet_length('jose') </entry> <entry>octet_length('jose')</entry>
</row> </row>
<row> <row>
<entry> position(string in string) </entry> <entry>position(string in string)</entry>
<entry> int4 </entry> <entry>int4</entry>
<entry> location of specified substring </entry> <entry>location of specified substring</entry>
<entry> position('o' in 'Tom') </entry> <entry>position('o' in 'Tom')</entry>
</row> </row>
<row> <row>
<entry> substring(string [from int] [for int]) </entry> <entry>substring(string [from int] [for int])</entry>
<entry> string </entry> <entry>string</entry>
<entry> extract specified substring </entry> <entry>extract specified substring</entry>
<entry> substring('Tom' from 2 for 2) </entry> <entry>substring('Tom' from 2 for 2)</entry>
</row> </row>
<row> <row>
<entry> trim([leading|trailing|both] [string] from string) </entry> <entry>trim([leading|trailing|both] [string] from string)</entry>
<entry> string </entry> <entry>string</entry>
<entry> trim characters from string </entry> <entry>trim characters from string</entry>
<entry> trim(both 'x' from 'xTomx') </entry> <entry>trim(both 'x' from 'xTomx')</entry>
</row> </row>
<row> <row>
<entry> upper(text) </entry> <entry>upper(text)</entry>
<entry> text </entry> <entry>text</entry>
<entry> convert text to upper case </entry> <entry>convert text to upper case</entry>
<entry> upper('tom') </entry> <entry>upper('tom')</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
...@@ -253,88 +253,88 @@ ...@@ -253,88 +253,88 @@
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry> char(text) </entry> <entry>char(text)</entry>
<entry> char </entry> <entry>char</entry>
<entry> convert text to char type </entry> <entry>convert text to char type</entry>
<entry> char('text string') </entry> <entry>char('text string')</entry>
</row> </row>
<row> <row>
<entry> char(varchar) </entry> <entry>char(varchar)</entry>
<entry> char </entry> <entry>char</entry>
<entry> convert varchar to char type </entry> <entry>convert varchar to char type</entry>
<entry> char(varchar 'varchar string') </entry> <entry>char(varchar 'varchar string')</entry>
</row> </row>
<row> <row>
<entry> initcap(text) </entry> <entry>initcap(text)</entry>
<entry> text </entry> <entry>text</entry>
<entry> first letter of each word to upper case </entry> <entry>first letter of each word to upper case</entry>
<entry> initcap('thomas') </entry> <entry>initcap('thomas')</entry>
</row> </row>
<row> <row>
<entry> lpad(text,int,text) </entry> <entry>lpad(text,int,text)</entry>
<entry> text </entry> <entry>text</entry>
<entry> left pad string to specified length </entry> <entry>left pad string to specified length</entry>
<entry> lpad('hi',4,'??') </entry> <entry>lpad('hi',4,'??')</entry>
</row> </row>
<row> <row>
<entry> ltrim(text,text) </entry> <entry>ltrim(text,text)</entry>
<entry> text </entry> <entry>text</entry>
<entry> left trim characters from text </entry> <entry>left trim characters from text</entry>
<entry> ltrim('xxxxtrim','x') </entry> <entry>ltrim('xxxxtrim','x')</entry>
</row> </row>
<row> <row>
<entry> textpos(text,text) </entry> <entry>textpos(text,text)</entry>
<entry> text </entry> <entry>text</entry>
<entry> locate specified substring </entry> <entry>locate specified substring</entry>
<entry> position('high','ig') </entry> <entry>position('high','ig')</entry>
</row> </row>
<row> <row>
<entry> rpad(text,int,text) </entry> <entry>rpad(text,int,text)</entry>
<entry> text </entry> <entry>text</entry>
<entry> right pad string to specified length </entry> <entry>right pad string to specified length</entry>
<entry> rpad('hi',4,'x') </entry> <entry>rpad('hi',4,'x')</entry>
</row> </row>
<row> <row>
<entry> rtrim(text,text) </entry> <entry>rtrim(text,text)</entry>
<entry> text </entry> <entry>text</entry>
<entry> right trim characters from text </entry> <entry>right trim characters from text</entry>
<entry> rtrim('trimxxxx','x') </entry> <entry>rtrim('trimxxxx','x')</entry>
</row> </row>
<row> <row>
<entry> substr(text,int[,int]) </entry> <entry>substr(text,int[,int])</entry>
<entry> text </entry> <entry>text</entry>
<entry> extract specified substring </entry> <entry>extract specified substring</entry>
<entry> substr('hi there',3,5) </entry> <entry>substr('hi there',3,5)</entry>
</row> </row>
<row> <row>
<entry> text(char) </entry> <entry>text(char)</entry>
<entry> text </entry> <entry>text</entry>
<entry> convert char to text type </entry> <entry>convert char to text type</entry>
<entry> text('char string') </entry> <entry>text('char string')</entry>
</row> </row>
<row> <row>
<entry> text(varchar) </entry> <entry>text(varchar)</entry>
<entry> text </entry> <entry>text</entry>
<entry> convert varchar to text type </entry> <entry>convert varchar to text type</entry>
<entry> text(varchar 'varchar string') </entry> <entry>text(varchar 'varchar string')</entry>
</row> </row>
<row> <row>
<entry> translate(text,from,to) </entry> <entry>translate(text,from,to)</entry>
<entry> text </entry> <entry>text</entry>
<entry> convert character in string </entry> <entry>convert character in string</entry>
<entry> translate('12345', '1', 'a') </entry> <entry>translate('12345', '1', 'a')</entry>
</row> </row>
<row> <row>
<entry> varchar(char) </entry> <entry>varchar(char)</entry>
<entry> varchar </entry> <entry>varchar</entry>
<entry> convert char to varchar type </entry> <entry>convert char to varchar type</entry>
<entry> varchar('char string') </entry> <entry>varchar('char string')</entry>
</row> </row>
<row> <row>
<entry> varchar(text) </entry> <entry>varchar(text)</entry>
<entry> varchar </entry> <entry>varchar</entry>
<entry> convert text to varchar type </entry> <entry>convert text to varchar type</entry>
<entry> varchar('text string') </entry> <entry>varchar('text string')</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
...@@ -368,82 +368,88 @@ ...@@ -368,82 +368,88 @@
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry> abstime(datetime) </entry> <entry>abstime(timestamp)</entry>
<entry> abstime </entry> <entry>abstime</entry>
<entry> convert to abstime </entry> <entry>convert to abstime</entry>
<entry> abstime('now'::datetime) </entry> <entry>abstime(timestamp 'now')</entry>
</row> </row>
<row> <row>
<entry> age(datetime,datetime) </entry> <entry>age(timestamp)</entry>
<entry> timespan </entry> <entry>interval</entry>
<entry> preserve months and years </entry> <entry>preserve months and years</entry>
<entry> age('now','1957-06-13'::datetime) </entry> <entry>age(timestamp '1957-06-13')</entry>
</row> </row>
<row> <row>
<entry> datetime(abstime) </entry> <entry>age(timestamp,timestamp)</entry>
<entry> datetime </entry> <entry>interval</entry>
<entry> convert to datetime </entry> <entry>preserve months and years</entry>
<entry> datetime('now'::abstime) </entry> <entry>age('now', timestamp '1957-06-13')</entry>
</row> </row>
<row> <row>
<entry> datetime(date) </entry> <entry>timestamp(abstime)</entry>
<entry> datetime </entry> <entry>timestamp</entry>
<entry> convert to datetime </entry> <entry>convert to timestamp</entry>
<entry> datetime('today'::date) </entry> <entry>timestamp(abstime 'now')</entry>
</row> </row>
<row> <row>
<entry> datetime(date,time) </entry> <entry>timestamp(date)</entry>
<entry> datetime </entry> <entry>timestamp</entry>
<entry> convert to datetime </entry> <entry>convert to timestamp</entry>
<entry> datetime('1998-02-24'::datetime, '23:07'::time); </entry> <entry>timestamp(date 'today')</entry>
</row> </row>
<row>
<entry>timestamp(date,time)</entry>
<entry>timestamp</entry>
<entry>convert to timestamp</entry>
<entry>timestamp(timestamp '1998-02-24',time '23:07');</entry>
</row>
<row> <row>
<entry> date_part(text,datetime) </entry> <entry>date_part(text,timestamp)</entry>
<entry> float8 </entry> <entry>float8</entry>
<entry> portion of date </entry> <entry>portion of date</entry>
<entry> date_part('dow','now'::datetime) </entry> <entry>date_part('dow',timestamp 'now')</entry>
</row> </row>
<row> <row>
<entry> date_part(text,timespan) </entry> <entry>date_part(text,interval)</entry>
<entry> float8 </entry> <entry>float8</entry>
<entry> portion of time </entry> <entry>portion of time</entry>
<entry> date_part('hour','4 hrs 3 mins'::timespan) </entry> <entry>date_part('hour',interval '4 hrs 3 mins')</entry>
</row> </row>
<row> <row>
<entry> date_trunc(text,datetime) </entry> <entry>date_trunc(text,timestamp)</entry>
<entry> datetime </entry> <entry>timestamp</entry>
<entry> truncate date </entry> <entry>truncate date</entry>
<entry> date_trunc('month','now'::abstime) </entry> <entry>date_trunc('month',abstime 'now')</entry>
</row> </row>
<row> <row>
<entry> isfinite(abstime) </entry> <entry>isfinite(abstime)</entry>
<entry> bool </entry> <entry>bool</entry>
<entry> a finite time? </entry> <entry>a finite time?</entry>
<entry> isfinite('now'::abstime) </entry> <entry>isfinite(abstime 'now')</entry>
</row> </row>
<row> <row>
<entry> isfinite(datetime) </entry> <entry>isfinite(timestamp)</entry>
<entry> bool </entry> <entry>bool</entry>
<entry> a finite time? </entry> <entry>a finite time?</entry>
<entry> isfinite('now'::datetime) </entry> <entry>isfinite(timestamp 'now')</entry>
</row> </row>
<row> <row>
<entry> isfinite(timespan) </entry> <entry>isfinite(interval)</entry>
<entry> bool </entry> <entry>bool</entry>
<entry> a finite time? </entry> <entry>a finite time?</entry>
<entry> isfinite('4 hrs'::timespan) </entry> <entry>isfinite(interval '4 hrs')</entry>
</row> </row>
<row> <row>
<entry> reltime(timespan) </entry> <entry>reltime(interval)</entry>
<entry> reltime </entry> <entry>reltime</entry>
<entry> convert to reltime </entry> <entry>convert to reltime</entry>
<entry> reltime('4 hrs'::timespan) </entry> <entry>reltime(interval '4 hrs')</entry>
</row> </row>
<row> <row>
<entry> timespan(reltime) </entry> <entry>interval(reltime)</entry>
<entry> timespan </entry> <entry>interval</entry>
<entry> convert to timespan </entry> <entry>convert to interval</entry>
<entry> timespan('4 hours'::reltime) </entry> <entry>interval(reltime '4 hours')</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
...@@ -459,15 +465,15 @@ ...@@ -459,15 +465,15 @@
`decade', `century', `millenium', `millisecond', and `microsecond'. `decade', `century', `millenium', `millisecond', and `microsecond'.
<function>date_part</function> allows `dow' <function>date_part</function> allows `dow'
to return day of week and `epoch' to return seconds since 1970 to return day of week and `epoch' to return seconds since 1970
(for <type>datetime</type>) (for <type>timestamp</type>)
or 'epoch' to return total elapsed seconds (for <type>timespan</type>). or 'epoch' to return total elapsed seconds (for <type>interval</type>).
</para> </para>
</sect1> </sect1>
<sect1> <sect1>
<title id="formatting-funcs"> Formatting Functions </title> <title id="formatting-funcs">Formatting Functions</title>
<note> <note>
<title>Author</title> <title>Author</title>
...@@ -477,11 +483,18 @@ ...@@ -477,11 +483,18 @@
on 2000-01-24. on 2000-01-24.
</para> </para>
</note> </note>
<para> <para>
Formatting functions provide a powerful set of tools for converting The <productname>Postgres</productname>
formatting functions provide a powerful set of tools for converting
various datetypes (date/time, int, float, numeric) to formatted strings various datetypes (date/time, int, float, numeric) to formatted strings
and reverse convert from formatted strings to original datetypes. and for converting from formatted strings to specific datetypes.
<note>
<para>
The second argument for all formatting functions is a template to
be used for the conversion.
</para>
</note>
</para> </para>
<para> <para>
...@@ -498,206 +511,190 @@ ...@@ -498,206 +511,190 @@
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry> to_char(datetime, text) </entry> <entry>to_char(timestamp, text)</entry>
<entry> text </entry> <entry>text</entry>
<entry> convert datetime to string </entry> <entry>convert timestamp to string</entry>
<entry> to_char('now'::datetime, 'HH12:MI:SS') </entry> <entry>to_char(timestamp 'now','HH12:MI:SS')</entry>
</row> </row>
<row> <row>
<entry> to_char(timestamp, text) </entry> <entry>to_char(int, text)</entry>
<entry> text </entry> <entry>text</entry>
<entry> convert timestamp to string </entry> <entry>convert int4/int8 to string</entry>
<entry> to_char( now(), 'HH12:MI:SS') </entry> <entry>to_char(125, '999')</entry>
</row> </row>
<row> <row>
<entry> to_char(int, text) </entry> <entry>to_char(float, text)</entry>
<entry> text </entry> <entry>text</entry>
<entry> convert int4/int8 to string </entry> <entry>convert float4/float8 to string</entry>
<entry> to_char(125, '999') </entry> <entry>to_char(125.8, '999D9')</entry>
</row> </row>
<row> <row>
<entry> to_char(float, text) </entry> <entry>to_char(numeric, text)</entry>
<entry> text </entry> <entry>text</entry>
<entry> convert float4/float8 to string </entry> <entry>convert numeric to string</entry>
<entry> to_char(125.8, '999D9') </entry> <entry>to_char(numeric '-125.8', '999D99S')</entry>
</row>
<row>
<entry> to_char(numeric, text) </entry>
<entry> text </entry>
<entry> convert numeric to string </entry>
<entry> to_char(-125.8, '999D99S') </entry>
</row>
<row>
<entry> to_datetime(text, text) </entry>
<entry> datetime </entry>
<entry> convert string to datetime </entry>
<entry> to_datetime('05 Dec 2000 13', 'DD Mon YYYY HH') </entry>
</row> </row>
<row> <row>
<entry> to_date(text, text) </entry> <entry>to_date(text, text)</entry>
<entry> date </entry> <entry>date</entry>
<entry> convert string to date </entry> <entry>convert string to date</entry>
<entry> to_date('05 Dec 2000', 'DD Mon YYYY') </entry> <entry>to_date('05 Dec 2000', 'DD Mon YYYY')</entry>
</row> </row>
<row> <row>
<entry> to_timestamp(text, text) </entry> <entry>to_timestamp(text, text)</entry>
<entry> date </entry> <entry>date</entry>
<entry> convert string to timestamp </entry> <entry>convert string to timestamp</entry>
<entry> to_timestamp('05 Dec 2000', 'DD Mon YYYY') </entry> <entry>to_timestamp('05 Dec 2000', 'DD Mon YYYY')</entry>
</row> </row>
<row> <row>
<entry> to_number(text, text) </entry> <entry>to_number(text, text)</entry>
<entry> numeric </entry> <entry>numeric</entry>
<entry> convert string to numeric </entry> <entry>convert string to numeric</entry>
<entry> to_number('12,454.8-', '99G999D9S') </entry> <entry>to_number('12,454.8-', '99G999D9S')</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
</table> </table>
</para> </para>
<para>
For all formatting functions is second argument format-picture.
</para>
<para> <para>
<table tocentry="1"> <table tocentry="1">
<title>Format-pictures for date/time to_char() version.</title> <title>Templates for date/time conversions</title>
<tgroup cols="2"> <tgroup cols="2">
<thead> <thead>
<row> <row>
<entry>Format-picture</entry> <entry>Template</entry>
<entry>Description</entry> <entry>Description</entry>
</row> </row>
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry> HH </entry> <entry>HH</entry>
<entry> hour of day (01-12) </entry> <entry>hour of day (01-12)</entry>
</row> </row>
<row> <row>
<entry> HH12 </entry> <entry>HH12</entry>
<entry> hour of day (01-12) </entry> <entry>hour of day (01-12)</entry>
</row> </row>
<row> <row>
<entry> MI </entry> <entry>MI</entry>
<entry> minute (00-59) </entry> <entry>minute (00-59)</entry>
</row> </row>
<row> <row>
<entry> SS </entry> <entry>SS</entry>
<entry> socond (00-59) </entry> <entry>second (00-59)</entry>
</row> </row>
<row> <row>
<entry> SSSS </entry> <entry>SSSS</entry>
<entry> seconds past midnight (0-86399) </entry> <entry>seconds past midnight (0-86399)</entry>
</row> </row>
<row> <row>
<entry> Y,YYY </entry> <entry>Y,YYY</entry>
<entry> year (4 and more digits) with comma </entry> <entry>year (4 and more digits) with comma</entry>
</row> </row>
<row> <row>
<entry> YYYY </entry> <entry>YYYY</entry>
<entry> year (4 and more digits) </entry> <entry>year (4 and more digits)</entry>
</row> </row>
<row> <row>
<entry> YYY </entry> <entry>YYY</entry>
<entry> last 3 digits of year </entry> <entry>last 3 digits of year</entry>
</row> </row>
<row> <row>
<entry> YY </entry> <entry>YY</entry>
<entry> last 2 digits of year </entry> <entry>last 2 digits of year</entry>
</row> </row>
<row> <row>
<entry> Y </entry> <entry>Y</entry>
<entry> last digit of year </entry> <entry>last digit of year</entry>
</row> </row>
<row> <row>
<entry> MONTH </entry> <entry>MONTH</entry>
<entry> full month name (9-letters) - all characters is upper </entry> <entry>full upper case month name (9 chars)</entry>
</row> </row>
<row> <row>
<entry> Month </entry> <entry>Month</entry>
<entry> full month name (9-letters) - first character is upper </entry> <entry>full mixed case month name (9 chars)</entry>
</row> </row>
<row> <row>
<entry> month </entry> <entry>month</entry>
<entry> full month name (9-letters) - all characters is lower </entry> <entry>full lower case month name (9 chars)</entry>
</row> </row>
<row> <row>
<entry> MON </entry> <entry>MON</entry>
<entry> abbreviated month name (3-letters) - all characters is upper </entry> <entry>upper case abbreviated month name (3 chars)</entry>
</row> </row>
<row> <row>
<entry> Mon </entry> <entry>Mon</entry>
<entry> abbreviated month name (3-letters) - first character is upper </entry> <entry>abbreviated mixed case month name (3 chars)</entry>
</row> </row>
<row> <row>
<entry> mon </entry> <entry>mon</entry>
<entry> abbreviated month name (3-letters) - all characters is lower </entry> <entry>abbreviated lower case month name (3 chars)</entry>
</row> </row>
<row> <row>
<entry> MM </entry> <entry>MM</entry>
<entry> month (01-12) </entry> <entry>month (01-12)</entry>
</row> </row>
<row> <row>
<entry> DAY </entry> <entry>DAY</entry>
<entry> full day name (9-letters) - all characters is upper </entry> <entry>full upper case day name (9 chars)</entry>
</row> </row>
<row> <row>
<entry> Day </entry> <entry>Day</entry>
<entry> full day name (9-letters) - first character is upper </entry> <entry>full mixed case day name (9 chars)</entry>
</row> </row>
<row> <row>
<entry> day </entry> <entry>day</entry>
<entry> full day name (9-letters) - all characters is lower </entry> <entry>full lower case day name (9 chars)</entry>
</row> </row>
<row> <row>
<entry> DY </entry> <entry>DY</entry>
<entry> abbreviated day name (3-letters) - all characters is upper </entry> <entry>abbreviated upper case day name (3 chars)</entry>
</row> </row>
<row> <row>
<entry> Dy </entry> <entry>Dy</entry>
<entry> abbreviated day name (3-letters) - first character is upper </entry> <entry>abbreviated mixed case day name (3 chars)</entry>
</row> </row>
<row> <row>
<entry> dy </entry> <entry>dy</entry>
<entry> abbreviated day name (3-letters) - all characters is upper </entry> <entry>abbreviated lower case day name (3 chars)</entry>
</row> </row>
<row> <row>
<entry> DDD </entry> <entry>DDD</entry>
<entry> day of year (001-366) </entry> <entry>day of year (001-366)</entry>
</row> </row>
<row> <row>
<entry> DD </entry> <entry>DD</entry>
<entry> day of month (01-31) </entry> <entry>day of month (01-31)</entry>
</row> </row>
<row> <row>
<entry> D </entry> <entry>D</entry>
<entry> day of week (1-7; SUN=1) </entry> <entry>day of week (1-7; SUN=1)</entry>
</row> </row>
<row> <row>
<entry> W </entry> <entry>W</entry>
<entry> week of month </entry> <entry>week of month</entry>
</row> </row>
<row> <row>
<entry> WW </entry> <entry>WW</entry>
<entry> week number of year </entry> <entry>week number of year</entry>
</row> </row>
<row> <row>
<entry> CC </entry> <entry>CC</entry>
<entry> century (2-digits) </entry> <entry>century (2 digits)</entry>
</row> </row>
<row> <row>
<entry> J </entry> <entry>J</entry>
<entry> julian day (days since January 1, 4712 BC) </entry> <entry>Julian Day (days since January 1, 4712 BC)</entry>
</row> </row>
<row> <row>
<entry> Q </entry> <entry>Q</entry>
<entry> quarter </entry> <entry>quarter</entry>
</row> </row>
<row> <row>
<entry> RM </entry> <entry>RM</entry>
<entry> month in roman numeral (I-XII; I=JAN) </entry> <entry>month in Roman Numerals (I-XII; I=JAN)</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
...@@ -705,13 +702,13 @@ ...@@ -705,13 +702,13 @@
</para> </para>
<para> <para>
All format-pictures allow use suffixes (postfix / prefix). The suffix is All templates allow the use of prefix and suffix modifiers. Modifiers are
always valid for a near format-picture. The 'FX' is global prefix only. always valid for use in templates. The prefix 'FX' is a global modifier only.
</para> </para>
<para> <para>
<table tocentry="1"> <table tocentry="1">
<title>Suffixes for format-pictures for date/time to_char() version.</title> <title>Suffixes for templates for date/time to_char()</title>
<tgroup cols="3"> <tgroup cols="3">
<thead> <thead>
<row> <row>
...@@ -722,31 +719,29 @@ ...@@ -722,31 +719,29 @@
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry> FM </entry> <entry>FM</entry>
<entry> fill mode - prefix </entry> <entry>fill mode prefix</entry>
<entry> FMMonth </entry> <entry>FMMonth</entry>
</row> </row>
<row> <row>
<entry> TH </entry> <entry>TH</entry>
<entry> upper ordinal number - postfix </entry> <entry>upper ordinal number suffix</entry>
<entry> DDTH </entry> <entry>DDTH</entry>
</row> </row>
<row> <row>
<entry> th </entry> <entry>th</entry>
<entry> lower ordinal number - postfix </entry> <entry>lower ordinal number suffix</entry>
<entry> DDTH </entry> <entry>DDTH</entry>
</row> </row>
<row> <row>
<entry> FX </entry> <entry>FX</entry>
<entry> FX - (Fixed format) global format-picture switch. <entry>FiXed format global option (see below)</entry>
The TO_DATETIME / TO_DATE skip blank space if this option is <entry>FX Month DD Day</entry>
not use. Must by used as first item in formt-picture. </entry>
<entry> FX Month DD Day </entry>
</row> </row>
<row> <row>
<entry> SP </entry> <entry>SP</entry>
<entry> spell mode (not implement now)</entry> <entry>spell mode (not yet implemented)</entry>
<entry> DDSP </entry> <entry>DDSP</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
...@@ -754,94 +749,116 @@ ...@@ -754,94 +749,116 @@
</para> </para>
<para> <para>
'\' - must be use as double \\, example '\\HH\\MI\\SS' Usage notes:
</para>
<para> <itemizedlist>
'"' - string between a quotation marks is skipen and not is parsed. <listitem>
If you want write '"' to output you must use \\", example '\\"YYYY Month\\"'. <para>
</para> <function>to_timestamp</function> and <function>to_date</function>
<para> skip blank space if the <literal>FX</literal> option is
text - the PostgreSQL's to_char() support text without '"', but string not use. <literal>FX</literal> Must be specified as the first item
between a quotation marks is fastly and you have guarantee, that a text in the template.
not will interpreted as a keyword (format-picture), exapmle '"Hello Year: "YYYY'. </para>
</listitem>
<listitem>
<para>
'\' - must be use as double \\, example '\\HH\\MI\\SS'
</para>
</listitem>
<listitem>
<para>
'"' - string between a quotation marks is skipen and not is parsed.
If you want write '"' to output you must use \\", example '\\"YYYY Month\\"'.
</para>
</listitem>
<listitem>
<para>
text - the PostgreSQL's to_char() support text without '"', but string
between a quotation marks is fastly and you have guarantee, that a text
not will interpreted as a keyword (format-picture), exapmle '"Hello Year: "YYYY'.
</para>
</listitem>
</itemizedlist>
</para> </para>
<para> <para>
<table tocentry="1"> <table tocentry="1">
<title>Format-pictures for number (int/float/numeric) to_char() version.</title> <title>Templates for to_char(<replaceable>numeric</replaceable>)</title>
<tgroup cols="2"> <tgroup cols="2">
<thead> <thead>
<row> <row>
<entry>Format-picture</entry> <entry>Template</entry>
<entry>Description</entry> <entry>Description</entry>
</row> </row>
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry> 9 </entry> <entry>9</entry>
<entry> return value with the specified number of digits, and if digit is <entry>value with the specified number of digits</entry>
not available use blank space </entry>
</row> </row>
<row> <row>
<entry> 0 </entry> <entry>0</entry>
<entry> as 9, but instead blank space use zero </entry> <entry>value with leading zeros</entry>
</row> </row>
<row> <row>
<entry> . (period) </entry> <entry>. (period)</entry>
<entry> decimal point </entry> <entry>decimal point</entry>
</row> </row>
<row> <row>
<entry> , (comma) </entry> <entry>, (comma)</entry>
<entry> group (thousand) separator </entry> <entry>group (thousand) separator</entry>
</row> </row>
<row> <row>
<entry> PR </entry> <entry>PR</entry>
<entry> return negative value in angle brackets </entry> <entry>negative value in angle brackets</entry>
</row> </row>
<row> <row>
<entry> S </entry> <entry>S</entry>
<entry> return negatice value with minus sign (use locales) </entry> <entry>negative value with minus sign (use locales)</entry>
</row> </row>
<row> <row>
<entry> L </entry> <entry>L</entry>
<entry> currency symbol (use locales) </entry> <entry>currency symbol (use locales)</entry>
</row> </row>
<row> <row>
<entry> D </entry> <entry>D</entry>
<entry> decimal point (use locales) </entry> <entry>decimal point (use locales)</entry>
</row> </row>
<row> <row>
<entry> G </entry> <entry>G</entry>
<entry> group separator (use locales) </entry> <entry>group separator (use locales)</entry>
</row> </row>
<row> <row>
<entry> MI </entry> <entry>MI</entry>
<entry> return minus sign on specified position (if number < 0) </entry> <entry>minus sign on specified position (if number < 0)</entry>
</row> </row>
<row> <row>
<entry> PL </entry> <entry>PL</entry>
<entry> return plus sign on specified position (if number > 0) - PostgreSQL extension </entry> <entry>plus sign on specified position (if number > 0)</entry>
</row> </row>
<row> <row>
<entry> SG </entry> <entry>SG</entry>
<entry> return plus/minus sign on specified position - PostgreSQL extension </entry> <entry>plus/minus sign on specified position</entry>
</row> </row>
<row> <row>
<entry> RN </entry> <entry>RN</entry>
<entry> return number as roman number (number must be between 1 and 3999) </entry> <entry>roman numeral (input between 1 and 3999)</entry>
</row> </row>
<row> <row>
<entry> TH or th </entry> <entry>TH or th</entry>
<entry> convert number to ordinal number (not convert numbers under zero and decimal numbers) - PostgreSQL extension </entry> <entry>convert to ordinal number</entry>
</row> </row>
<row> <row>
<entry> V </entry> <entry>V</entry>
<entry> arg1 * (10 ^ n); - return a value multiplied by 10^n (where 'n' is number of '9's after the 'V'). <entry>Shift <replaceable>n</replaceable> digits (see
The to_char() not support use 'V' and decimal poin together, example "99.9V99". </entry> notes)</entry>
</row> </row>
<row> <row>
<entry> EEEE </entry> <entry>EEEE</entry>
<entry> science numbers. Now not supported. </entry> <entry>science numbers. Now not supported.</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
...@@ -849,16 +866,65 @@ ...@@ -849,16 +866,65 @@
</para> </para>
<para> <para>
Note: A sign formatted via 'SG', 'PL' or 'MI' is not anchor in number; Usage notes:
to_char(-12, 'S9999') produce: <ProgramListing> ' -12' </ProgramListing>,
but to_char(-12, 'MI9999') produce: <ProgramListing> '- 12' </ProgramListing>. <itemizedlist>
The Oracle not allow use 'MI' ahead of '9', in the Oracle must be it always <listitem>
after '9'. <para>
A sign formatted using 'SG', 'PL' or 'MI' is not an anchor in
the number; for example,
to_char(-12, 'S9999') produces <literal>' -12'</literal>,
but to_char(-12, 'MI9999') produces <literal>'- 12'</literal>.
The Oracle implementation does not allow the use of
<literal>MI</literal> ahead of <literal>9</literal>, but rather
requires that <literal>9</literal> preceeds
<literal>MI</literal>.
</para>
</listitem>
<listitem>
<para>
<literal>PL</literal>, <literal>SG</literal>, and
<literal>TH</literal> are <productname>Postgres</productname>
extensions.
</para>
</listitem>
<listitem>
<para>
<entry>9</entry>
<entry>value with the specified number of digits, and if digit is
not available use blank space</entry>
</row>
</para>
</listitem>
<listitem>
<para>
<literal>TH</literal> does not convert values less than zero
and does not convert decimal numbers. <literal>TH</literal> is
a <productname>Postgres</productname> extension.
</para>
</listitem>
<listitem>
<para>
<literal>V</literal> effectively
multiplies the input values by
<literal>10^<replaceable>n</replaceable></literal>, where
<replaceable>n</replaceable> is the number of digits following
<literal>V</literal>.
<function>to_char</function> does not support the use of
<literal>V</literal> combined with a decimal point
(e.g. "99.9V99" is not allowed).
</para>
</listitem>
</itemizedlist>
</para> </para>
<para> <para>
<table tocentry="1"> <table tocentry="1">
<title> The to_char() examples. </title> <title><function>to_char</function> Examples</title>
<tgroup cols="2"> <tgroup cols="2">
<thead> <thead>
<row> <row>
...@@ -868,146 +934,144 @@ ...@@ -868,146 +934,144 @@
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry> to_char(now(), 'Day, HH12:MI:SS') </entry> <entry>to_char(now(),'Day, HH12:MI:SS')</entry>
<entry><ProgramListing> 'Tuesday , 05:39:18' </ProgramListing></entry> <entry><literal>'Tuesday , 05:39:18'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char(now(), 'FMDay, HH12:MI:SS') </entry> <entry>to_char(now(),'FMDay, HH12:MI:SS')</entry>
<entry><ProgramListing> 'Tuesday, 05:39:18' </ProgramListing></entry> <entry><literal>'Tuesday, 05:39:18'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( -0.1, '99.99') </entry> <entry>to_char(-0.1,'99.99')</entry>
<entry><ProgramListing> ' -.10' </ProgramListing></entry> <entry><literal>' -.10'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( -0.1, 'FM9.99') </entry> <entry>to_char(-0.1,'FM9.99')</entry>
<entry><ProgramListing> '-.1' </ProgramListing></entry> <entry><literal>'-.1'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 0.1, '0.9') </entry> <entry>to_char(0.1,'0.9')</entry>
<entry><ProgramListing> ' 0.1' </ProgramListing></entry> <entry><literal>' 0.1'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 12, '9990999.9') </entry> <entry>to_char(12,'9990999.9')</entry>
<entry><ProgramListing> ' 0012.0' </ProgramListing></entry> <entry><literal>' 0012.0'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 12, 'FM9990999.9') </entry> <entry>to_char(12,'FM9990999.9')</entry>
<entry><ProgramListing> '0012' </ProgramListing></entry> <entry><literal>'0012'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 485, '999') </entry> <entry>to_char(485,'999')</entry>
<entry><ProgramListing> ' 485' </ProgramListing></entry> <entry><literal>' 485'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( -485, '999') </entry> <entry>to_char(-485,'999')</entry>
<entry><ProgramListing> '-485' </ProgramListing></entry> <entry><literal>'-485'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 485, '9 9 9') </entry> <entry>to_char(485,'9 9 9')</entry>
<entry><ProgramListing> ' 4 8 5' </ProgramListing></entry> <entry><literal>' 4 8 5'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 1485, '9,999') </entry> <entry>to_char(1485,'9,999')</entry>
<entry><ProgramListing> ' 1,485' </ProgramListing></entry> <entry><literal>' 1,485'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 1485, '9G999') </entry> <entry>to_char(1485,'9G999')</entry>
<entry><ProgramListing> ' 1 485' </ProgramListing></entry> <entry><literal>' 1 485'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 148.5, '999.999') </entry> <entry>to_char(148.5,'999.999')</entry>
<entry><ProgramListing> ' 148.500' </ProgramListing></entry> <entry><literal>' 148.500'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 148.5, '999D999') </entry> <entry>to_char(148.5,'999D999')</entry>
<entry><ProgramListing> ' 148,500' </ProgramListing></entry> <entry><literal>' 148,500'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 3148.5,'9G999D999') </entry> <entry>to_char(3148.5,'9G999D999')</entry>
<entry><ProgramListing> ' 3 148,500' </ProgramListing></entry> <entry><literal>' 3 148,500'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( -485, '999S') </entry> <entry>to_char(-485,'999S')</entry>
<entry><ProgramListing> '485-' </ProgramListing></entry> <entry><literal>'485-'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( -485, '999MI') </entry> <entry>to_char(-485,'999MI')</entry>
<entry><ProgramListing> '485-' </ProgramListing></entry> <entry><literal>'485-'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 485, '999MI') </entry> <entry>to_char(485,'999MI')</entry>
<entry><ProgramListing> '485' </ProgramListing></entry> <entry><literal>'485'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 485, 'PL999') </entry> <entry>to_char(485,'PL999')</entry>
<entry><ProgramListing> '+485' </ProgramListing></entry> <entry><literal>'+485'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 485, 'SG999') </entry> <entry>to_char(485,'SG999')</entry>
<entry><ProgramListing> '+485' </ProgramListing></entry> <entry><literal>'+485'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( -485, 'SG999') </entry> <entry>to_char(-485,'SG999')</entry>
<entry><ProgramListing> '-485' </ProgramListing></entry> <entry><literal>'-485'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( -485, '9SG99') </entry> <entry>to_char(-485,'9SG99')</entry>
<entry><ProgramListing> '4-85' </ProgramListing></entry> <entry><literal>'4-85'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( -485, '999PR') </entry> <entry>to_char(-485,'999PR')</entry>
<entry><ProgramListing> '<485>' </ProgramListing></entry> <entry><literal>'&lt;485&gt;'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 485, 'L999') </entry> <entry>to_char(485,'L999')</entry>
<entry><ProgramListing> 'DM 485' </ProgramListing></entry> <entry><literal>'DM 485</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 485, 'RN') </entry> <entry>to_char(485,'RN')</entry>
<entry><ProgramListing> ' CDLXXXV' </ProgramListing></entry> <entry><literal>' CDLXXXV'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 485, 'FMRN') </entry> <entry>to_char(485,'FMRN')</entry>
<entry><ProgramListing> 'CDLXXXV' </ProgramListing></entry> <entry><literal>'CDLXXXV'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 5.2, 'FMRN') </entry> <entry>to_char(5.2,'FMRN')</entry>
<entry><ProgramListing> 'V' </ProgramListing></entry> <entry><literal>V</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 482, '999th') </entry> <entry>to_char(482,'999th')</entry>
<entry><ProgramListing> ' 482nd' </ProgramListing></entry> <entry><literal>' 482nd'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 485, '"Good number:"999') </entry> <entry>to_char(485, '"Good number:"999')</entry>
<entry><ProgramListing> 'Good number: 485' </ProgramListing></entry> <entry><literal>'Good number: 485'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 485.8, '"Pre-decimal:"999" Post-decimal:" .999') </entry> <entry>to_char(485.8,'"Pre-decimal:"999" Post-decimal:" .999')</entry>
<entry><ProgramListing> 'Pre-decimal: 485 Post-decimal: .800' </ProgramListing></entry> <entry><literal>'Pre-decimal: 485 Post-decimal: .800'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 12, '99V999') </entry> <entry>to_char(12,'99V999')</entry>
<entry><ProgramListing> ' 12000' </ProgramListing></entry> <entry><literal>' 12000'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 12.4, '99V999') </entry> <entry>to_char(12.4,'99V999')</entry>
<entry><ProgramListing> ' 12400' </ProgramListing></entry> <entry><literal>' 12400'</literal></entry>
</row> </row>
<row> <row>
<entry> to_char( 12.45, '99V9') </entry> <entry>to_char(12.45, '99V9')</entry>
<entry><ProgramListing> ' 125' </ProgramListing></entry> <entry><literal>' 125'</literal></entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
</table> </table>
</para> </para>
</sect1> </sect1>
<sect1> <sect1>
<title>Geometric Functions</title> <title>Geometric Functions</title>
...@@ -1030,106 +1094,97 @@ ...@@ -1030,106 +1094,97 @@
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry> area(box) </entry> <entry>area(object)</entry>
<entry> float8 </entry> <entry>float8</entry>
<entry> area of box </entry> <entry>area of circle, ...</entry>
<entry> area('((0,0),(1,1))'::box) </entry> <entry>area(box '((0,0),(1,1))')</entry>
</row>
<row>
<entry> area(circle) </entry>
<entry> float8 </entry>
<entry> area of circle </entry>
<entry> area('((0,0),2.0)'::circle) </entry>
</row>
<row>
<entry> box(box,box) </entry>
<entry> box </entry>
<entry> boxes to intersection box </entry>
<entry> box('((0,0),(1,1))','((0.5,0.5),(2,2))') </entry>
</row> </row>
<row> <row>
<entry> center(box) </entry> <entry>box(box,box)</entry>
<entry> point </entry> <entry>box</entry>
<entry> center of object </entry> <entry>boxes to intersection box</entry>
<entry> center('((0,0),(1,2))'::box) </entry> <entry>box(box '((0,0),(1,1))',box '((0.5,0.5),(2,2))')</entry>
</row> </row>
<row> <row>
<entry> center(circle) </entry> <entry>center(object)</entry>
<entry> point </entry> <entry>point</entry>
<entry> center of object </entry> <entry>center of circle, ...</entry>
<entry> center('((0,0),2.0)'::circle) </entry> <entry>center(box '((0,0),(1,2))')</entry>
</row> </row>
<row> <row>
<entry> diameter(circle) </entry> <entry>diameter(circle)</entry>
<entry> float8 </entry> <entry>float8</entry>
<entry> diameter of circle </entry> <entry>diameter of circle</entry>
<entry> diameter('((0,0),2.0)'::circle) </entry> <entry>diameter(circle '((0,0),2.0)')</entry>
</row> </row>
<row> <row>
<entry> height(box) </entry> <entry>height(box)</entry>
<entry> float8 </entry> <entry>float8</entry>
<entry> vertical size of box </entry> <entry>vertical size of box</entry>
<entry> height('((0,0),(1,1))'::box) </entry> <entry>height(box '((0,0),(1,1))')</entry>
</row> </row>
<row> <row>
<entry> isclosed(path) </entry> <entry>isclosed(path)</entry>
<entry> bool </entry> <entry>bool</entry>
<entry> a closed path? </entry> <entry>a closed path?</entry>
<entry> isclosed('((0,0),(1,1),(2,0))'::path) </entry> <entry>isclosed(path '((0,0),(1,1),(2,0))')</entry>
</row> </row>
<row> <row>
<entry> isopen(path) </entry> <entry>isopen(path)</entry>
<entry> bool </entry> <entry>bool</entry>
<entry> an open path? </entry> <entry>an open path?</entry>
<entry> isopen('[(0,0),(1,1),(2,0)]'::path) </entry> <entry>isopen(path '[(0,0),(1,1),(2,0)]')</entry>
</row> </row>
<row> <row>
<entry> length(lseg) </entry> <entry>length(object)</entry>
<entry> float8 </entry> <entry>float8</entry>
<entry> length of line segment </entry> <entry>length of line segment, ...</entry>
<entry> length('((-1,0),(1,0))'::lseg) </entry> <entry>length(path '((-1,0),(1,0))')</entry>
</row> </row>
<row> <row>
<entry> length(path) </entry> <entry>length(path)</entry>
<entry> float8 </entry> <entry>float8</entry>
<entry> length of path </entry> <entry>length of path</entry>
<entry> length('((0,0),(1,1),(2,0))'::path) </entry> <entry>length(path '((0,0),(1,1),(2,0))')</entry>
</row> </row>
<row> <row>
<entry> pclose(path) </entry> <entry>pclose(path)</entry>
<entry> path </entry> <entry>path</entry>
<entry> convert path to closed </entry> <entry>convert path to closed</entry>
<entry> popen('[(0,0),(1,1),(2,0)]'::path) </entry> <entry>popen(path '[(0,0),(1,1),(2,0)]')</entry>
</row> </row>
<!--
Not defined by this name. Implements the intersection operator '#'
<row> <row>
<entry> point(lseg,lseg) </entry> <entry>point(lseg,lseg)</entry>
<entry> point </entry> <entry>point</entry>
<entry> intersection </entry> <entry>intersection</entry>
<entry> point('((-1,0),(1,0))'::lseg,'((-2,-2),(2,2))'::lseg) </entry> <entry>point(lseg '((-1,0),(1,0))',lseg '((-2,-2),(2,2))')</entry>
</row> </row>
-->
<row> <row>
<entry> points(path) </entry> <entry>npoint(path)</entry>
<entry> int4 </entry> <entry>int4</entry>
<entry> number of points </entry> <entry>number of points</entry>
<entry> points('[(0,0),(1,1),(2,0)]'::path) </entry> <entry>npoints(path '[(0,0),(1,1),(2,0)]')</entry>
</row> </row>
<row> <row>
<entry> popen(path) </entry> <entry>popen(path)</entry>
<entry> path </entry> <entry>path</entry>
<entry> convert path to open </entry> <entry>convert path to open path</entry>
<entry> popen('((0,0),(1,1),(2,0))'::path) </entry> <entry>popen(path '((0,0),(1,1),(2,0))')</entry>
</row> </row>
<row> <row>
<entry> radius(circle) </entry> <entry>radius(circle)</entry>
<entry> float8 </entry> <entry>float8</entry>
<entry> radius of circle </entry> <entry>radius of circle</entry>
<entry> radius('((0,0),2.0)'::circle) </entry> <entry>radius(circle '((0,0),2.0)')</entry>
</row> </row>
<row> <row>
<entry> width(box) </entry> <entry>width(box)</entry>
<entry> float8 </entry> <entry>float8</entry>
<entry> horizontal size </entry> <entry>horizontal size</entry>
<entry> width('((0,0),(1,1))'::box) </entry> <entry>width(box '((0,0),(1,1))')</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
...@@ -1150,94 +1205,94 @@ ...@@ -1150,94 +1205,94 @@
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry> box(circle) </entry> <entry>box(circle)</entry>
<entry> box </entry> <entry>box</entry>
<entry> convert circle to box </entry> <entry>convert circle to box</entry>
<entry> box('((0,0),2.0)'::circle) </entry> <entry>box('((0,0),2.0)'::circle)</entry>
</row> </row>
<row> <row>
<entry> box(point,point) </entry> <entry>box(point,point)</entry>
<entry> box </entry> <entry>box</entry>
<entry> convert points to box </entry> <entry>convert points to box</entry>
<entry> box('(0,0)'::point,'(1,1)'::point) </entry> <entry>box('(0,0)'::point,'(1,1)'::point)</entry>
</row> </row>
<row> <row>
<entry> box(polygon) </entry> <entry>box(polygon)</entry>
<entry> box </entry> <entry>box</entry>
<entry> convert polygon to box </entry> <entry>convert polygon to box</entry>
<entry> box('((0,0),(1,1),(2,0))'::polygon) </entry> <entry>box('((0,0),(1,1),(2,0))'::polygon)</entry>
</row> </row>
<row> <row>
<entry> circle(box) </entry> <entry>circle(box)</entry>
<entry> circle </entry> <entry>circle</entry>
<entry> convert to circle </entry> <entry>convert to circle</entry>
<entry> circle('((0,0),(1,1))'::box) </entry> <entry>circle('((0,0),(1,1))'::box)</entry>
</row> </row>
<row> <row>
<entry> circle(point,float8) </entry> <entry>circle(point,float8)</entry>
<entry> circle </entry> <entry>circle</entry>
<entry> convert to circle </entry> <entry>convert to circle</entry>
<entry> circle('(0,0)'::point,2.0) </entry> <entry>circle('(0,0)'::point,2.0)</entry>
</row> </row>
<row> <row>
<entry> lseg(box) </entry> <entry>lseg(box)</entry>
<entry> lseg </entry> <entry>lseg</entry>
<entry> convert diagonal to lseg </entry> <entry>convert diagonal to lseg</entry>
<entry> lseg('((-1,0),(1,0))'::box) </entry> <entry>lseg('((-1,0),(1,0))'::box)</entry>
</row> </row>
<row> <row>
<entry> lseg(point,point) </entry> <entry>lseg(point,point)</entry>
<entry> lseg </entry> <entry>lseg</entry>
<entry> convert to lseg </entry> <entry>convert to lseg</entry>
<entry> lseg('(-1,0)'::point,'(1,0)'::point) </entry> <entry>lseg('(-1,0)'::point,'(1,0)'::point)</entry>
</row> </row>
<row> <row>
<entry> path(polygon) </entry> <entry>path(polygon)</entry>
<entry> point </entry> <entry>point</entry>
<entry> convert to path </entry> <entry>convert to path</entry>
<entry> path('((0,0),(1,1),(2,0))'::polygon) </entry> <entry>path('((0,0),(1,1),(2,0))'::polygon)</entry>
</row> </row>
<row> <row>
<entry> point(circle) </entry> <entry>point(circle)</entry>
<entry> point </entry> <entry>point</entry>
<entry> convert to point (center) </entry> <entry>convert to point (center)</entry>
<entry> point('((0,0),2.0)'::circle) </entry> <entry>point('((0,0),2.0)'::circle)</entry>
</row> </row>
<row> <row>
<entry> point(lseg,lseg) </entry> <entry>point(lseg,lseg)</entry>
<entry> point </entry> <entry>point</entry>
<entry> convert to point (intersection) </entry> <entry>convert to point (intersection)</entry>
<entry> point('((-1,0),(1,0))'::lseg, '((-2,-2),(2,2))'::lseg) </entry> <entry>point('((-1,0),(1,0))'::lseg, '((-2,-2),(2,2))'::lseg)</entry>
</row> </row>
<row> <row>
<entry> point(polygon) </entry> <entry>point(polygon)</entry>
<entry> point </entry> <entry>point</entry>
<entry> center of polygon </entry> <entry>center of polygon</entry>
<entry> point('((0,0),(1,1),(2,0))'::polygon) </entry> <entry>point('((0,0),(1,1),(2,0))'::polygon)</entry>
</row> </row>
<row> <row>
<entry> polygon(box) </entry> <entry>polygon(box)</entry>
<entry> polygon </entry> <entry>polygon</entry>
<entry> convert to polygon with 12 points </entry> <entry>convert to polygon with 12 points</entry>
<entry> polygon('((0,0),(1,1))'::box) </entry> <entry>polygon('((0,0),(1,1))'::box)</entry>
</row> </row>
<row> <row>
<entry> polygon(circle) </entry> <entry>polygon(circle)</entry>
<entry> polygon </entry> <entry>polygon</entry>
<entry> convert to 12-point polygon </entry> <entry>convert to 12-point polygon</entry>
<entry> polygon('((0,0),2.0)'::circle) </entry> <entry>polygon('((0,0),2.0)'::circle)</entry>
</row> </row>
<row> <row>
<entry> polygon(<replaceable class="parameter">npts</replaceable>,circle) </entry> <entry>polygon(<replaceable class="parameter">npts</replaceable>,circle)</entry>
<entry> polygon </entry> <entry>polygon</entry>
<entry> convert to <replaceable class="parameter">npts</replaceable> polygon </entry> <entry>convert to <replaceable class="parameter">npts</replaceable> polygon</entry>
<entry> polygon(12,'((0,0),2.0)'::circle) </entry> <entry>polygon(12,'((0,0),2.0)'::circle)</entry>
</row> </row>
<row> <row>
<entry> polygon(path) </entry> <entry>polygon(path)</entry>
<entry> polygon </entry> <entry>polygon</entry>
<entry> convert to polygon </entry> <entry>convert to polygon</entry>
<entry> polygon('((0,0),(1,1),(2,0))'::path) </entry> <entry>polygon('((0,0),(1,1),(2,0))'::path)</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
...@@ -1258,28 +1313,28 @@ ...@@ -1258,28 +1313,28 @@
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry> isoldpath(path) </entry> <entry>isoldpath(path)</entry>
<entry> path </entry> <entry>path</entry>
<entry> test path for pre-v6.1 form </entry> <entry>test path for pre-v6.1 form</entry>
<entry> isoldpath('(1,3,0,0,1,1,2,0)'::path) </entry> <entry>isoldpath('(1,3,0,0,1,1,2,0)'::path)</entry>
</row> </row>
<row> <row>
<entry> revertpoly(polygon) </entry> <entry>revertpoly(polygon)</entry>
<entry> polygon </entry> <entry>polygon</entry>
<entry> convert pre-v6.1 polygon </entry> <entry>convert pre-v6.1 polygon</entry>
<entry> revertpoly('((0,0),(1,1),(2,0))'::polygon) </entry> <entry>revertpoly('((0,0),(1,1),(2,0))'::polygon)</entry>
</row> </row>
<row> <row>
<entry> upgradepath(path) </entry> <entry>upgradepath(path)</entry>
<entry> path </entry> <entry>path</entry>
<entry> convert pre-v6.1 path </entry> <entry>convert pre-v6.1 path</entry>
<entry> upgradepath('(1,3,0,0,1,1,2,0)'::path) </entry> <entry>upgradepath('(1,3,0,0,1,1,2,0)'::path)</entry>
</row> </row>
<row> <row>
<entry> upgradepoly(polygon) </entry> <entry>upgradepoly(polygon)</entry>
<entry> polygon </entry> <entry>polygon</entry>
<entry> convert pre-v6.1 polygon </entry> <entry>convert pre-v6.1 polygon</entry>
<entry> upgradepoly('(0,1,2,0,1,0)'::polygon) </entry> <entry>upgradepoly('(0,1,2,0,1,0)'::polygon)</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
...@@ -1304,40 +1359,40 @@ ...@@ -1304,40 +1359,40 @@
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry> broadcast(cidr) </entry> <entry>broadcast(cidr)</entry>
<entry> text </entry> <entry>text</entry>
<entry> construct broadcast address as text </entry> <entry>construct broadcast address as text</entry>
<entry> broadcast('192.168.1.5/24') </entry> <entry>broadcast('192.168.1.5/24')</entry>
</row> </row>
<row> <row>
<entry> broadcast(inet) </entry> <entry>broadcast(inet)</entry>
<entry> text </entry> <entry>text</entry>
<entry> construct broadcast address as text </entry> <entry>construct broadcast address as text</entry>
<entry> broadcast('192.168.1.5/24') </entry> <entry>broadcast('192.168.1.5/24')</entry>
</row> </row>
<row> <row>
<entry> host(inet) </entry> <entry>host(inet)</entry>
<entry> text </entry> <entry>text</entry>
<entry> extract host address as text </entry> <entry>extract host address as text</entry>
<entry> host('192.168.1.5/24') </entry> <entry>host('192.168.1.5/24')</entry>
</row> </row>
<row> <row>
<entry> masklen(cidr) </entry> <entry>masklen(cidr)</entry>
<entry> int4 </entry> <entry>int4</entry>
<entry> calculate netmask length </entry> <entry>calculate netmask length</entry>
<entry> masklen('192.168.1.5/24') </entry> <entry>masklen('192.168.1.5/24')</entry>
</row> </row>
<row> <row>
<entry> masklen(inet) </entry> <entry>masklen(inet)</entry>
<entry> int4 </entry> <entry>int4</entry>
<entry> calculate netmask length </entry> <entry>calculate netmask length</entry>
<entry> masklen('192.168.1.5/24') </entry> <entry>masklen('192.168.1.5/24')</entry>
</row> </row>
<row> <row>
<entry> netmask(inet) </entry> <entry>netmask(inet)</entry>
<entry> text </entry> <entry>text</entry>
<entry> construct netmask as text </entry> <entry>construct netmask as text</entry>
<entry> netmask('192.168.1.5/24') </entry> <entry>netmask('192.168.1.5/24')</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
......
<Chapter Id="odbc"> <chapter id="odbc">
<DocInfo> <docinfo>
<AuthorGroup> <authorgroup>
<Author> <author>
<FirstName>Tim</FirstName> <firstname>Tim</firstname>
<Surname>Goeke</Surname> <surname>Goeke</surname>
</Author> </author>
<Author> <author>
<FirstName>Thomas</FirstName> <firstname>Thomas</firstname>
<Surname>Lockhart</Surname> <surname>Lockhart</surname>
</Author> </author>
</AuthorGroup> </authorgroup>
<Date>1998-10-21</Date> <date>1998-10-21</date>
</DocInfo> </docinfo>
<Title>ODBC Interface</Title> <title>ODBC Interface</title>
<Note> <note>
<Para> <para>
Background information originally by Background information originally by
<ULink url="mailto:tgoeke@xpressway.com">Tim Goeke</ULink> <ulink url="mailto:tgoeke@xpressway.com">Tim Goeke</ulink>
</Para> </para>
</Note> </note>
<Para> <para>
<acronym>ODBC</acronym> (Open Database Connectivity) is an abstract <acronym>ODBC</acronym> (Open Database Connectivity) is an abstract
<acronym>API</acronym> <acronym>API</acronym>
which allows you to write applications which can interoperate which allows you to write applications which can interoperate
with various <acronym>RDBMS</acronym> servers. with various <acronym>RDBMS</acronym> servers.
<acronym>ODBC</acronym> provides a product-neutral interface <acronym>ODBC</acronym> provides a product-neutral interface
between frontend applications and database servers, between frontend applications and database servers,
allowing a user or developer to write applications which are allowing a user or developer to write applications which are
transportable between servers from different manufacturers.. transportable between servers from different manufacturers..
</Para> </para>
<Sect1> <sect1>
<Title>Background</Title> <title>Background</title>
<Para> <para>
The <acronym>ODBC</acronym> <acronym>API</acronym> matches up The <acronym>ODBC</acronym> <acronym>API</acronym> matches up
on the backend to an <acronym>ODBC</acronym>-compatible data source. on the backend to an <acronym>ODBC</acronym>-compatible data source.
This could be anything from a text file to an Oracle or This could be anything from a text file to an Oracle or
<productname>Postgres</productname> <acronym>RDBMS</acronym>. <productname>Postgres</productname> <acronym>RDBMS</acronym>.
</Para> </para>
<Para> <para>
The backend access come from <acronym>ODBC</acronym> drivers, The backend access come from <acronym>ODBC</acronym> drivers,
or vendor specifc drivers that or vendor specifc drivers that
allow data access. <productname>psqlODBC</productname> is such a driver, allow data access. <productname>psqlODBC</productname> is such a driver,
along with others that are along with others that are
available, such as the OpenLink <acronym>ODBC</acronym> drivers. available, such as the OpenLink <acronym>ODBC</acronym> drivers.
</Para> </para>
<Para> <para>
Once you write an <acronym>ODBC</acronym> application, Once you write an <acronym>ODBC</acronym> application,
you <emphasis>should</emphasis> be able to connect to <emphasis>any</emphasis> you <emphasis>should</emphasis> be able to connect to <emphasis>any</emphasis>
back end database, regardless of the vendor, as long as the database schema back end database, regardless of the vendor, as long as the database schema
is the same. is the same.
</Para> </para>
<Para> <para>
For example. you could have <productname>MS SQL Server</productname> For example. you could have <productname>MS SQL Server</productname>
and <productname>Postgres</productname> servers which have and <productname>Postgres</productname> servers which have
exactly the same data. Using <acronym>ODBC</acronym>, exactly the same data. Using <acronym>ODBC</acronym>,
your Windows application would make exactly the your Windows application would make exactly the
same calls and the back end data source would look the same (to the Windows same calls and the back end data source would look the same (to the Windows
app). app).
</Para> </para>
<para>
<ulink url="http://www.insightdist.com/">Insight Distributors</ulink>
provides active and ongoing
support for the core <productname>psqlODBC</productname> distribution.
They provide a
<ulink url="http://www.insightdist.com/psqlodbc/"><acronym>FAQ</acronym></ulink>,
ongoing development on the code base, and actively participate on the
<ulink url="mailto:interfaces@postgresql.org">interfaces mailing list</ulink>.
</Para>
</sect1>
<sect1>
<title><productname>Windows</productname> Applications</title>
<Para>
In the real world, differences in drivers and the level of
<acronym>ODBC</acronym> support
lessens the potential of <acronym>ODBC</acronym>:
<ItemizedList Mark="bullet" Spacing="compact">
<ListItem>
<Para>
Access, Delphi, and Visual Basic all support <acronym>ODBC</acronym> directly.
</Para>
</listitem>
<ListItem>
<Para>
Under C++, such as Visual C++,
you can use the C++ <acronym>ODBC</acronym> <acronym>API</acronym>.
</Para>
</listitem>
<ListItem>
<Para>
In Visual C++, you can use the CRecordSet class, which wraps the
<acronym>ODBC</acronym> <acronym>API</acronym>
set within an MFC 4.2 class. This is the easiest route if you are doing
Windows C++ development under Windows NT.
</Para>
</listitem>
</ItemizedList>
</Para>
<sect2>
<title>Writing Applications</title>
<Para>
<quote>
If I write an application for <productname>Postgres</productname>
can I write it using <acronym>ODBC</acronym> calls
to the <productname>Postgres</productname> server,
or is that only when another database program
like MS SQL Server or Access needs to access the data?</quote>
</para>
<Para>
The <acronym>ODBC</acronym> <acronym>API</acronym>
is the way to go.
For <productname>Visual C++</productname> coding you can find out more at
Microsoft's web site or in your <productname>VC++</productname> docs.
</Para>
<Para>
Visual Basic and the other RAD tools have Recordset objects
that use <acronym>ODBC</acronym>
directly to access data. Using the data-aware controls, you can quickly
link to the <acronym>ODBC</acronym> back end database
(<Emphasis>very</Emphasis> quickly).
</Para>
<Para>
Playing around with MS Access will help you sort this out. Try using
<literal>File->Get External Data</literal>.
</Para>
<Tip>
<Para>
You'll have to set up a DSN first.
</Para>
</Tip>
<!-- <!--
<Para> <para>
<Tip> <ulink url="http://www.insightdist.com/">Insight Distributors</ulink>
<Para> provides active and ongoing
The <productname>Postgres</productname> datetime type will break MS Access. support for the core <productname>psqlODBC</productname> distribution.
</Para> They provide a
</Tip> <ulink url="http://www.insightdist.com/psqlodbc/"><acronym>FAQ</acronym></ulink>,
ongoing development on the code base, and actively participate on the
<ulink url="mailto:interfaces@postgresql.org">interfaces mailing list</ulink>.
</para>
--> -->
</sect2> </sect1>
</sect1>
<sect1>
<sect1> <title><productname>Windows</productname> Applications</title>
<title>Unix Installation</title>
<para>
<para> In the real world, differences in drivers and the level of
<productname>ApplixWare</productname> has an <acronym>ODBC</acronym> support
<acronym>ODBC</acronym> database interface lessens the potential of <acronym>ODBC</acronym>:
supported on at least some platforms.
<productname>ApplixWare</productname> v4.4.1 has been <itemizedlist spacing="compact" mark="bullet">
demonstrated under Linux with <productname>Postgres</productname> v6.4 <listitem>
using the <productname>psqlODBC</productname> <para>
driver contained in the <productname>Postgres</productname> distribution. Access, Delphi, and Visual Basic all support <acronym>ODBC</acronym> directly.
</Para> </para>
</listitem>
<sect2> <listitem>
<title>Building the Driver</title> <para>
Under C++, such as Visual C++,
<para> you can use the C++ <acronym>ODBC</acronym> <acronym>API</acronym>.
The first thing </para>
to note about the <productname>psqlODBC</productname> driver </listitem>
(or any <acronym>ODBC</acronym> driver) is that there must
exist a driver manager on the system where <listitem>
the <acronym>ODBC</acronym> driver is to be <para>
used. There exists a freeware <acronym>ODBC</acronym> driver for Unix In Visual C++, you can use the CRecordSet class, which wraps the
called <productname>iodbc</productname> which <acronym>ODBC</acronym> <acronym>API</acronym>
can be obtained from various locations on the Net, including at set within an MFC 4.2 class. This is the easiest route if you are doing
<ulink url="http://www.as220.org/FreeODBC/iodbc-2.12.shar.Z">AS200</ulink>. Windows C++ development under Windows NT.
Instructions for installing <productname>iodbc</productname> </para>
are beyond the scope of this </listitem>
document, but there is a <filename>README</filename> </itemizedlist>
that can be found inside the <productname>iodbc</productname> compressed </para>
.shar file that should explain how to get it up and running.
</Para> <sect2>
<title>Writing Applications</title>
<para>
Having said that, any driver manager that you can find for your platform <para>
should support the <productname>psqlODBC</productname> driver <quote>
or any <acronym>ODBC</acronym> driver. If I write an application for <productname>Postgres</productname>
</Para> can I write it using <acronym>ODBC</acronym> calls
to the <productname>Postgres</productname> server,
<para> or is that only when another database program
The Unix configuration files for <productname>psqlODBC</productname> like MS SQL Server or Access needs to access the data?</quote>
have recently been extensively </para>
reworked to allow for easy building on supported platforms as <para>
well as to allow for support of other Unix platforms in the future. The <acronym>ODBC</acronym> <acronym>API</acronym>
The new configuration and build files for the driver should make it is the way to go.
a simple process to build the driver on the supported platforms. Currently For <productname>Visual C++</productname> coding you can find out more at
these include Linux and FreeBSD but we are hoping other users will Microsoft's web site or in your <productname>VC++</productname> docs.
contribute the necessary information to quickly expand the number of </para>
platforms for which the driver can be built.
</Para> <para>
Visual Basic and the other RAD tools have Recordset objects
<para> that use <acronym>ODBC</acronym>
There are actually two separate methods to build the driver depending on directly to access data. Using the data-aware controls, you can quickly
how you received it and these differences come down to only where and how to link to the <acronym>ODBC</acronym> back end database
run <application>configure</application> and <application>make</application>. (<emphasis>very</emphasis> quickly).
The driver can be built in a standalone, client-only installation, or can be </para>
built as a part of the main <productname>Postgres</productname> distribution.
The standalone installation is convenient if you have <acronym>ODBC</acronym> <para>
client applications on multiple, heterogeneous platforms. The integrated Playing around with MS Access will help you sort this out. Try using
installation is convenient when the target client is the same as the <literal>File->Get External Data</literal>.
server, or when the client and server have similar runtime configurations. </para>
</Para>
<tip>
<para> <para>
Specifically if you have received the <productname>psqlODBC</productname> You'll have to set up a DSN first.
driver as part of the <productname>Postgres</productname> distribution </para>
(from now on referred to as an "integrated" build) then you will </tip>
configure and make the <acronym>ODBC</acronym> driver
from the top level source directory <!--
of the <productname>Postgres</productname> distribution <Para>
along with the rest of its libraries. <Tip>
If you received the driver as a standalone package than you will run <Para>
configure and make from the directory in which you unpacked the The <productname>Postgres</productname> datetime type will break MS Access.
driver source. </Para>
</Para> </Tip>
-->
<procedure> </sect2>
<title>Integrated Installation</title> </sect1>
<para> <sect1>
This installation procedure is appropriate for an integrated installation. <title>Unix Installation</title>
</Para>
<para>
<step performance="required"> <productname>ApplixWare</productname> has an
<para> <acronym>ODBC</acronym> database interface
Specify the <option>--with-odbc</option> supported on at least some platforms.
command-line argument for <application>src/configure</application>: <productname>ApplixWare</productname> v4.4.1 has been
demonstrated under Linux with <productname>Postgres</productname> v6.4
<programlisting> using the <productname>psqlODBC</productname>
% ./configure --with-odbc driver contained in the <productname>Postgres</productname> distribution.
% make </para>
</programlisting>
</Para> <sect2>
</step> <title>Building the Driver</title>
<step performance="required">
<para> <para>
Rebuild the <productname>Postgres</productname> distribution: The first thing
to note about the <productname>psqlODBC</productname> driver
<programlisting> (or any <acronym>ODBC</acronym> driver) is that there must
% make install exist a driver manager on the system where
</programlisting> the <acronym>ODBC</acronym> driver is to be
</Para> used. There exists a freeware <acronym>ODBC</acronym> driver for Unix
</step> called <productname>iodbc</productname> which
</procedure> can be obtained from various locations on the Net, including at
<ulink url="http://www.as220.org/FreeODBC/iodbc-2.12.shar.Z">AS200</ulink>.
<para> Instructions for installing <productname>iodbc</productname>
Once configured, the <acronym>ODBC</acronym> driver will be built and installed are beyond the scope of this
into the areas defined for the other components of the document, but there is a <filename>README</filename>
<productname>Postgres</productname> system. The installation-wide that can be found inside the <productname>iodbc</productname> compressed
<acronym>ODBC</acronym> configuration file will be placed into .shar file that should explain how to get it up and running.
the top directory of the Postgres target tree (<envar>POSTGRESDIR</envar>). </para>
This can be overridden from the <application>make</application> command-line
as <para>
<programlisting> Having said that, any driver manager that you can find for your platform
% make ODBCINST=<replaceable>filename</replaceable> install should support the <productname>psqlODBC</productname> driver
</programlisting> or any <acronym>ODBC</acronym> driver.
</Para> </para>
<procedure> <para>
<title>Pre-v6.4 Integrated Installation</title> The Unix configuration files for <productname>psqlODBC</productname>
have recently been extensively
<para> reworked to allow for easy building on supported platforms as
If you have a <productname>Postgres</productname> installation older than well as to allow for support of other Unix platforms in the future.
v6.4, you have the original source tree available, The new configuration and build files for the driver should make it
and you want to use the newest version of the <acronym>ODBC</acronym> a simple process to build the driver on the supported platforms. Currently
driver, then you may want to try this form of installation. these include Linux and FreeBSD but we are hoping other users will
</Para> contribute the necessary information to quickly expand the number of
platforms for which the driver can be built.
<step performance="required"> </para>
<para>
Copy the output tar file to your target system and unpack it into a <para>
clean directory. There are actually two separate methods to build the driver depending on
</Para> how you received it and these differences come down to only where and how to
</step> run <application>configure</application> and <application>make</application>.
<step performance="required"> The driver can be built in a standalone, client-only installation, or can be
<para> built as a part of the main <productname>Postgres</productname> distribution.
From the directory containing the The standalone installation is convenient if you have <acronym>ODBC</acronym>
sources, type: client applications on multiple, heterogeneous platforms. The integrated
installation is convenient when the target client is the same as the
<programlisting> server, or when the client and server have similar runtime configurations.
% ./configure </para>
% make
% make POSTGRESDIR=<replaceable class="parameter">PostgresTopDir</replaceable> install <para>
</programlisting> Specifically if you have received the <productname>psqlODBC</productname>
</Para> driver as part of the <productname>Postgres</productname> distribution
</step> (from now on referred to as an "integrated" build) then you will
configure and make the <acronym>ODBC</acronym> driver
<step performance="optional"> from the top level source directory
<para> of the <productname>Postgres</productname> distribution
If you would like to install components into different trees, along with the rest of its libraries.
then you can specify various destinations explicitly: If you received the driver as a standalone package than you will run
configure and make from the directory in which you unpacked the
<programlisting> driver source.
% make BINDIR=bindir LIBDIR=libdir HEADERDIR=headerdir ODBCINST=instfile install </para>
</programlisting>
</Para> <procedure>
</step> <title>Integrated Installation</title>
</procedure>
<para>
<procedure> This installation procedure is appropriate for an integrated installation.
<title>Standalone Installation</title> </para>
<para> <step performance="required">
A standalone installation is not integrated with or built on the normal <para>
<productname>Postgres</productname> distribution. It should be best suited Specify the <option>--with-odbc</option>
for building the <acronym>ODBC</acronym> driver for multiple, heterogeneous command-line argument for <application>src/configure</application>:
clients who do not have a locally-installed <productname>Postgres</productname>
source tree. <programlisting>
</Para> % ./configure --with-odbc
% make
<para> </programlisting>
The default location for libraries and headers </para>
for the standalone installation is <filename>/usr/local/lib</filename> </step>
and <filename>/usr/local/include/iodbc</filename>, respectively. <step performance="required">
There is another system wide configuration file that gets installed <para>
as <filename>/share/odbcinst.ini</filename> (if <filename>/share</filename> Rebuild the <productname>Postgres</productname> distribution:
exists) or as <filename>/etc/odbcinst.ini</filename>
(if <filename>/share</filename> does not exist). <programlisting>
</Para> % make install
</programlisting>
<note> </para>
<para> </step>
Installation of files into <filename>/share</filename> </procedure>
or <filename>/etc</filename> requires system root privileges.
Most installation steps for <productname>Postgres</productname> do not <para>
have this requirement, and you can choose another destination which Once configured, the <acronym>ODBC</acronym> driver will be built and installed
is writable by your non-root <productname>Postgres</productname> superuser into the areas defined for the other components of the
account instead. <productname>Postgres</productname> system. The installation-wide
</Para> <acronym>ODBC</acronym> configuration file will be placed into
</note> the top directory of the Postgres target tree (<envar>POSTGRESDIR</envar>).
This can be overridden from the <application>make</application> command-line
<step performance="required"> as
<para> <programlisting>
The standalone installation distribution can be built from the % make ODBCINST=<replaceable>filename</replaceable> install
<productname>Postgres</productname> distribution or may be obtained from </programlisting>
<ulink url="http://www.insightdist.com/psqlodbc">Insight Distributors</ulink>, </para>
the current maintainers of the non-Unix sources.
</Para> <procedure>
<title>Pre-v6.4 Integrated Installation</title>
<para>
Copy the zip <para>
or gzipped tarfile to an empty directory. If using the zip package If you have a <productname>Postgres</productname> installation older than
unzip it with the command v6.4, you have the original source tree available,
<programlisting> and you want to use the newest version of the <acronym>ODBC</acronym>
% unzip -a <replaceable>packagename</replaceable> driver, then you may want to try this form of installation.
</programlisting> </para>
The <option>-a</option> option <step performance="required">
is necessary to get rid of <acronym>DOS</acronym> <para>
CR/LF pairs in the source files. Copy the output tar file to your target system and unpack it into a
</Para> clean directory.
</para>
<para> </step>
If you have the gzipped tar package than simply run <step performance="required">
<para>
<programlisting> From the directory containing the
tar -xzf <replaceable>packagename</replaceable> sources, type:
</programlisting>
</Para> <programlisting>
% ./configure
<substeps> % make
% make POSTGRESDIR=<replaceable class="parameter">PostgresTopDir</replaceable> install
<step performance="optional"> </programlisting>
<para> </para>
To create a tar file for a complete standalone installation </step>
from the main <productname>Postgres</productname> source tree:
</Para> <step performance="optional">
</step> <para>
</substeps> If you would like to install components into different trees,
</step> then you can specify various destinations explicitly:
<step performance="required">
<para> <programlisting>
Configure the main <productname>Postgres</productname> distribution. % make BINDIR=bindir LIBDIR=libdir HEADERDIR=headerdir ODBCINST=instfile install
</Para> </programlisting>
</step> </para>
<step performance="required"> </step>
<para> </procedure>
Create the tar file:
<procedure>
<programlisting> <title>Standalone Installation</title>
% cd interfaces/odbc
% make standalone <para>
</programlisting> A standalone installation is not integrated with or built on the normal
</Para> <productname>Postgres</productname> distribution. It should be best suited
</step> for building the <acronym>ODBC</acronym> driver for multiple, heterogeneous
clients who do not have a locally-installed <productname>Postgres</productname>
<step performance="required"> source tree.
<para> </para>
Copy the output tar file to your target system. Be sure to transfer as
a binary file if using <application>ftp</application>. <para>
</Para> The default location for libraries and headers
</step> for the standalone installation is <filename>/usr/local/lib</filename>
and <filename>/usr/local/include/iodbc</filename>, respectively.
<step performance="required"> There is another system wide configuration file that gets installed
<para> as <filename>/share/odbcinst.ini</filename> (if <filename>/share</filename>
Unpack the tar file into a clean exists) or as <filename>/etc/odbcinst.ini</filename>
directory. (if <filename>/share</filename> does not exist).
</Para> </para>
</step>
<note>
<step performance="required"> <para>
<para> Installation of files into <filename>/share</filename>
Configure the standalone installation: or <filename>/etc</filename> requires system root privileges.
Most installation steps for <productname>Postgres</productname> do not
<programlisting> have this requirement, and you can choose another destination which
% ./configure is writable by your non-root <productname>Postgres</productname> superuser
</programlisting> account instead.
</Para> </para>
</note>
<para>
The configuration can be done with options: <step performance="required">
<para>
<programlisting> The standalone installation distribution can be built from the
% ./configure --prefix=<replaceable>rootdir</replaceable> --with-odbc=<replaceable>inidir</replaceable> <productname>Postgres</productname> distribution or may be obtained from
</programlisting> <ulink url="http://www.insightdist.com/psqlodbc">Insight Distributors</ulink>,
the current maintainers of the non-Unix sources.
where <option>--prefix</option> installs the libraries and headers in </para>
the directories <filename><replaceable>rootdir</replaceable>/lib</filename> and
<filename><replaceable>rootdir</replaceable>/include/iodbc</filename>, and <para>
<option>--with-odbc</option> installs <filename>odbcinst.ini</filename> in the Copy the zip
specified directory. or gzipped tarfile to an empty directory. If using the zip package
</Para> unzip it with the command
<programlisting>
<para> % unzip -a <replaceable>packagename</replaceable>
Note that both of these options can also be used from the integrated build </programlisting>
but be aware that <emphasis>when used in the integrated build</emphasis>
<option>--prefix</option> will also apply to the rest of The <option>-a</option> option
your <productname>Postgres</productname> installation. is necessary to get rid of <acronym>DOS</acronym>
<option>--with-odbc</option> applies only to the configuration file CR/LF pairs in the source files.
<filename>odbcinst.ini</filename>. </para>
</Para>
</step> <para>
If you have the gzipped tar package than simply run
<step performance="required">
<para> <programlisting>
Compile and link the source code: tar -xzf <replaceable>packagename</replaceable>
</programlisting>
<programlisting> </para>
% make ODBCINST=<replaceable>instdir</replaceable>
</programlisting> <substeps>
</Para>
<step performance="optional">
<para> <para>
You can also override the default location for installation on the To create a tar file for a complete standalone installation
'make' command line. This only applies to the installation of the from the main <productname>Postgres</productname> source tree:
library and header files. Since the driver needs to know the location </para>
of the odbcinst.ini file attempting to override the enviroment variable </step>
that specifies its installation directory will probably cause you </substeps>
headaches. It is safest simply to allow the driver to install the </step>
odbcinst.ini file in the default directory or the directory you specified <step performance="required">
on the './configure' command line with --with-odbc. <para>
</Para> Configure the main <productname>Postgres</productname> distribution.
</step> </para>
</step>
<!-- <step performance="required">
This doesn't currently work - thomas 1998-10-19 <para>
<tip> Create the tar file:
<para>
<envar>ODBCINST</envar> can be specified during configuration or during <programlisting>
the compilation. It is not necessary to do so in both steps. % cd interfaces/odbc
</tip> % make standalone
--> </programlisting>
</para>
<step performance="required"> </step>
<para>
Install the source code: <step performance="required">
<para>
<programlisting> Copy the output tar file to your target system. Be sure to transfer as
% make POSTGRESDIR=<replaceable>targettree</replaceable> install a binary file if using <application>ftp</application>.
</programlisting> </para>
</Para> </step>
<para> <step performance="required">
To override the library and header installation directories separately <para>
you need to pass the correct installation variables on the Unpack the tar file into a clean
<literal>make install</literal> command line. These variables are directory.
<envar>LIBDIR</envar>, <envar>HEADERDIR</envar> </para>
and <envar>ODBCINST</envar>. </step>
Overriding <envar>POSTGRESDIR</envar> on the make command line will cause
<envar>LIBDIR</envar> and <envar>HEADERDIR</envar> <step performance="required">
to be rooted at the new directory you specify. <para>
<envar>ODBCINST</envar> is independent of <envar>POSTGRESDIR</envar>. Configure the standalone installation:
</Para>
<programlisting>
<para> % ./configure
Here is how you would specify the various destinations explicitly: </programlisting>
</para>
<programlisting>
% make BINDIR=<replaceable>bindir</replaceable> LIBDIR=<replaceable>libdir</replaceable> HEADERDIR=<replaceable>headerdir</replaceable> install <para>
</programlisting> The configuration can be done with options:
</Para>
<programlisting>
<para> % ./configure --prefix=<replaceable>rootdir</replaceable>
For example, typing --with-odbc=<replaceable>inidir</replaceable>
</programlisting>
<programlisting>
% make POSTGRESDIR=/opt/psqlodbc install where <option>--prefix</option> installs the libraries and headers in
</programlisting> the directories <filename><replaceable>rootdir</replaceable>/lib</filename> and
<filename><replaceable>rootdir</replaceable>/include/iodbc</filename>, and
(after you've used <option>--with-odbc</option> installs <filename>odbcinst.ini</filename> in the
<application>./configure</application> and <application>make</application>) specified directory.
will cause the libraries and headers to be installed in the directories </para>
<filename>/opt/psqlodbc/lib</filename>
and <filename>/opt/psqlodbc/include/iodbc</filename> respectively. <para>
</Para> Note that both of these options can also be used from the integrated build
but be aware that <emphasis>when used in the integrated build</emphasis>
<para> <option>--prefix</option> will also apply to the rest of
The command your <productname>Postgres</productname> installation.
<option>--with-odbc</option> applies only to the configuration file
<programlisting> <filename>odbcinst.ini</filename>.
% make POSTGRESDIR=/opt/psqlodbc HEADERDIR=/usr/local install </para>
</programlisting> </step>
should cause the libraries to be installed in /opt/psqlodbc/lib and <step performance="required">
the headers in /usr/local/include/iodbc. If this doesn't work as <para>
expected please contact one of the maintainers. Compile and link the source code:
</Para>
</step> <programlisting>
</procedure> % make ODBCINST=<replaceable>instdir</replaceable>
</sect2> </programlisting>
</sect1> </para>
<sect1> <para>
<title>Configuration Files</title> You can also override the default location for installation on the
'make' command line. This only applies to the installation of the
<para> library and header files. Since the driver needs to know the location
<filename>~/.odbc.ini</filename> contains user-specified access information of the odbcinst.ini file attempting to override the enviroment variable
for the <productname>psqlODBC</productname> driver. that specifies its installation directory will probably cause you
The file uses conventions typical for <productname>Windows</productname> headaches. It is safest simply to allow the driver to install the
Registry files, but despite this restriction can be made to work. odbcinst.ini file in the default directory or the directory you specified
</Para> on the './configure' command line with --with-odbc.
</para>
<para> </step>
The <filename>.odbc.ini</filename> file has three required sections.
The first is <literal>[ODBC Data Sources]</literal> <!--
which is a list of arbitrary names and descriptions for each database This doesn't currently work - thomas 1998-10-19
you wish to access. The second required section is the <tip>
Data Source Specification and there will be one of these sections <para>
for each database. <envar>ODBCINST</envar> can be specified during configuration or during
Each section must be labeled with the name given in the compilation. It is not necessary to do so in both steps.
<literal>[ODBC Data Sources]</literal> and must contain the following entries: </tip>
-->
<programlisting>
Driver = <replaceable>POSTGRESDIR</replaceable>/lib/libpsqlodbc.so <step performance="required">
Database=<replaceable>DatabaseName</replaceable> <para>
Servername=localhost Install the source code:
Port=5432
</programlisting> <programlisting>
% make POSTGRESDIR=<replaceable>targettree</replaceable> install
<tip> </programlisting>
<para> </para>
Remember that the <productname>Postgres</productname> database name is
usually a single word, without path names of any sort. <para>
The <productname>Postgres</productname> server manages the actual access To override the library and header installation directories separately
to the database, and you need only specify the name from the client. you need to pass the correct installation variables on the
</Para> <literal>make install</literal> command line. These variables are
</tip> <envar>LIBDIR</envar>, <envar>HEADERDIR</envar>
and <envar>ODBCINST</envar>.
Other entries may be inserted to control the format of the display. Overriding <envar>POSTGRESDIR</envar> on the make command line will cause
The third required section is <literal>[ODBC]</literal> <envar>LIBDIR</envar> and <envar>HEADERDIR</envar>
which must contain the <literal>InstallDir</literal> keyword to be rooted at the new directory you specify.
and which may contain other options. <envar>ODBCINST</envar> is independent of <envar>POSTGRESDIR</envar>.
</Para> </para>
<para> <para>
Here is an example <filename>.odbc.ini</filename> file, Here is how you would specify the various destinations explicitly:
showing access information for three databases:
<programlisting>
<programlisting> % make BINDIR=<replaceable>bindir</replaceable>
LIBDIR<replaceable>>libdi</replaceable>>
HEADERDIR=<replaceable>headerdir</replaceable> install
</programlisting>
</para>
<para>
For example, typing
<programlisting>
% make POSTGRESDIR=/opt/psqlodbc install
</programlisting>
(after you've used
<application>./configure</application> and <application>make</application>)
will cause the libraries and headers to be installed in the directories
<filename>/opt/psqlodbc/lib</filename>
and <filename>/opt/psqlodbc/include/iodbc</filename> respectively.
</para>
<para>
The command
<programlisting>
% make POSTGRESDIR=/opt/psqlodbc HEADERDIR=/usr/local install
</programlisting>
should cause the libraries to be installed in /opt/psqlodbc/lib and
the headers in /usr/local/include/iodbc. If this doesn't work as
expected please contact one of the maintainers.
</para>
</step>
</procedure>
</sect2>
</sect1>
<sect1>
<title>Configuration Files</title>
<para>
<filename>~/.odbc.ini</filename> contains user-specified access information
for the <productname>psqlODBC</productname> driver.
The file uses conventions typical for <productname>Windows</productname>
Registry files, but despite this restriction can be made to work.
</para>
<para>
The <filename>.odbc.ini</filename> file has three required sections.
The first is <literal>[ODBC Data Sources]</literal>
which is a list of arbitrary names and descriptions for each database
you wish to access. The second required section is the
Data Source Specification and there will be one of these sections
for each database.
Each section must be labeled with the name given in
<literal>[ODBC Data Sources]</literal> and must contain the following entries:
<programlisting>
Driver = <replaceable>POSTGRESDIR</replaceable>/lib/libpsqlodbc.so
Database=<replaceable>DatabaseName</replaceable>
Servername=localhost
Port=5432
</programlisting>
<tip>
<para>
Remember that the <productname>Postgres</productname> database name is
usually a single word, without path names of any sort.
The <productname>Postgres</productname> server manages the actual access
to the database, and you need only specify the name from the client.
</para>
</tip>
Other entries may be inserted to control the format of the display.
The third required section is <literal>[ODBC]</literal>
which must contain the <literal>InstallDir</literal> keyword
and which may contain other options.
</para>
<para>
Here is an example <filename>.odbc.ini</filename> file,
showing access information for three databases:
<programlisting>
[ODBC Data Sources] [ODBC Data Sources]
DataEntry = Read/Write Database DataEntry = Read/Write Database
QueryOnly = Read-only Database QueryOnly = Read-only Database
...@@ -620,465 +625,468 @@ Driver = /opt/postgres/current/lib/libpsqlodbc.so ...@@ -620,465 +625,468 @@ Driver = /opt/postgres/current/lib/libpsqlodbc.so
[ODBC] [ODBC]
InstallDir = /opt/applix/axdata/axshlib InstallDir = /opt/applix/axdata/axshlib
</programlisting> </programlisting>
</Para> </para>
</sect1> </sect1>
<sect1> <sect1>
<title>ApplixWare</title> <title>ApplixWare</title>
<sect2> <sect2>
<title>Configuration</title> <title>Configuration</title>
<para> <para>
<productname>ApplixWare</productname> must be configured correctly <productname>ApplixWare</productname> must be configured correctly
in order for it to in order for it to
be able to access the <productname>Postgres</productname> be able to access the <productname>Postgres</productname>
<acronym>ODBC</acronym> software drivers. <acronym>ODBC</acronym> software drivers.
</Para> </para>
<procedure> <procedure>
<title>Enabling ApplixWare Database Access</title> <title>Enabling ApplixWare Database Access</title>
<para> <para>
These instructions are for the 4.4.1 release of These instructions are for the <literal>4.4.2</literal> release of
<productname>ApplixWare</productname> on <productname>Linux</productname>. <productname>ApplixWare</productname> on <productname>Linux</productname>.
Refer to the <citetitle>Linux Sys Admin</citetitle> on-line book Refer to the <citetitle>Linux Sys Admin</citetitle> on-line book
for more detailed information. for more detailed information.
</Para> </para>
<step performance="required"> <step performance="required">
<para> <para>
You must modify <filename>axnet.cnf</filename> so that You must modify <filename>axnet.cnf</filename> so that
<filename>elfodbc</filename> can <filename>elfodbc</filename> can
find <filename>libodbc.so</filename> find <filename>libodbc.so</filename>
(the <acronym>ODBC</acronym> driver manager) shared library. (the <acronym>ODBC</acronym> driver manager) shared library.
This library is included with the ApplixWare distribution, This library is included with the ApplixWare distribution,
but <filename>axnet.cnf</filename> needs to be modified to point to the but <filename>axnet.cnf</filename> needs to be modified to point to the
correct location. correct location.
</Para> </para>
<para> <para>
As root, edit the file As root, edit the file
<filename><replaceable>applixroot</replaceable>/applix/axdata/axnet.cnf</filename>. <filename><replaceable>applixroot</replaceable>/applix/axdata/axnet.cnf</filename>.
</Para> </para>
<substeps> <substeps>
<step performance="required"> <step performance="required">
<para> <para>
At the bottom of <filename>axnet.cnf</filename>, At the bottom of <filename>axnet.cnf</filename>,
find the line that starts with find the line that starts with
<programlisting> <programlisting>
#libFor elfodbc /ax/<replaceable>...</replaceable> #libFor elfodbc /ax/<replaceable>...</replaceable>
</programlisting> </programlisting>
</Para> </para>
</step> </step>
<step performance="required"> <step performance="required">
<para> <para>
Change line to read Change line to read
<programlisting> <programlisting>
libFor elfodbc <replaceable>applixroot</replaceable>/applix/axdata/axshlib/lib libFor elfodbc <replaceable>applixroot</replaceable>/applix/axdata/axshlib/lib
</programlisting> </programlisting>
which will tell elfodbc to look in this directory which will tell elfodbc to look in this directory
for the <acronym>ODBC</acronym> support library. for the <acronym>ODBC</acronym> support library.
If you have installed applix somewhere else, Typically <productname>Applix</productname> is installed in
change the path accordingly. <filename>/opt</filename> so the full path would be
</Para> <filename>/opt/applix/axdata/axshlib/lib</filename>,
</step> but if you have installed applix somewhere else then
</substeps> change the path accordingly.
</step> </para>
</step>
<step performance="required"> </substeps>
<para> </step>
Create <filename>.odbc.ini</filename> as
described above. You may also want to add the flag <step performance="required">
<para>
<programlisting> Create <filename>.odbc.ini</filename> as
TextAsLongVarchar=0 described above. You may also want to add the flag
</programlisting>
<programlisting>
to the database-specific portion of <filename>.odbc.ini</filename> TextAsLongVarchar=0
so that text fields will not be shown as <literal>**BLOB**</literal>. </programlisting>
</Para>
</step> to the database-specific portion of <filename>.odbc.ini</filename>
</procedure> so that text fields will not be shown as <literal>**BLOB**</literal>.
</para>
<procedure> </step>
<title>Testing ApplixWare ODBC Connections</title> </procedure>
<step performance="required"> <procedure>
<para> <title>Testing ApplixWare ODBC Connections</title>
Bring up <application>Applix Data</application>
</Para> <step performance="required">
</step> <para>
Bring up <application>Applix Data</application>
<step performance="required"> </para>
<para> </step>
Select the <productname>Postgres</productname> database of interest.
</Para> <step performance="required">
<para>
<substeps> Select the <productname>Postgres</productname> database of interest.
</para>
<step performance="required">
<para> <substeps>
Select <command>Query->Choose Server</command>.
</Para> <step performance="required">
</step> <para>
<step performance="required"> Select <command>Query->Choose Server</command>.
<para> </para>
Select <acronym>ODBC</acronym>, and click <command>Browse</command>. </step>
The database you configured in <filename>.odbc.ini</filename> <step performance="required">
should be shown. Make sure that the <option>Host: field</option> <para>
is empty (if it is not, axnet will try to contact axnet on another machine Select <acronym>ODBC</acronym>, and click <command>Browse</command>.
to look for the database). The database you configured in <filename>.odbc.ini</filename>
</Para> should be shown. Make sure that the <option>Host: field</option>
</step> is empty (if it is not, axnet will try to contact axnet on another machine
<step performance="required"> to look for the database).
<para> </para>
Select the database in the box that was launched by <command>Browse</command>, </step>
then click <command>OK</command>. <step performance="required">
</Para> <para>
</step> Select the database in the box that was launched by <command>Browse</command>,
<step performance="required"> then click <command>OK</command>.
<para> </para>
Enter username and password in the login identification dialog, </step>
and click <command>OK</command>. <step performance="required">
</Para> <para>
</step> Enter username and password in the login identification dialog,
</substeps> and click <command>OK</command>.
</para>
<para> </step>
You should see <quote>Starting elfodbc server</quote> </substeps>
in the lower left corner of the
data window. If you get an error dialog box, see the debugging section <para>
below. You should see <quote>Starting elfodbc server</quote>
</Para> in the lower left corner of the
</step> data window. If you get an error dialog box, see the debugging section
<step performance="required"> below.
<para> </para>
The 'Ready' message will appear in the lower left corner of the data </step>
window. This indicates that you can now enter queries. <step performance="required">
</Para> <para>
</step> The 'Ready' message will appear in the lower left corner of the data
<step performance="required"> window. This indicates that you can now enter queries.
<para> </para>
Select a table from Query->Choose tables, and then select Query->Query </step>
to access the database. The first 50 or so rows from the table should <step performance="required">
appear. <para>
</Para> Select a table from Query->Choose tables, and then select Query->Query
</step> to access the database. The first 50 or so rows from the table should
</procedure> appear.
</sect2> </para>
</step>
<sect2> </procedure>
<title>Common Problems</title> </sect2>
<para> <sect2>
The following messages can appear while trying to make an <title>Common Problems</title>
<acronym>ODBC</acronym> connection through
<productname>Applix Data</productname>: <para>
The following messages can appear while trying to make an
<variablelist> <acronym>ODBC</acronym> connection through
<varlistentry> <productname>Applix Data</productname>:
<term>
Cannot launch gateway on server <variablelist>
</term> <varlistentry>
<listitem> <term>
<para> Cannot launch gateway on server
<literal>elfodbc</literal> can't find <filename>libodbc.so</filename>. </term>
Check your <filename>axnet.cnf</filename>. <listitem>
</Para> <para>
</listitem> <literal>elfodbc</literal> can't find <filename>libodbc.so</filename>.
</varlistentry> Check your <filename>axnet.cnf</filename>.
</para>
<varlistentry> </listitem>
<term> </varlistentry>
Error from ODBC Gateway:
IM003::[iODBC][Driver Manager]Specified driver could not be loaded <varlistentry>
</term> <term>
<listitem> Error from ODBC Gateway:
<para> IM003::[iODBC][Driver Manager]Specified driver could not be loaded
<filename>libodbc.so</filename> cannot find the driver listed in </term>
<filename>.odbc.ini</filename>. Verify the settings. <listitem>
</Para> <para>
</listitem> <filename>libodbc.so</filename> cannot find the driver listed in
</varlistentry> <filename>.odbc.ini</filename>. Verify the settings.
</para>
<varlistentry> </listitem>
<term> </varlistentry>
Server: Broken Pipe
</term> <varlistentry>
<term>
<listitem> Server: Broken Pipe
<para> </term>
<listitem>
<para>
The driver process has terminated due to some other The driver process has terminated due to some other
problem. You might not have an up-to-date version problem. You might not have an up-to-date version
of the <productname>Postgres</productname> of the <productname>Postgres</productname>
<acronym>ODBC</acronym> package. <acronym>ODBC</acronym> package.
</Para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
setuid to 256: failed to launch gateway setuid to 256: failed to launch gateway
</term> </term>
<listitem> <listitem>
<para> <para>
The September release of ApplixWare v4.4.1 (the first release with official The September release of ApplixWare v4.4.1 (the first release with official
<acronym>ODBC</acronym> support under Linux) shows problems when usernames <acronym>ODBC</acronym> support under Linux) shows problems when usernames
exceed eight (8) characters in length. exceed eight (8) characters in length.
Problem description ontributed by Problem description ontributed by
<ulink url="mailto:scampbell@lear.com">Steve Campbell</ulink>. <ulink url="mailto:scampbell@lear.com">Steve Campbell</ulink>.
</Para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
</para> </para>
<para> <para>
<note> <note>
<title>Author</title> <title>Author</title>
<para> <para>
Contributed by Contributed by
<ulink url="mailto:scampbell@lear.com">Steve Campbell</ulink> on <ulink url="mailto:scampbell@lear.com">Steve Campbell</ulink> on
1998-10-20. 1998-10-20.
</para> </para>
</note> </note>
The <application>axnet</application> program's security system The <application>axnet</application> program's security system
seems a little suspect. <application>axnet</application> does things seems a little suspect. <application>axnet</application> does things
on behalf of the user and on a true on behalf of the user and on a true
multiple user system it really should be run with root security multiple user system it really should be run with root security
(so it can read/write in each user's directory). (so it can read/write in each user's directory).
I would hesitate to recommend this, however, since we have no idea what I would hesitate to recommend this, however, since we have no idea what
security holes this creates. security holes this creates.
</para> </para>
</sect2> </sect2>
<sect2> <sect2>
<title>Debugging ApplixWare ODBC Connections</title> <title>Debugging ApplixWare ODBC Connections</title>
<para> <para>
One good tool for debugging connection problems uses the Unix system One good tool for debugging connection problems uses the Unix system
utility <application>strace</application>. utility <application>strace</application>.
</para> </para>
<procedure> <procedure>
<title>Debugging with strace</title> <title>Debugging with strace</title>
<step performance="required"> <step performance="required">
<para> <para>
Start applixware. Start applixware.
</para> </para>
</step> </step>
<step performance="required"> <step performance="required">
<para> <para>
Start an <application>strace</application> on Start an <application>strace</application> on
the axnet process. For example, if the axnet process. For example, if
<programlisting> <programlisting>
ps -aucx | grep ax ps -aucx | grep ax
</programlisting> </programlisting>
shows shows
<programlisting> <programlisting>
cary 10432 0.0 2.6 1740 392 ? S Oct 9 0:00 axnet cary 10432 0.0 2.6 1740 392 ? S Oct 9 0:00 axnet
cary 27883 0.9 31.0 12692 4596 ? S 10:24 0:04 axmain cary 27883 0.9 31.0 12692 4596 ? S 10:24 0:04 axmain
</programlisting> </programlisting>
</para> </para>
<para> <para>
Then run Then run
<programlisting> <programlisting>
strace -f -s 1024 -p 10432 strace -f -s 1024 -p 10432
</programlisting> </programlisting>
</para> </para>
</step> </step>
<step performance="required"> <step performance="required">
<para> <para>
Check the strace output. Check the strace output.
</para> </para>
<note> <note>
<title>Note from Cary</title> <title>Note from Cary</title>
<para> <para>
Many of the error messages from <productname>ApplixWare</productname> Many of the error messages from <productname>ApplixWare</productname>
go to <filename>stderr</filename>, go to <filename>stderr</filename>,
but I'm not sure where <filename>stderr</filename> but I'm not sure where <filename>stderr</filename>
is sent, so <application>strace</application> is the way to find out. is sent, so <application>strace</application> is the way to find out.
</para> </para>
</note> </note>
</step> </step>
</procedure> </procedure>
<para> <para>
For example, after getting For example, after getting
a <quote>Cannot launch gateway on server</quote>, a <quote>Cannot launch gateway on server</quote>,
I ran strace on axnet and got I ran strace on axnet and got
<programlisting> <programlisting>
[pid 27947] open("/usr/lib/libodbc.so", O_RDONLY) = -1 ENOENT [pid 27947] open("/usr/lib/libodbc.so", O_RDONLY) = -1 ENOENT
(No such file or directory) (No such file or directory)
[pid 27947] open("/lib/libodbc.so", O_RDONLY) = -1 ENOENT [pid 27947] open("/lib/libodbc.so", O_RDONLY) = -1 ENOENT
(No such file or directory) (No such file or directory)
[pid 27947] write(2, "/usr2/applix/axdata/elfodbc: [pid 27947] write(2, "/usr2/applix/axdata/elfodbc:
can't load library 'libodbc.so'\n", 61) = -1 EIO (I/O error) can't load library 'libodbc.so'\n", 61) = -1 EIO (I/O error)
</programlisting> </programlisting>
So what is happening is that applix elfodbc is searching for libodbc.so, but it So what is happening is that applix elfodbc is searching for libodbc.so, but it
can't find it. That is why axnet.cnf needed to be changed. can't find it. That is why axnet.cnf needed to be changed.
</para> </para>
</sect2> </sect2>
<sect2> <sect2>
<title>Running the ApplixWare Demo</title> <title>Running the ApplixWare Demo</title>
<para> <para>
In order to go through the In order to go through the
<citetitle>ApplixWare Data Tutorial</citetitle>, you need to create <citetitle>ApplixWare Data Tutorial</citetitle>, you need to create
the sample tables that the Tutorial refers to. The ELF Macro used to the sample tables that the Tutorial refers to. The ELF Macro used to
create the tables tries to use a NULL condition create the tables tries to use a NULL condition
on many of the database columns, on many of the database columns,
and <productname>Postgres</productname> does not currently allow this option. and <productname>Postgres</productname> does not currently allow this option.
</para> </para>
<para> <para>
To get around this problem, you can do the following: To get around this problem, you can do the following:
</para> </para>
<procedure> <procedure>
<title>Modifying the ApplixWare Demo</title> <title>Modifying the ApplixWare Demo</title>
<step performance="required"> <step performance="required">
<para> <para>
Copy <filename>/opt/applix/axdata/eng/Demos/sqldemo.am</filename> Copy <filename>/opt/applix/axdata/eng/Demos/sqldemo.am</filename>
to a local directory. to a local directory.
</para> </para>
</step> </step>
<step performance="required"> <step performance="required">
<para> <para>
Edit this local copy of <filename>sqldemo.am</filename>: Edit this local copy of <filename>sqldemo.am</filename>:
</para> </para>
<substeps> <substeps>
<step performance="required"> <step performance="required">
<para> <para>
Search for 'null_clause = "NULL" Search for 'null_clause = "NULL"
</para> </para>
</step> </step>
<step performance="required"> <step performance="required">
<para> <para>
Change this to null_clause = "" Change this to null_clause = ""
</para> </para>
</step> </step>
</substeps> </substeps>
</step> </step>
<step performance="required"> <step performance="required">
<para> <para>
Start <application>Applix Macro Editor</application>. Start <application>Applix Macro Editor</application>.
</para> </para>
</step> </step>
<step performance="required"> <step performance="required">
<para> <para>
Open the sqldemo.am file from the <application>Macro Editor</application>. Open the sqldemo.am file from the <application>Macro Editor</application>.
</para> </para>
</step> </step>
<step performance="required"> <step performance="required">
<para> <para>
Select <command>File->Compile and Save</command>. Select <command>File->Compile and Save</command>.
</para> </para>
</step> </step>
<step performance="required"> <step performance="required">
<para> <para>
Exit <application>Macro Editor</application>. Exit <application>Macro Editor</application>.
</para> </para>
</step> </step>
<step performance="required"> <step performance="required">
<para> <para>
Start <application>Applix Data</application>. Start <application>Applix Data</application>.
</para> </para>
</step> </step>
<step performance="required"> <step performance="required">
<para> <para>
Select <command>*->Run Macro</command> Select <command>*->Run Macro</command>
</para> </para>
</step> </step>
<step performance="required"> <step performance="required">
<para> <para>
Enter the value <quote>sqldemo</quote>, then click <command>OK</command>. Enter the value <quote>sqldemo</quote>, then click <command>OK</command>.
</para> </para>
<para> <para>
You should see the progress in the status line of the data window You should see the progress in the status line of the data window
(in the lower left corner). (in the lower left corner).
</para> </para>
</step> </step>
<step performance="required"> <step performance="required">
<para> <para>
You should now be able to access the demo tables. You should now be able to access the demo tables.
</para> </para>
</step> </step>
</procedure> </procedure>
</sect2> </sect2>
<sect2> <sect2>
<title>Useful Macros</title> <title>Useful Macros</title>
<para> <para>
You can add information about your You can add information about your
database login and password to the standard Applix startup database login and password to the standard Applix startup
macro file. This is an example macro file. This is an example
<filename>~/axhome/macros/login.am</filename> file: <filename>~/axhome/macros/login.am</filename> file:
<programlisting> <programlisting>
macro login macro login
set_set_system_var@("sql_username@","tgl") set_set_system_var@("sql_username@","tgl")
set_system_var@("sql_passwd@","no$way") set_system_var@("sql_passwd@","no$way")
endmacro endmacro
</programlisting> </programlisting>
<caution> <caution>
<para> <para>
You should be careful about the file protections on any file containing You should be careful about the file protections on any file containing
username and password information. username and password information.
</para> </para>
</caution> </caution>
</para> </para>
</sect2> </sect2>
<sect2> <sect2>
<title>Supported Platforms</title> <title>Supported Platforms</title>
<para> <para>
<productname>psqlODBC</productname> has been built and tested <productname>psqlODBC</productname> has been built and tested
on <productname>Linux</productname>. There have been reports of success on <productname>Linux</productname>. There have been reports of success
with FreeBSD and with Solaris. There are no known restrictions with FreeBSD and with Solaris. There are no known restrictions
on the basic code for other platforms which already support on the basic code for other platforms which already support
<productname>Postgres</productname>. <productname>Postgres</productname>.
</para> </para>
</sect2> </sect2>
</sect1> </sect1>
</Chapter> </chapter>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode:sgml
sgml-omittag:t sgml-omittag:t
sgml-shorttag:t sgml-shorttag:t
sgml-minimize-attributes:nil sgml-minimize-attributes:nil
...@@ -1088,7 +1096,7 @@ sgml-indent-data:t ...@@ -1088,7 +1096,7 @@ sgml-indent-data:t
sgml-parent-document:nil sgml-parent-document:nil
sgml-default-dtd-file:"./reference.ced" sgml-default-dtd-file:"./reference.ced"
sgml-exposed-tags:nil sgml-exposed-tags:nil
sgml-local-catalogs:"/usr/lib/sgml/CATALOG" sgml-local-catalogs:("/usr/lib/sgml/CATALOG")
sgml-local-ecat-files:nil sgml-local-ecat-files:nil
End: End:
--> -->
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/abort.sgml,v 1.6 2000/03/26 18:32:27 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/abort.sgml,v 1.7 2000/03/27 17:14:42 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -129,7 +129,7 @@ ABORT WORK; ...@@ -129,7 +129,7 @@ ABORT WORK;
SQL92 SQL92
</title> </title>
<para> <para>
This command is a <productname>PostgreSQL</productname> extension present This command is a <productname>Postgres</productname> extension present
for historical reasons. <command>ROLLBACK</command> is the <acronym>SQL92</acronym> for historical reasons. <command>ROLLBACK</command> is the <acronym>SQL92</acronym>
equivalent command. equivalent command.
</para> </para>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.10 2000/01/29 16:58:27 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.11 2000/03/27 17:14:42 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -247,7 +247,7 @@ ALTER TABLE distributors RENAME TO suppliers; ...@@ -247,7 +247,7 @@ ALTER TABLE distributors RENAME TO suppliers;
<para> <para>
SQL92 specifies some additional capabilities for <command>ALTER TABLE</command> SQL92 specifies some additional capabilities for <command>ALTER TABLE</command>
statement which are not yet directly supported by <productname>PostgreSQL</productname>: statement which are not yet directly supported by <productname>Postgres</productname>:
<variablelist> <variablelist>
<varlistentry> <varlistentry>
...@@ -308,8 +308,8 @@ DROP TABLE temp; ...@@ -308,8 +308,8 @@ DROP TABLE temp;
</para> </para>
<para> <para>
The clauses to rename columns and tables are <productname>PostgreSQL</productname> The clauses to rename columns and tables are <productname>Postgres</productname>
extensions. SQL92 does not provide for them. extensions from SQL92.
</para> </para>
</refsect2> </refsect2>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_user.sgml,v 1.10 2000/01/14 22:11:32 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_user.sgml,v 1.11 2000/03/27 17:14:42 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -138,7 +138,7 @@ ERROR: ALTER USER: user "username" does not exist ...@@ -138,7 +138,7 @@ ERROR: ALTER USER: user "username" does not exist
</title> </title>
<para> <para>
<command>ALTER USER</command> is used to change the attributes of a user's <command>ALTER USER</command> is used to change the attributes of a user's
<productname>PostgreSQL</productname> account. Only a database superuser <productname>Postgres</productname> account. Only a database superuser
can change privileges and password expiration with this command. Ordinary can change privileges and password expiration with this command. Ordinary
users can only change their own password. users can only change their own password.
</para> </para>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/begin.sgml,v 1.10 2000/01/29 16:58:27 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/begin.sgml,v 1.11 2000/03/27 17:14:42 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -95,7 +95,7 @@ NOTICE: BEGIN: already a transaction in progress ...@@ -95,7 +95,7 @@ NOTICE: BEGIN: already a transaction in progress
</title> </title>
<para> <para>
By default, <productname>PostgreSQL</productname> executes transactions By default, <productname>Postgres</productname> executes transactions
in <firstterm>unchained mode</firstterm> in <firstterm>unchained mode</firstterm>
(also known as <quote>autocommit</quote> in other database (also known as <quote>autocommit</quote> in other database
systems). systems).
...@@ -116,7 +116,7 @@ NOTICE: BEGIN: already a transaction in progress ...@@ -116,7 +116,7 @@ NOTICE: BEGIN: already a transaction in progress
<para> <para>
The default transaction isolation level in The default transaction isolation level in
<productname>PostgreSQL</productname> <productname>Postgres</productname>
is READ COMMITTED, where queries inside the transaction see only changes is READ COMMITTED, where queries inside the transaction see only changes
committed before query execution. So, you have to use committed before query execution. So, you have to use
<command>SET TRANSACTION ISOLATION LEVEL SERIALIZABLE</command> <command>SET TRANSACTION ISOLATION LEVEL SERIALIZABLE</command>
...@@ -128,7 +128,7 @@ NOTICE: BEGIN: already a transaction in progress ...@@ -128,7 +128,7 @@ NOTICE: BEGIN: already a transaction in progress
</para> </para>
<para> <para>
If the transaction is committed, <productname>PostgreSQL</productname> If the transaction is committed, <productname>Postgres</productname>
will ensure either that all updates are done or else that none of will ensure either that all updates are done or else that none of
them are done. Transactions have the standard <acronym>ACID</acronym> them are done. Transactions have the standard <acronym>ACID</acronym>
(atomic, consistent, isolatable, and durable) property. (atomic, consistent, isolatable, and durable) property.
...@@ -185,7 +185,7 @@ BEGIN WORK; ...@@ -185,7 +185,7 @@ BEGIN WORK;
<para> <para>
<command>BEGIN</command> <command>BEGIN</command>
is a <productname>PostgreSQL</productname> language extension. is a <productname>Postgres</productname> language extension.
There is no explicit <command>BEGIN</command> There is no explicit <command>BEGIN</command>
command in <acronym>SQL92</acronym>; command in <acronym>SQL92</acronym>;
transaction initiation is always implicit and it terminates either transaction initiation is always implicit and it terminates either
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_database.sgml,v 1.12 2000/03/26 18:32:27 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_database.sgml,v 1.13 2000/03/27 17:14:42 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -157,7 +157,7 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable> [ WITH LOCATIO ...@@ -157,7 +157,7 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable> [ WITH LOCATIO
</title> </title>
<para> <para>
<command>CREATE DATABASE</command> creates a new <command>CREATE DATABASE</command> creates a new
<productname>PostgreSQL</productname> database. <productname>Postgres</productname> database.
The creator becomes the owner of the new database. The creator becomes the owner of the new database.
</para> </para>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_function.sgml,v 1.12 2000/03/26 18:32:27 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_function.sgml,v 1.13 2000/03/27 17:14:42 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -20,26 +20,24 @@ Postgres documentation ...@@ -20,26 +20,24 @@ Postgres documentation
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
<refsynopsisdivinfo> <refsynopsisdivinfo>
<date>1999-10-02</date> <date>2000-03-25</date>
</refsynopsisdivinfo> </refsynopsisdivinfo>
<synopsis> <synopsis>
CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceable class="parameter">ftype</replaceable> [, ...] ] ) CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceable class="parameter">ftype</replaceable> [, ...] ] )
RETURNS <replaceable class="parameter">rtype</replaceable> RETURNS <replaceable class="parameter">rtype</replaceable>
[ WITH ( <replaceable class="parameter">attribute</replaceable> [, ...] ) ]
AS <replaceable class="parameter">definition</replaceable> AS <replaceable class="parameter">definition</replaceable>
LANGUAGE '<replaceable class="parameter">langname</replaceable>' LANGUAGE '<replaceable class="parameter">langname</replaceable>'
[ WITH ( <replaceable class="parameter">attribute</replaceable> [, ...] ) ]
CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceable class="parameter">ftype</replaceable> [, ...] ] ) CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceable class="parameter">ftype</replaceable> [, ...] ] )
RETURNS <replaceable class="parameter">rtype</replaceable> RETURNS <replaceable class="parameter">rtype</replaceable>
[ WITH ( <replaceable class="parameter">attribute</replaceable> [, ...] ) ]
AS <replaceable class="parameter">obj_file</replaceable> , <replaceable class="parameter">link_symbol</replaceable> AS <replaceable class="parameter">obj_file</replaceable> , <replaceable class="parameter">link_symbol</replaceable>
LANGUAGE 'C' LANGUAGE 'C'
[ WITH ( <replaceable class="parameter">attribute</replaceable> [, ...] ) ]
</synopsis> </synopsis>
<refsect2 id="R2-SQL-CREATEFUNCTION-1"> <refsect2 id="R2-SQL-CREATEFUNCTION-1">
<refsect2info> <refsect2info>
<date>1998-09-09</date> <date>2000-03-25</date>
</refsect2info> </refsect2info>
<title> <title>
Inputs Inputs
...@@ -143,7 +141,7 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab ...@@ -143,7 +141,7 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
<refsect2 id="R2-SQL-CREATEFUNCTION-2"> <refsect2 id="R2-SQL-CREATEFUNCTION-2">
<refsect2info> <refsect2info>
<date>1998-09-09</date> <date>2000-03-25</date>
</refsect2info> </refsect2info>
<title> <title>
Outputs Outputs
...@@ -168,7 +166,7 @@ CREATE ...@@ -168,7 +166,7 @@ CREATE
<refsect1 id="R1-SQL-CREATEFUNCTION-1"> <refsect1 id="R1-SQL-CREATEFUNCTION-1">
<refsect1info> <refsect1info>
<date>1998-09-09</date> <date>2000-03-25</date>
</refsect1info> </refsect1info>
<title> <title>
Description Description
...@@ -177,28 +175,29 @@ CREATE ...@@ -177,28 +175,29 @@ CREATE
<command>CREATE FUNCTION</command> allows a <command>CREATE FUNCTION</command> allows a
<productname>Postgres</productname> user <productname>Postgres</productname> user
to register a function to register a function
with a database. Subsequently, this user is treated as the with a database. Subsequently, this user is considered the
owner of the function. owner of the function.
</para> </para>
<refsect2 id="R2-SQL-CREATEFUNCTION-3"> <refsect2 id="R2-SQL-CREATEFUNCTION-3">
<refsect2info> <refsect2info>
<date>1998-09-09</date> <date>2000-03-25</date>
</refsect2info> </refsect2info>
<title> <title>
Notes Notes
</title> </title>
<para> <para>
Refer to the chapter in Refer to the chapter in the
the <citetitle>PostgreSQL Programmer's Guide</citetitle> <citetitle>PostgreSQL Programmer's Guide</citetitle>
on extending on the topic of extending
<productname>Postgres</productname> via functions <productname>Postgres</productname> via functions
for further information on writing external functions. for further information on writing external functions.
</para> </para>
<para> <para>
Use <command>DROP FUNCTION</command> Use <command>DROP FUNCTION</command>
to drop user-defined functions. to remove user-defined functions.
</para> </para>
<para> <para>
...@@ -207,7 +206,17 @@ CREATE ...@@ -207,7 +206,17 @@ CREATE
so long as they have distinct argument types. This facility must so long as they have distinct argument types. This facility must
be used with caution for <literal>internal</literal> and be used with caution for <literal>internal</literal> and
C-language functions, however. C-language functions, however.
</para> </para>
<para>
The full <acronym>SQL92</acronym> type syntax is allowed for
input arguments and return value. However, some details of the
type specification (e.g. the precision field for
<type>numeric</type> types) are the responsibility of the
underlying function implementation and are silently swallowed
(e.g. not recognized or
enforced) by the <command>CREATE FUNCTION</command> command.
</para>
<para> <para>
Two <literal>internal</literal> Two <literal>internal</literal>
...@@ -242,18 +251,18 @@ CREATE ...@@ -242,18 +251,18 @@ CREATE
<para> <para>
To create a simple SQL function: To create a simple SQL function:
<programlisting> <programlisting>
CREATE FUNCTION one() RETURNS int4 CREATE FUNCTION one() RETURNS int4
AS 'SELECT 1 AS RESULT' AS 'SELECT 1 AS RESULT'
LANGUAGE 'sql'; LANGUAGE 'sql';
SELECT one() AS answer; SELECT one() AS answer;
<computeroutput> <computeroutput>
answer answer
-------- --------
1 1
</computeroutput> </computeroutput>
</programlisting> </programlisting>
</para> </para>
<para> <para>
...@@ -317,7 +326,7 @@ Point * complex_to_point (Complex *z) ...@@ -317,7 +326,7 @@ Point * complex_to_point (Complex *z)
<refsect2 id="R2-SQL-CREATEFUNCTION-4"> <refsect2 id="R2-SQL-CREATEFUNCTION-4">
<refsect2info> <refsect2info>
<date>1998-04-15</date> <date>2000-03-25</date>
</refsect2info> </refsect2info>
<title> <title>
SQL92 SQL92
...@@ -331,7 +340,7 @@ Point * complex_to_point (Complex *z) ...@@ -331,7 +340,7 @@ Point * complex_to_point (Complex *z)
<refsect2 id="R2-SQL-CREATEFUNCTION-5"> <refsect2 id="R2-SQL-CREATEFUNCTION-5">
<refsect2info> <refsect2info>
<date>1998-09-09</date> <date>2000-03-25</date>
</refsect2info> </refsect2info>
<title> <title>
SQL/PSM SQL/PSM
...@@ -364,7 +373,7 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ...@@ -364,7 +373,7 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode:sgml
sgml-omittag:nil sgml-omittag:nil
sgml-shorttag:t sgml-shorttag:t
sgml-minimize-attributes:nil sgml-minimize-attributes:nil
...@@ -374,7 +383,7 @@ sgml-indent-data:t ...@@ -374,7 +383,7 @@ sgml-indent-data:t
sgml-parent-document:nil sgml-parent-document:nil
sgml-default-dtd-file:"../reference.ced" sgml-default-dtd-file:"../reference.ced"
sgml-exposed-tags:nil sgml-exposed-tags:nil
sgml-local-catalogs:"/usr/lib/sgml/catalog" sgml-local-catalogs:("/usr/lib/sgml/catalog")
sgml-local-ecat-files:nil sgml-local-ecat-files:nil
End: End:
--> -->
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_group.sgml,v 1.1 2000/01/14 22:11:32 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_group.sgml,v 1.2 2000/03/27 17:14:42 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -53,7 +53,7 @@ CREATE GROUP <replaceable class="PARAMETER">name</replaceable> ...@@ -53,7 +53,7 @@ CREATE GROUP <replaceable class="PARAMETER">name</replaceable>
<listitem> <listitem>
<para> <para>
The <literal>SYSID</literal> clause can be used to choose The <literal>SYSID</literal> clause can be used to choose
the <productname>PostgreSQL</productname> group id of the new the <productname>Postgres</productname> group id of the new
group. It is not necessary to do so, however. group. It is not necessary to do so, however.
</para> </para>
<para> <para>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_operator.sgml,v 1.12 2000/03/18 18:03:12 tgl Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_operator.sgml,v 1.13 2000/03/27 17:14:42 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -20,7 +20,7 @@ Postgres documentation ...@@ -20,7 +20,7 @@ Postgres documentation
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
<refsynopsisdivinfo> <refsynopsisdivinfo>
<date>1999-07-20</date> <date>2000-03-25</date>
</refsynopsisdivinfo> </refsynopsisdivinfo>
<synopsis> <synopsis>
CREATE OPERATOR <replaceable>name</replaceable> ( PROCEDURE = <replaceable class="parameter">func_name</replaceable> CREATE OPERATOR <replaceable>name</replaceable> ( PROCEDURE = <replaceable class="parameter">func_name</replaceable>
...@@ -32,7 +32,7 @@ CREATE OPERATOR <replaceable>name</replaceable> ( PROCEDURE = <replaceable class ...@@ -32,7 +32,7 @@ CREATE OPERATOR <replaceable>name</replaceable> ( PROCEDURE = <replaceable class
<refsect2 id="R2-SQL-CREATEOPERATOR-1"> <refsect2 id="R2-SQL-CREATEOPERATOR-1">
<refsect2info> <refsect2info>
<date>1999-04-14</date> <date>2000-03-25</date>
</refsect2info> </refsect2info>
<title> <title>
Inputs Inputs
...@@ -138,7 +138,7 @@ CREATE OPERATOR <replaceable>name</replaceable> ( PROCEDURE = <replaceable class ...@@ -138,7 +138,7 @@ CREATE OPERATOR <replaceable>name</replaceable> ( PROCEDURE = <replaceable class
<refsect2 id="R2-SQL-CREATEOPERATOR-2"> <refsect2 id="R2-SQL-CREATEOPERATOR-2">
<refsect2info> <refsect2info>
<date>1999-04-14</date> <date>2000-03-25</date>
</refsect2info> </refsect2info>
<title> <title>
Outputs Outputs
...@@ -162,7 +162,7 @@ CREATE ...@@ -162,7 +162,7 @@ CREATE
<refsect1 id="R1-SQL-CREATEOPERATOR-1"> <refsect1 id="R1-SQL-CREATEOPERATOR-1">
<refsect1info> <refsect1info>
<date>1999-04-14</date> <date>2000-03-25</date>
</refsect1info> </refsect1info>
<title> <title>
Description Description
...@@ -248,13 +248,13 @@ CREATE ...@@ -248,13 +248,13 @@ CREATE
Hence, the query optimizer could freely convert: Hence, the query optimizer could freely convert:
<programlisting> <programlisting>
"0,0,1,1"::box &gt;&gt;&gt; MYBOXES.description box '((0,0),(1,1))' &gt;&gt;&gt; MYBOXES.description
</programlisting> </programlisting>
to to
<programlisting> <programlisting>
MYBOXES.description &lt;&lt;&lt; "0,0,1,1"::box MYBOXES.description &lt;&lt;&lt; box '((0,0),(1,1))'
</programlisting> </programlisting>
</para> </para>
<para> <para>
...@@ -269,11 +269,11 @@ MYBOXES.description &lt;&lt;&lt; "0,0,1,1"::box ...@@ -269,11 +269,11 @@ MYBOXES.description &lt;&lt;&lt; "0,0,1,1"::box
equal, !==. equal, !==.
The negator link allows the query optimizer to simplify The negator link allows the query optimizer to simplify
<programlisting> <programlisting>
NOT MYBOXES.description === "0,0,1,1"::box NOT MYBOXES.description === box '((0,0),(1,1))'
</programlisting> </programlisting>
to to
<programlisting> <programlisting>
MYBOXES.description !== "0,0,1,1"::box MYBOXES.description !== box '((0,0),(1,1))'
</programlisting> </programlisting>
</para> </para>
<para> <para>
...@@ -331,7 +331,7 @@ MYBOXES.description !== "0,0,1,1"::box ...@@ -331,7 +331,7 @@ MYBOXES.description !== "0,0,1,1"::box
The RESTRICT and JOIN options assist the query optimizer in estimating The RESTRICT and JOIN options assist the query optimizer in estimating
result sizes. If a clause of the form: result sizes. If a clause of the form:
<programlisting> <programlisting>
MYBOXES.description &lt;&lt;&lt; "0,0,1,1"::box MYBOXES.description &lt;&lt;&lt; box '((0,0),(1,1))'
</programlisting> </programlisting>
is present in the qualification, is present in the qualification,
then <productname>Postgres</productname> may have to then <productname>Postgres</productname> may have to
...@@ -342,7 +342,7 @@ MYBOXES.description &lt;&lt;&lt; "0,0,1,1"::box ...@@ -342,7 +342,7 @@ MYBOXES.description &lt;&lt;&lt; "0,0,1,1"::box
<command>CREATE FUNCTION</command>) which accepts arguments of the correct <command>CREATE FUNCTION</command>) which accepts arguments of the correct
data types and returns a floating point number. The data types and returns a floating point number. The
query optimizer simply calls this function, passing the query optimizer simply calls this function, passing the
parameter "0,0,1,1" and multiplies the result by the relation parameter <literal>((0,0),(1,1))</literal> and multiplies the result by the relation
size to get the expected number of instances. size to get the expected number of instances.
</para> </para>
<para> <para>
...@@ -356,11 +356,11 @@ MYBOXES.description &lt;&lt;&lt; "0,0,1,1"::box ...@@ -356,11 +356,11 @@ MYBOXES.description &lt;&lt;&lt; "0,0,1,1"::box
<para> <para>
The difference between the function The difference between the function
<programlisting> <programlisting>
my_procedure_1 (MYBOXES.description, "0,0,1,1"::box) my_procedure_1 (MYBOXES.description, box '((0,0),(1,1))')
</programlisting> </programlisting>
and the operator and the operator
<programlisting> <programlisting>
MYBOXES.description === "0,0,1,1"::box MYBOXES.description === box '((0,0),(1,1))'
</programlisting> </programlisting>
is that <productname>Postgres</productname> is that <productname>Postgres</productname>
attempts to optimize operators and can attempts to optimize operators and can
...@@ -373,7 +373,7 @@ MYBOXES.description === "0,0,1,1"::box ...@@ -373,7 +373,7 @@ MYBOXES.description === "0,0,1,1"::box
<refsect2 id="R2-SQL-CREATEOPERATOR-3"> <refsect2 id="R2-SQL-CREATEOPERATOR-3">
<refsect2info> <refsect2info>
<date>1999-04-14</date> <date>2000-03-25</date>
</refsect2info> </refsect2info>
<title> <title>
Notes Notes
...@@ -418,7 +418,7 @@ CREATE OPERATOR === ( ...@@ -418,7 +418,7 @@ CREATE OPERATOR === (
<refsect2 id="R2-SQL-CREATEOPERATOR-4"> <refsect2 id="R2-SQL-CREATEOPERATOR-4">
<refsect2info> <refsect2info>
<date>1999-04-14</date> <date>2000-03-25</date>
</refsect2info> </refsect2info>
<title> <title>
SQL92 SQL92
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_table.sgml,v 1.17 1999/07/22 15:09:08 thomas Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_table.sgml,v 1.18 2000/03/27 17:14:42 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -20,7 +20,7 @@ Postgres documentation ...@@ -20,7 +20,7 @@ Postgres documentation
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
<refsynopsisdivinfo> <refsynopsisdivinfo>
<date>1999-07-20</date> <date>2000-03-25</date>
</refsynopsisdivinfo> </refsynopsisdivinfo>
<synopsis> <synopsis>
CREATE [ TEMPORARY | TEMP ] TABLE <replaceable class="PARAMETER">table</replaceable> ( CREATE [ TEMPORARY | TEMP ] TABLE <replaceable class="PARAMETER">table</replaceable> (
...@@ -35,9 +35,6 @@ CREATE [ TEMPORARY | TEMP ] TABLE <replaceable class="PARAMETER">table</replacea ...@@ -35,9 +35,6 @@ CREATE [ TEMPORARY | TEMP ] TABLE <replaceable class="PARAMETER">table</replacea
</synopsis> </synopsis>
<refsect2 id="R2-SQL-CREATETABLE-1"> <refsect2 id="R2-SQL-CREATETABLE-1">
<refsect2info>
<date>1998-09-11</date>
</refsect2info>
<title> <title>
Inputs Inputs
</title> </title>
...@@ -158,9 +155,6 @@ CREATE [ TEMPORARY | TEMP ] TABLE <replaceable class="PARAMETER">table</replacea ...@@ -158,9 +155,6 @@ CREATE [ TEMPORARY | TEMP ] TABLE <replaceable class="PARAMETER">table</replacea
</refsect2> </refsect2>
<refsect2 id="R2-SQL-CREATETABLE-2"> <refsect2 id="R2-SQL-CREATETABLE-2">
<refsect2info>
<date>1998-09-11</date>
</refsect2info>
<title> <title>
Outputs Outputs
</title> </title>
...@@ -212,9 +206,6 @@ ERROR: DEFAULT: type mismatched ...@@ -212,9 +206,6 @@ ERROR: DEFAULT: type mismatched
</refsynopsisdiv> </refsynopsisdiv>
<refsect1 id="R1-SQL-CREATETABLE-1"> <refsect1 id="R1-SQL-CREATETABLE-1">
<refsect1info>
<date>1998-09-11</date>
</refsect1info>
<title> <title>
Description Description
</title> </title>
...@@ -272,9 +263,6 @@ ERROR: DEFAULT: type mismatched ...@@ -272,9 +263,6 @@ ERROR: DEFAULT: type mismatched
</refsect1> </refsect1>
<refsect1 id="R1-SQL-DEFAULTCLAUSE-1"> <refsect1 id="R1-SQL-DEFAULTCLAUSE-1">
<refsect1info>
<date>1998-09-11</date>
</refsect1info>
<title id="R1-SQL-DEFAULTCLAUSE-1-TITLE"> <title id="R1-SQL-DEFAULTCLAUSE-1-TITLE">
DEFAULT Clause DEFAULT Clause
</title> </title>
...@@ -284,9 +272,6 @@ DEFAULT <replaceable class="PARAMETER">value</replaceable> ...@@ -284,9 +272,6 @@ DEFAULT <replaceable class="PARAMETER">value</replaceable>
</synopsis> </synopsis>
</para> </para>
<refsect2 id="R2-SQL-DEFAULTCLAUSE-1"> <refsect2 id="R2-SQL-DEFAULTCLAUSE-1">
<refsect2info>
<date>1998-09-11</date>
</refsect2info>
<title> <title>
Inputs Inputs
</title> </title>
...@@ -323,9 +308,6 @@ DEFAULT <replaceable class="PARAMETER">value</replaceable> ...@@ -323,9 +308,6 @@ DEFAULT <replaceable class="PARAMETER">value</replaceable>
</refsect2> </refsect2>
<refsect2 id="R2-SQL-DEFAULTCLAUSE-2"> <refsect2 id="R2-SQL-DEFAULTCLAUSE-2">
<refsect2info>
<date>1998-09-11</date>
</refsect2info>
<title> <title>
Outputs Outputs
</title> </title>
...@@ -335,9 +317,6 @@ DEFAULT <replaceable class="PARAMETER">value</replaceable> ...@@ -335,9 +317,6 @@ DEFAULT <replaceable class="PARAMETER">value</replaceable>
</refsect2> </refsect2>
<refsect2 id="R2-SQL-DEFAULTCLAUSE-3"> <refsect2 id="R2-SQL-DEFAULTCLAUSE-3">
<refsect2info>
<date>1998-09-11</date>
</refsect2info>
<title> <title>
Description Description
</title> </title>
...@@ -415,7 +394,7 @@ DEFAULT <replaceable class="PARAMETER">value</replaceable> ...@@ -415,7 +394,7 @@ DEFAULT <replaceable class="PARAMETER">value</replaceable>
</para> </para>
<para> <para>
In the current release (v6.5), <productname>Postgres</productname> In the current release (v7.0), <productname>Postgres</productname>
evaluates all default expressions at the time the table is defined. evaluates all default expressions at the time the table is defined.
Hence, functions which are "non-cacheable" such as Hence, functions which are "non-cacheable" such as
<function>CURRENT_TIMESTAMP</function> may not produce the desired <function>CURRENT_TIMESTAMP</function> may not produce the desired
...@@ -431,9 +410,6 @@ DEFAULT <replaceable class="PARAMETER">value</replaceable> ...@@ -431,9 +410,6 @@ DEFAULT <replaceable class="PARAMETER">value</replaceable>
</para> </para>
</refsect2> </refsect2>
<refsect2 id="R2-SQL-DEFAULTCLAUSE-4"> <refsect2 id="R2-SQL-DEFAULTCLAUSE-4">
<refsect2info>
<date>1998-09-11</date>
</refsect2info>
<title> <title>
Usage Usage
</title> </title>
...@@ -467,9 +443,6 @@ CREATE TABLE distributors ( ...@@ -467,9 +443,6 @@ CREATE TABLE distributors (
</refsect1> </refsect1>
<refsect1 id="R1-SQL-COLUMNCONSTRAINT-1"> <refsect1 id="R1-SQL-COLUMNCONSTRAINT-1">
<refsect1info>
<date>1998-09-11</date>
</refsect1info>
<title id="R1-SQL-COLUMNCONSTRAINT-1-TITLE"> <title id="R1-SQL-COLUMNCONSTRAINT-1-TITLE">
Column CONSTRAINT Clause Column CONSTRAINT Clause
</title> </title>
...@@ -482,9 +455,6 @@ CREATE TABLE distributors ( ...@@ -482,9 +455,6 @@ CREATE TABLE distributors (
</para> </para>
<refsect2 id="R2-SQL-COLUMNCONSTRAINT-1"> <refsect2 id="R2-SQL-COLUMNCONSTRAINT-1">
<refsect2info>
<date>1998-09-11</date>
</refsect2info>
<title> <title>
Inputs Inputs
</title> </title>
...@@ -561,9 +531,6 @@ CREATE TABLE distributors ( ...@@ -561,9 +531,6 @@ CREATE TABLE distributors (
</refsect2> </refsect2>
<refsect2 id="R2-SQL-COLUMNCONSTRAINT-2"> <refsect2 id="R2-SQL-COLUMNCONSTRAINT-2">
<refsect2info>
<date>1998-09-11</date>
</refsect2info>
<title> <title>
Description Description
</title> </title>
...@@ -601,21 +568,19 @@ CREATE TABLE distributors ( ...@@ -601,21 +568,19 @@ CREATE TABLE distributors (
<member>UNIQUE</member> <member>UNIQUE</member>
<member>CHECK</member> <member>CHECK</member>
<member>NOT NULL</member> <member>NOT NULL</member>
</simplelist></para> </simplelist>
</para>
<note> <note>
<para> <para>
<productname>Postgres</productname> does not yet <productname>Postgres</productname> now
(at release 6.5) support (new for v7.0) supports
REFERENCES integrity constraints. The parser REFERENCES integrity constraints.
accepts the REFERENCES syntax but ignores the clause.
</para> </para>
</note> </note>
</refsect2> </refsect2>
<refsect2 id="R2-SQL-NOTNULL-1"> <refsect2 id="R2-SQL-NOTNULL-1">
<refsect2info>
<date>1998-09-11</date>
</refsect2info>
<title> <title>
NOT NULL Constraint NOT NULL Constraint
</title> </title>
...@@ -630,9 +595,6 @@ CREATE TABLE distributors ( ...@@ -630,9 +595,6 @@ CREATE TABLE distributors (
</para> </para>
<refsect3 id="R3-SQL-NOTNULL-1"> <refsect3 id="R3-SQL-NOTNULL-1">
<refsect3info>
<date>1998-09-11</date>
</refsect3info>
<title> <title>
Outputs Outputs
</title> </title>
...@@ -663,9 +625,6 @@ ERROR: ExecAppend: Fail to add null value in not null attribute "<replaceable c ...@@ -663,9 +625,6 @@ ERROR: ExecAppend: Fail to add null value in not null attribute "<replaceable c
</refsect3> </refsect3>
<refsect3 id="R3-SQL-NOTNULL-2"> <refsect3 id="R3-SQL-NOTNULL-2">
<refsect3info>
<date>1998-09-11</date>
</refsect3info>
<title> <title>
Description Description
</title> </title>
...@@ -674,9 +633,6 @@ ERROR: ExecAppend: Fail to add null value in not null attribute "<replaceable c ...@@ -674,9 +633,6 @@ ERROR: ExecAppend: Fail to add null value in not null attribute "<replaceable c
</refsect3> </refsect3>
<refsect3 id="R3-SQL-NOTNULL-3"> <refsect3 id="R3-SQL-NOTNULL-3">
<refsect3info>
<date>1998-09-11</date>
</refsect3info>
<title> <title>
Usage Usage
</title> </title>
...@@ -697,9 +653,6 @@ CREATE TABLE distributors ( ...@@ -697,9 +653,6 @@ CREATE TABLE distributors (
</refsect2> </refsect2>
<refsect2 id="R2-SQL-UNIQUECLAUSE-1"> <refsect2 id="R2-SQL-UNIQUECLAUSE-1">
<refsect2info>
<date>1998-09-11</date>
</refsect2info>
<title> <title>
UNIQUE Constraint UNIQUE Constraint
</title> </title>
...@@ -813,9 +766,6 @@ CREATE TABLE distributors ( ...@@ -813,9 +766,6 @@ CREATE TABLE distributors (
</refsect2> </refsect2>
<refsect2 id="R2-SQL-CHECK-1"> <refsect2 id="R2-SQL-CHECK-1">
<refsect2info>
<date>1998-09-11</date>
</refsect2info>
<title> <title>
The CHECK Constraint The CHECK Constraint
</title> </title>
...@@ -849,9 +799,6 @@ CREATE TABLE distributors ( ...@@ -849,9 +799,6 @@ CREATE TABLE distributors (
</refsect3> </refsect3>
<refsect3 id="R3-SQL-CHECK-2"> <refsect3 id="R3-SQL-CHECK-2">
<refsect3info>
<date>1998-09-11</date>
</refsect3info>
<title> <title>
Outputs Outputs
</title> </title>
...@@ -900,9 +847,6 @@ ERROR: ExecAppend: rejected due to CHECK constraint "<replaceable class="parame ...@@ -900,9 +847,6 @@ ERROR: ExecAppend: rejected due to CHECK constraint "<replaceable class="parame
</refsect2> </refsect2>
<refsect2 id="R2-SQL-PRIMARYKEY-1"> <refsect2 id="R2-SQL-PRIMARYKEY-1">
<refsect2info>
<date>1998-09-11</date>
</refsect2info>
<title> <title>
PRIMARY KEY Constraint PRIMARY KEY Constraint
</title> </title>
...@@ -958,9 +902,6 @@ ERROR: Cannot insert a duplicate key into a unique index. ...@@ -958,9 +902,6 @@ ERROR: Cannot insert a duplicate key into a unique index.
</refsect3> </refsect3>
<refsect3 id="R3-SQL-PRIMARYKEY-3"> <refsect3 id="R3-SQL-PRIMARYKEY-3">
<refsect3info>
<date>1998-09-11</date>
</refsect3info>
<title> <title>
Notes Notes
</title> </title>
...@@ -982,9 +923,6 @@ ERROR: Cannot insert a duplicate key into a unique index. ...@@ -982,9 +923,6 @@ ERROR: Cannot insert a duplicate key into a unique index.
</refsect1> </refsect1>
<refsect1 id="R1-SQL-TABLECONSTRAINT-1"> <refsect1 id="R1-SQL-TABLECONSTRAINT-1">
<refsect1info>
<date>1998-09-11</date>
</refsect1info>
<title> <title>
Table CONSTRAINT Clause Table CONSTRAINT Clause
</title> </title>
...@@ -995,9 +933,6 @@ ERROR: Cannot insert a duplicate key into a unique index. ...@@ -995,9 +933,6 @@ ERROR: Cannot insert a duplicate key into a unique index.
</synopsis> </synopsis>
</para> </para>
<refsect2 id="R2-SQL-TABLECONSTRAINT-1"> <refsect2 id="R2-SQL-TABLECONSTRAINT-1">
<refsect2info>
<date>1998-09-11</date>
</refsect2info>
<title> <title>
Inputs Inputs
</title> </title>
...@@ -1035,9 +970,6 @@ ERROR: Cannot insert a duplicate key into a unique index. ...@@ -1035,9 +970,6 @@ ERROR: Cannot insert a duplicate key into a unique index.
</refsect2> </refsect2>
<refsect2 id="R2-SQL-TABLECONSTRAINT-2"> <refsect2 id="R2-SQL-TABLECONSTRAINT-2">
<refsect2info>
<date>1998-09-11</date>
</refsect2info>
<title> <title>
Outputs Outputs
</title> </title>
...@@ -1049,9 +981,6 @@ ERROR: Cannot insert a duplicate key into a unique index. ...@@ -1049,9 +981,6 @@ ERROR: Cannot insert a duplicate key into a unique index.
</refsect2> </refsect2>
<refsect2 id="R2-SQL-TABLECONSTRAINT-3"> <refsect2 id="R2-SQL-TABLECONSTRAINT-3">
<refsect2info>
<date>1998-09-11</date>
</refsect2info>
<title> <title>
Description Description
</title> </title>
...@@ -1067,22 +996,17 @@ ERROR: Cannot insert a duplicate key into a unique index. ...@@ -1067,22 +996,17 @@ ERROR: Cannot insert a duplicate key into a unique index.
<member>FOREIGN KEY</member> <member>FOREIGN KEY</member>
</simplelist> </simplelist>
</para> </para>
<note> <note>
<para> <para>
<productname>Postgres</productname> does not yet <productname>Postgres</productname> now
(as of version 6.5) support FOREIGN KEY supports FOREIGN KEY
integrity constraints. The parser understands the FOREIGN KEY syntax, integrity constraints (new for release 7.0).
but only prints a notice and otherwise ignores the clause.
Foreign keys may be partially emulated by triggers (See the CREATE TRIGGER
statement).
</para> </para>
</note> </note>
</refsect2> </refsect2>
<refsect2 id="R2-SQL-UNIQUECLAUSE-4"> <refsect2 id="R2-SQL-UNIQUECLAUSE-4">
<refsect2info>
<date>1998-09-11</date>
</refsect2info>
<title> <title>
UNIQUE Constraint UNIQUE Constraint
</title> </title>
...@@ -1174,9 +1098,6 @@ CREATE TABLE distributors ( ...@@ -1174,9 +1098,6 @@ CREATE TABLE distributors (
</refsect2> </refsect2>
<refsect2 id="R2-SQL-PRIMARYKEY-4"> <refsect2 id="R2-SQL-PRIMARYKEY-4">
<refsect2info>
<date>1998-09-11</date>
</refsect2info>
<title> <title>
PRIMARY KEY Constraint PRIMARY KEY Constraint
</title> </title>
...@@ -1375,9 +1296,6 @@ CREATE TABLE distributors ( ...@@ -1375,9 +1296,6 @@ CREATE TABLE distributors (
</para> </para>
<refsect2 id="R2-SQL-CREATETABLE-3"> <refsect2 id="R2-SQL-CREATETABLE-3">
<refsect2info>
<date>1998-09-11</date>
</refsect2info>
<title> <title>
Notes Notes
</title> </title>
...@@ -1395,9 +1313,6 @@ CREATE TABLE distributors ( ...@@ -1395,9 +1313,6 @@ CREATE TABLE distributors (
</title> </title>
<refsect2 id="R2-SQL-CREATETABLE-4"> <refsect2 id="R2-SQL-CREATETABLE-4">
<refsect2info>
<date>1998-09-11</date>
</refsect2info>
<title> <title>
SQL92 SQL92
</title> </title>
...@@ -1436,9 +1351,6 @@ CREATE TEMPORARY TABLE actors ( ...@@ -1436,9 +1351,6 @@ CREATE TEMPORARY TABLE actors (
</para> </para>
<refsect3 id="R3-SQL-UNIQUECLAUSE-1"> <refsect3 id="R3-SQL-UNIQUECLAUSE-1">
<refsect3info>
<date>1998-09-11</date>
</refsect3info>
<title> <title>
UNIQUE clause UNIQUE clause
</title> </title>
...@@ -1467,9 +1379,6 @@ CREATE TEMPORARY TABLE actors ( ...@@ -1467,9 +1379,6 @@ CREATE TEMPORARY TABLE actors (
</refsect3> </refsect3>
<refsect3 id="R3-SQL-NULL-1"> <refsect3 id="R3-SQL-NULL-1">
<refsect3info>
<date>1998-12-24</date>
</refsect3info>
<title> <title>
NULL clause NULL clause
</title> </title>
...@@ -1485,9 +1394,6 @@ CREATE TEMPORARY TABLE actors ( ...@@ -1485,9 +1394,6 @@ CREATE TEMPORARY TABLE actors (
</refsect3> </refsect3>
<refsect3 id="R3-SQL-NOTNULL-4"> <refsect3 id="R3-SQL-NOTNULL-4">
<refsect3info>
<date>1998-09-11</date>
</refsect3info>
<title> <title>
NOT NULL clause NOT NULL clause
</title> </title>
...@@ -1510,9 +1416,6 @@ the column. Not our problem... ...@@ -1510,9 +1416,6 @@ the column. Not our problem...
- Thomas 1998-08-16 - Thomas 1998-08-16
<REFSECT3 ID="R3-SQL-DEFAULTCLAUSE-1"> <REFSECT3 ID="R3-SQL-DEFAULTCLAUSE-1">
<REFSECT3INFO>
<DATE>1998-09-11</DATE>
</REFSECT3INFO>
<TITLE> <TITLE>
DEFAULT clause DEFAULT clause
</TITLE> </TITLE>
...@@ -1530,9 +1433,6 @@ the column. Not our problem... ...@@ -1530,9 +1433,6 @@ the column. Not our problem...
--> -->
<refsect3 id="R3-SQL-CONSTRAINT-3"> <refsect3 id="R3-SQL-CONSTRAINT-3">
<refsect3info>
<date>1998-09-11</date>
</refsect3info>
<title> <title>
CONSTRAINT clause CONSTRAINT clause
</title> </title>
...@@ -1647,9 +1547,6 @@ CREATE ASSERTION name CHECK ( condition ) ...@@ -1647,9 +1547,6 @@ CREATE ASSERTION name CHECK ( condition )
<refsect3 id="R3-SQL-CHECK-4"> <refsect3 id="R3-SQL-CHECK-4">
<refsect3info>
<date>1998-09-11</date>
</refsect3info>
<title> <title>
CHECK clause CHECK clause
</title> </title>
...@@ -1709,9 +1606,6 @@ ALTER DOMAIN cities ...@@ -1709,9 +1606,6 @@ ALTER DOMAIN cities
</refsect3> </refsect3>
<refsect3 id="R3-SQL-PRIMARYKEY-1"> <refsect3 id="R3-SQL-PRIMARYKEY-1">
<refsect3info>
<date>1998-09-11</date>
</refsect3info>
<title> <title>
PRIMARY KEY clause PRIMARY KEY clause
</title> </title>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_trigger.sgml,v 1.8 1999/07/22 15:09:08 thomas Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_trigger.sgml,v 1.9 2000/03/27 17:14:42 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -20,7 +20,7 @@ Postgres documentation ...@@ -20,7 +20,7 @@ Postgres documentation
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
<refsynopsisdivinfo> <refsynopsisdivinfo>
<date>1999-07-20</date> <date>2000-03-25</date>
</refsynopsisdivinfo> </refsynopsisdivinfo>
<synopsis> <synopsis>
CREATE TRIGGER <replaceable class="PARAMETER">name</replaceable> { BEFORE | AFTER } { <replaceable class="PARAMETER">event</replaceable> [OR ...] } CREATE TRIGGER <replaceable class="PARAMETER">name</replaceable> { BEFORE | AFTER } { <replaceable class="PARAMETER">event</replaceable> [OR ...] }
...@@ -152,7 +152,7 @@ CREATE ...@@ -152,7 +152,7 @@ CREATE
Only the relation owner may create a trigger on this relation. Only the relation owner may create a trigger on this relation.
</para> </para>
<para> <para>
As of the current release (v6.4), STATEMENT triggers are not implemented. As of the current release (v7.0), STATEMENT triggers are not implemented.
</para> </para>
<para> <para>
Refer to <command>DROP TRIGGER</command> for information on how to Refer to <command>DROP TRIGGER</command> for information on how to
...@@ -217,11 +217,6 @@ CREATE TABLE distributors ( ...@@ -217,11 +217,6 @@ CREATE TABLE distributors (
); );
</programlisting> </programlisting>
</para> </para>
<para>
However, foreign keys are not yet implemented (as of version 6.5) in
<productname>Postgres</productname>.
</para>
</refsect2> </refsect2>
</refsect1> </refsect1>
</refentry> </refentry>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_type.sgml,v 1.11 1999/08/06 13:50:30 thomas Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_type.sgml,v 1.12 2000/03/27 17:14:42 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -289,8 +289,8 @@ CREATE ...@@ -289,8 +289,8 @@ CREATE
A "regular" Postgres type can only be 8192 bytes in A "regular" Postgres type can only be 8192 bytes in
length. If you need a larger type you must create a Large length. If you need a larger type you must create a Large
Object type. The interface for these types is discussed Object type. The interface for these types is discussed
at length in at length in the
<citetitle>The PostgreSQL Programmer's Guide</citetitle>. <citetitle>PostgreSQL Programmer's Guide</citetitle>.
The length of all large object types is always VARIABLE. The length of all large object types is always VARIABLE.
</para> </para>
</refsect2> </refsect2>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_user.sgml,v 1.13 2000/01/14 22:11:32 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_user.sgml,v 1.14 2000/03/27 17:14:42 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -56,7 +56,7 @@ CREATE USER <replaceable class="PARAMETER">username</replaceable> ...@@ -56,7 +56,7 @@ CREATE USER <replaceable class="PARAMETER">username</replaceable>
<listitem> <listitem>
<para> <para>
The <literal>SYSID</literal> clause can be used to choose The <literal>SYSID</literal> clause can be used to choose
the <productname>PostgreSQL</productname> user id of the user the <productname>Postgres</productname> user id of the user
that is being created. It is not at all necessary that those that is being created. It is not at all necessary that those
match the <acronym>UNIX</acronym> user ids, but some people match the <acronym>UNIX</acronym> user ids, but some people
choose to keep the numbers the same. choose to keep the numbers the same.
...@@ -164,7 +164,7 @@ CREATE USER <replaceable class="PARAMETER">username</replaceable> ...@@ -164,7 +164,7 @@ CREATE USER <replaceable class="PARAMETER">username</replaceable>
</title> </title>
<para> <para>
CREATE USER will add a new user to an instance of CREATE USER will add a new user to an instance of
<productname>PostgreSQL</productname>. Refer to the adminstrator's <productname>Postgres</productname>. Refer to the adminstrator's
guide for information about managing users and authentication. guide for information about managing users and authentication.
You must be a database superuser to use this command. You must be a database superuser to use this command.
</para> </para>
...@@ -173,7 +173,7 @@ CREATE USER <replaceable class="PARAMETER">username</replaceable> ...@@ -173,7 +173,7 @@ CREATE USER <replaceable class="PARAMETER">username</replaceable>
to change a user's password and privileges, and <xref linkend="SQL-DROPUSER" to change a user's password and privileges, and <xref linkend="SQL-DROPUSER"
endterm="SQL-DROPUSER-title"> to remove a user. endterm="SQL-DROPUSER-title"> to remove a user.
Use <command>ALTER GROUP</command> to add or remove the user from other groups. Use <command>ALTER GROUP</command> to add or remove the user from other groups.
<productname>PostgreSQL</productname> <productname>Postgres</productname>
comes with a script <xref linkend="APP-CREATEUSER" comes with a script <xref linkend="APP-CREATEUSER"
endterm="APP-CREATEUSER-title"> endterm="APP-CREATEUSER-title">
which has the same functionality as this command (in fact, it calls this command) which has the same functionality as this command (in fact, it calls this command)
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_view.sgml,v 1.8 2000/03/26 18:32:27 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_view.sgml,v 1.9 2000/03/27 17:14:42 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -20,15 +20,15 @@ Postgres documentation ...@@ -20,15 +20,15 @@ Postgres documentation
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
<refsynopsisdivinfo> <refsynopsisdivinfo>
<date>1999-07-20</date> <date>2000-03-25</date>
</refsynopsisdivinfo> </refsynopsisdivinfo>
<synopsis> <synopsis>
CREATE VIEW <replaceable class="PARAMETER">view</replaceable> AS SELECT <replaceable class="PARAMETER">query</replaceable> CREATE VIEW <replaceable class="PARAMETER">view</replaceable> AS SELECT <replaceable class="PARAMETER">query</replaceable>
</synopsis> </synopsis>
<refsect2 id="R2-SQL-CREATEVIEW-1"> <refsect2 id="R2-SQL-CREATEVIEW-1">
<refsect2info> <refsect2info>
<date>1998-09-21</date> <date>2000-03-25</date>
</refsect2info> </refsect2info>
<title> <title>
Inputs Inputs
...@@ -62,7 +62,7 @@ CREATE VIEW <replaceable class="PARAMETER">view</replaceable> AS SELECT <replace ...@@ -62,7 +62,7 @@ CREATE VIEW <replaceable class="PARAMETER">view</replaceable> AS SELECT <replace
<refsect2 id="R2-SQL-CREATEVIEW-2"> <refsect2 id="R2-SQL-CREATEVIEW-2">
<refsect2info> <refsect2info>
<date>1998-09-21</date> <date>2000-03-25</date>
</refsect2info> </refsect2info>
<title> <title>
Outputs Outputs
...@@ -97,13 +97,15 @@ NOTICE create: attribute named "<replaceable class="parameter">column</replaceab ...@@ -97,13 +97,15 @@ NOTICE create: attribute named "<replaceable class="parameter">column</replaceab
<para> <para>
The view will be created having a column with an unknown type The view will be created having a column with an unknown type
if you do not specify it. For example, the following command gives if you do not specify it. For example, the following command gives
an error: a warning:
<programlisting> <programlisting>
CREATE VIEW vista AS SELECT 'Hello World' CREATE VIEW vista AS SELECT 'Hello World'
</programlisting> </programlisting>
whereas this command does not: whereas this command does not:
<programlisting> <programlisting>
CREATE VIEW vista AS SELECT 'Hello World'::text CREATE VIEW vista AS SELECT text 'Hello World'
</programlisting> </programlisting>
</para> </para>
</listitem> </listitem>
...@@ -115,7 +117,7 @@ CREATE VIEW vista AS SELECT 'Hello World'::text ...@@ -115,7 +117,7 @@ CREATE VIEW vista AS SELECT 'Hello World'::text
<refsect1 id="R1-SQL-CREATEVIEW-1"> <refsect1 id="R1-SQL-CREATEVIEW-1">
<refsect1info> <refsect1info>
<date>1998-09-21</date> <date>2000-03-25</date>
</refsect1info> </refsect1info>
<title> <title>
Description Description
...@@ -129,7 +131,7 @@ CREATE VIEW vista AS SELECT 'Hello World'::text ...@@ -129,7 +131,7 @@ CREATE VIEW vista AS SELECT 'Hello World'::text
<refsect2 id="R2-SQL-CREATEVIEW-3"> <refsect2 id="R2-SQL-CREATEVIEW-3">
<refsect2info> <refsect2info>
<date>1998-09-21</date> <date>2000-03-25</date>
</refsect2info> </refsect2info>
<title> <title>
Notes Notes
...@@ -176,7 +178,7 @@ SELECT * FROM kinds; ...@@ -176,7 +178,7 @@ SELECT * FROM kinds;
<refsect2 id="R2-SQL-CREATEVIEW-5"> <refsect2 id="R2-SQL-CREATEVIEW-5">
<refsect2info> <refsect2info>
<date>1998-09-21</date> <date>2000-03-25</date>
</refsect2info> </refsect2info>
<title> <title>
SQL92 SQL92
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/createdb.sgml,v 1.9 2000/02/10 20:08:55 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/createdb.sgml,v 1.10 2000/03/27 17:14:42 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -15,7 +15,7 @@ Postgres documentation ...@@ -15,7 +15,7 @@ Postgres documentation
<application>createdb</application> <application>createdb</application>
</refname> </refname>
<refpurpose> <refpurpose>
Create a new <productname>PostgreSQL</productname> database Create a new <productname>Postgres</productname> database
</refpurpose> </refpurpose>
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
...@@ -120,7 +120,7 @@ createdb [ <replaceable class="parameter">options</replaceable> ] <replaceable c ...@@ -120,7 +120,7 @@ createdb [ <replaceable class="parameter">options</replaceable> ] <replaceable c
<listitem> <listitem>
<para> <para>
Specifies the name of the database to be created. The name must be Specifies the name of the database to be created. The name must be
unique among all <productname>PostgreSQL</productname> databases in this installation. unique among all <productname>Postgres</productname> databases in this installation.
The default is to create a database with the same name as the The default is to create a database with the same name as the
current system user. current system user.
</para> </para>
...@@ -196,7 +196,7 @@ createdb [ <replaceable class="parameter">options</replaceable> ] <replaceable c ...@@ -196,7 +196,7 @@ createdb [ <replaceable class="parameter">options</replaceable> ] <replaceable c
Description Description
</title> </title>
<para> <para>
<application>createdb</application> creates a new <productname>PostgreSQL</productname> <application>createdb</application> creates a new <productname>Postgres</productname>
database. The user who executes this command becomes the database owner. database. The user who executes this command becomes the database owner.
</para> </para>
...@@ -204,7 +204,7 @@ createdb [ <replaceable class="parameter">options</replaceable> ] <replaceable c ...@@ -204,7 +204,7 @@ createdb [ <replaceable class="parameter">options</replaceable> ] <replaceable c
<application>createdb</application> is a shell script wrapper around the <application>createdb</application> is a shell script wrapper around the
<acronym>SQL</acronym> command <acronym>SQL</acronym> command
<xref linkend="SQL-CREATEDATABASE" endterm="SQL-CREATEDATABASE-title"> via <xref linkend="SQL-CREATEDATABASE" endterm="SQL-CREATEDATABASE-title"> via
the <productname>PostgreSQL</productname> interactive terminal the <productname>Postgres</productname> interactive terminal
<xref linkend="APP-PSQL" endterm="APP-PSQL-title">. Thus, there is nothing <xref linkend="APP-PSQL" endterm="APP-PSQL-title">. Thus, there is nothing
special about creating databases via this or other methods. This means special about creating databases via this or other methods. This means
that the <application>psql</application> must be found by the script and that that the <application>psql</application> must be found by the script and that
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/createlang.sgml,v 1.4 2000/01/19 20:08:22 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/createlang.sgml,v 1.5 2000/03/27 17:14:42 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -15,7 +15,7 @@ Postgres documentation ...@@ -15,7 +15,7 @@ Postgres documentation
<application>createlang</application> <application>createlang</application>
</refname> </refname>
<refpurpose> <refpurpose>
Add a new programming language to a <productname>PostgreSQL</productname> database Add a new programming language to a <productname>Postgres</productname> database
</refpurpose> </refpurpose>
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
...@@ -145,7 +145,7 @@ createlang [ <replaceable class="parameter">connection options</replaceable> ] - ...@@ -145,7 +145,7 @@ createlang [ <replaceable class="parameter">connection options</replaceable> ] -
<para> <para>
<application>createlang</application> is a utility for adding a new <application>createlang</application> is a utility for adding a new
programming language to a <productname>PostgreSQL</productname> database. programming language to a <productname>Postgres</productname> database.
<application>createlang</application> currently accepts two <application>createlang</application> currently accepts two
languages, <literal>plsql</literal> and <literal>pltcl</literal>. languages, <literal>plsql</literal> and <literal>pltcl</literal>.
</para> </para>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/createuser.sgml,v 1.8 2000/01/12 19:36:34 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/createuser.sgml,v 1.9 2000/03/27 17:14:42 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -15,7 +15,7 @@ Postgres documentation ...@@ -15,7 +15,7 @@ Postgres documentation
<application>createuser</application> <application>createuser</application>
</refname> </refname>
<refpurpose> <refpurpose>
Create a new <productname>PostgreSQL</productname> user Create a new <productname>Postgres</productname> user
</refpurpose> </refpurpose>
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
...@@ -139,8 +139,8 @@ createuser [ <replaceable class="parameter">options</replaceable> ] [ <replaceab ...@@ -139,8 +139,8 @@ createuser [ <replaceable class="parameter">options</replaceable> ] [ <replaceab
<term><replaceable class="parameter">username</replaceable></term> <term><replaceable class="parameter">username</replaceable></term>
<listitem> <listitem>
<para> <para>
Specifies the name of the <productname>PostgreSQL</productname> user to be created. Specifies the name of the <productname>Postgres</productname> user to be created.
This name must be unique among all <productname>PostgreSQL</productname> users. This name must be unique among all <productname>Postgres</productname> users.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -203,7 +203,7 @@ createuser [ <replaceable class="parameter">options</replaceable> ] [ <replaceab ...@@ -203,7 +203,7 @@ createuser [ <replaceable class="parameter">options</replaceable> ] [ <replaceab
</title> </title>
<para> <para>
<application>createuser</application> creates a <application>createuser</application> creates a
new <productname>PostgreSQL</productname> user. new <productname>Postgres</productname> user.
Only users with <literal>usesuper</literal> set in Only users with <literal>usesuper</literal> set in
the <literal>pg_shadow</literal> class can create the <literal>pg_shadow</literal> class can create
new <productname>Postgres</productname> users. new <productname>Postgres</productname> users.
...@@ -213,7 +213,7 @@ createuser [ <replaceable class="parameter">options</replaceable> ] [ <replaceab ...@@ -213,7 +213,7 @@ createuser [ <replaceable class="parameter">options</replaceable> ] [ <replaceab
<application>createuser</application> is a shell script wrapper around the <application>createuser</application> is a shell script wrapper around the
<acronym>SQL</acronym> command <acronym>SQL</acronym> command
<xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title"> via <xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title"> via
the <productname>PostgreSQL</productname> interactive terminal the <productname>Postgres</productname> interactive terminal
<xref linkend="APP-PSQL" endterm="APP-PSQL-title">. Thus, there is nothing <xref linkend="APP-PSQL" endterm="APP-PSQL-title">. Thus, there is nothing
special about creating users via this or other methods. This means special about creating users via this or other methods. This means
that the <application>psql</application> must be found by the script and that that the <application>psql</application> must be found by the script and that
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_user.sgml,v 1.10 2000/01/14 22:11:32 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_user.sgml,v 1.11 2000/03/27 17:14:42 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -109,7 +109,7 @@ DROP USER: user "<replaceable class="parameter">name</replaceable>" owns databas ...@@ -109,7 +109,7 @@ DROP USER: user "<replaceable class="parameter">name</replaceable>" owns databas
Use <xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title"> Use <xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title">
to add new users, and <xref linkend="SQL-ALTERUSER" to add new users, and <xref linkend="SQL-ALTERUSER"
endterm="SQL-ALTERUSER-title"> to change a user's properties. endterm="SQL-ALTERUSER-title"> to change a user's properties.
<productname>PostgreSQL</productname> <productname>Postgres</productname>
comes with a script <xref linkend="APP-DROPUSER" comes with a script <xref linkend="APP-DROPUSER"
endterm="APP-DROPUSER-title"> endterm="APP-DROPUSER-title">
which has the same functionality as this command (in fact, it calls this command) which has the same functionality as this command (in fact, it calls this command)
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/dropdb.sgml,v 1.2 1999/12/07 22:41:41 momjian Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/dropdb.sgml,v 1.3 2000/03/27 17:14:43 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -15,7 +15,7 @@ Postgres documentation ...@@ -15,7 +15,7 @@ Postgres documentation
<application>dropdb</application> <application>dropdb</application>
</refname> </refname>
<refpurpose> <refpurpose>
Remove an existing <productname>PostgreSQL</productname> database Remove an existing <productname>Postgres</productname> database
</refpurpose> </refpurpose>
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
...@@ -109,7 +109,7 @@ dropdb [ <replaceable class="parameter">options</replaceable> ] <replaceable cla ...@@ -109,7 +109,7 @@ dropdb [ <replaceable class="parameter">options</replaceable> ] <replaceable cla
<listitem> <listitem>
<para> <para>
Specifies the name of the database to be removed. The database Specifies the name of the database to be removed. The database
must be one of the existing <productname>PostgreSQL</productname> databases must be one of the existing <productname>Postgres</productname> databases
in this installation. in this installation.
</para> </para>
</listitem> </listitem>
...@@ -165,7 +165,7 @@ dropdb [ <replaceable class="parameter">options</replaceable> ] <replaceable cla ...@@ -165,7 +165,7 @@ dropdb [ <replaceable class="parameter">options</replaceable> ] <replaceable cla
</title> </title>
<para> <para>
<application>dropdb</application> destroys an existing <application>dropdb</application> destroys an existing
<productname>PostgreSQL</productname> database. <productname>Postgres</productname> database.
The user who executes this command must be a database The user who executes this command must be a database
superuser or the owner of the database. superuser or the owner of the database.
</para> </para>
...@@ -174,7 +174,7 @@ dropdb [ <replaceable class="parameter">options</replaceable> ] <replaceable cla ...@@ -174,7 +174,7 @@ dropdb [ <replaceable class="parameter">options</replaceable> ] <replaceable cla
<application>dropdb</application> is a shell script wrapper around the <application>dropdb</application> is a shell script wrapper around the
<acronym>SQL</acronym> command <acronym>SQL</acronym> command
<xref linkend="SQL-DROPDATABASE" endterm="SQL-DROPDATABASE-title"> via <xref linkend="SQL-DROPDATABASE" endterm="SQL-DROPDATABASE-title"> via
the <productname>PostgreSQL</productname> interactive terminal the <productname>Postgres</productname> interactive terminal
<xref linkend="APP-PSQL" endterm="APP-PSQL-title">. Thus, there is nothing <xref linkend="APP-PSQL" endterm="APP-PSQL-title">. Thus, there is nothing
special about dropping databases via this or other methods. This means special about dropping databases via this or other methods. This means
that the <application>psql</application> must be found by the script and that that the <application>psql</application> must be found by the script and that
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/droplang.sgml,v 1.2 2000/01/19 20:08:22 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/droplang.sgml,v 1.3 2000/03/27 17:14:43 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -15,7 +15,7 @@ Postgres documentation ...@@ -15,7 +15,7 @@ Postgres documentation
<application>droplang</application> <application>droplang</application>
</refname> </refname>
<refpurpose> <refpurpose>
Remove a programming language from a <productname>PostgreSQL</productname> database Remove a programming language from a <productname>Postgres</productname> database
</refpurpose> </refpurpose>
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
...@@ -146,7 +146,7 @@ droplang [ <replaceable class="parameter">connection options</replaceable> ] --l ...@@ -146,7 +146,7 @@ droplang [ <replaceable class="parameter">connection options</replaceable> ] --l
<para> <para>
<application>droplang</application> is a utility for removing an <application>droplang</application> is a utility for removing an
existing programming language from a existing programming language from a
<productname>PostgreSQL</productname> database. <productname>Postgres</productname> database.
<application>droplang</application> currently accepts two <application>droplang</application> currently accepts two
languages, <literal>plsql</literal> and <literal>pltcl</literal>. languages, <literal>plsql</literal> and <literal>pltcl</literal>.
</para> </para>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/dropuser.sgml,v 1.3 2000/01/12 19:36:34 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/dropuser.sgml,v 1.4 2000/03/27 17:14:43 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -90,7 +90,7 @@ dropuser [ <replaceable class="parameter">options</replaceable> ] [ <replaceable ...@@ -90,7 +90,7 @@ dropuser [ <replaceable class="parameter">options</replaceable> ] [ <replaceable
<term><replaceable class="parameter">username</replaceable></term> <term><replaceable class="parameter">username</replaceable></term>
<listitem> <listitem>
<para> <para>
Specifies the name of the <productname>PostgreSQL</productname> user to be removed. Specifies the name of the <productname>Postgres</productname> user to be removed.
This name must exist in the <productname>Postgres</productname> installation. This name must exist in the <productname>Postgres</productname> installation.
You will be prompted for a name if none is specified on the command line. You will be prompted for a name if none is specified on the command line.
</para> </para>
...@@ -153,18 +153,18 @@ dropuser [ <replaceable class="parameter">options</replaceable> ] [ <replaceable ...@@ -153,18 +153,18 @@ dropuser [ <replaceable class="parameter">options</replaceable> ] [ <replaceable
</title> </title>
<para> <para>
<application>dropuser</application> removes an existing <application>dropuser</application> removes an existing
<productname>PostgreSQL</productname> user <productname>Postgres</productname> user
<emphasis>and</emphasis> the databases which that user owned. <emphasis>and</emphasis> the databases which that user owned.
Only users with <literal>usesuper</literal> set in Only users with <literal>usesuper</literal> set in
the <literal>pg_shadow</literal> class can destroy the <literal>pg_shadow</literal> class can destroy
<productname>PostgreSQL</productname> users. <productname>Postgres</productname> users.
</para> </para>
<para> <para>
<application>dropuser</application> is a shell script wrapper around the <application>dropuser</application> is a shell script wrapper around the
<acronym>SQL</acronym> command <acronym>SQL</acronym> command
<xref linkend="SQL-DROPUSER" endterm="SQL-DROPUSER-title"> via <xref linkend="SQL-DROPUSER" endterm="SQL-DROPUSER-title"> via
the <productname>PostgreSQL</productname> interactive terminal the <productname>Postgres</productname> interactive terminal
<xref linkend="APP-PSQL" endterm="APP-PSQL-title">. Thus, there is nothing <xref linkend="APP-PSQL" endterm="APP-PSQL-title">. Thus, there is nothing
special about removing users via this or other methods. This means special about removing users via this or other methods. This means
that the <application>psql</application> must be found by the script and that that the <application>psql</application> must be found by the script and that
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/end.sgml,v 1.2 2000/01/29 16:58:27 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/end.sgml,v 1.3 2000/03/27 17:14:43 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -94,8 +94,8 @@ NOTICE: COMMIT: no transaction in progress ...@@ -94,8 +94,8 @@ NOTICE: COMMIT: no transaction in progress
</title> </title>
<para> <para>
<command>END</command> is a <productname>PostgreSQL</productname> <command>END</command> is a <productname>Postgres</productname>
synonym for extension, and is a synonym for the SQL92-compatible
<xref linkend="sql-commit-title" endterm="sql-commit-title">. <xref linkend="sql-commit-title" endterm="sql-commit-title">.
</para> </para>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/initdb.sgml,v 1.9 2000/01/20 21:50:54 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/initdb.sgml,v 1.10 2000/03/27 17:14:43 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -15,7 +15,7 @@ Postgres documentation ...@@ -15,7 +15,7 @@ Postgres documentation
<application>initdb</application> <application>initdb</application>
</refname> </refname>
<refpurpose> <refpurpose>
Create a new <productname>PostgreSQL</productname> database installation Create a new <productname>Postgres</productname> database installation
</refpurpose> </refpurpose>
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
...@@ -129,7 +129,7 @@ initdb [ --pgdata|-D <replaceable class="parameter">dbdir</replaceable> ] ...@@ -129,7 +129,7 @@ initdb [ --pgdata|-D <replaceable class="parameter">dbdir</replaceable> ]
database in an existing database system, and don't touch anything else. database in an existing database system, and don't touch anything else.
This is useful when you need to upgrade your <literal>template1</literal> This is useful when you need to upgrade your <literal>template1</literal>
database using <application>initdb</application> database using <application>initdb</application>
from a newer release of <productname>PostgreSQL</productname>, from a newer release of <productname>Postgres</productname>,
or when your <literal>template1</literal> or when your <literal>template1</literal>
database has become corrupted by some system problem. Normally the database has become corrupted by some system problem. Normally the
contents of <literal>template1</literal> contents of <literal>template1</literal>
...@@ -199,7 +199,7 @@ initdb [ --pgdata|-D <replaceable class="parameter">dbdir</replaceable> ] ...@@ -199,7 +199,7 @@ initdb [ --pgdata|-D <replaceable class="parameter">dbdir</replaceable> ]
</title> </title>
<para> <para>
<application>initdb</application> creates a new <application>initdb</application> creates a new
<productname>PostgreSQL</productname> database system. <productname>Postgres</productname> database system.
A database system is a A database system is a
collection of databases that are all administered by the same Unix user collection of databases that are all administered by the same Unix user
and managed by a single postmaster. and managed by a single postmaster.
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/Attic/initlocation.sgml,v 1.6 2000/03/26 18:32:27 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/Attic/initlocation.sgml,v 1.7 2000/03/27 17:14:43 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -15,7 +15,7 @@ Postgres documentation ...@@ -15,7 +15,7 @@ Postgres documentation
<application>initlocation</application> <application>initlocation</application>
</refname> </refname>
<refpurpose> <refpurpose>
Create a secondary <productname>PostgreSQL</productname> database storage area Create a secondary <productname>Postgres</productname> database storage area
</refpurpose> </refpurpose>
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
...@@ -72,7 +72,7 @@ initlocation <replaceable class="parameter">directory</replaceable> ...@@ -72,7 +72,7 @@ initlocation <replaceable class="parameter">directory</replaceable>
</title> </title>
<para> <para>
<application>initlocation</application> <application>initlocation</application>
creates a new <productname>PostgreSQL</productname> secondary database storage area. creates a new <productname>Postgres</productname> secondary database storage area.
See the discussion under <xref linkend="SQL-CREATEDATABASE" endterm="SQL-CREATEDATABASE-title"> See the discussion under <xref linkend="SQL-CREATEDATABASE" endterm="SQL-CREATEDATABASE-title">
about how to manage and use secondary storage areas. If the argument does not contain about how to manage and use secondary storage areas. If the argument does not contain
a slash and is not valid as a path, it is assumed to be an environment variable, a slash and is not valid as a path, it is assumed to be an environment variable,
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/insert.sgml,v 1.6 1999/07/22 15:09:12 thomas Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/insert.sgml,v 1.7 2000/03/27 17:14:43 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -193,8 +193,8 @@ INSERT INTO films SELECT * FROM tmp; ...@@ -193,8 +193,8 @@ INSERT INTO films SELECT * FROM tmp;
</para> </para>
<para> <para>
Insert into arrays (refer to Insert into arrays (refer to the
<citetitle>The PostgreSQL User's Guide</citetitle> for further <citetitle>PostgreSQL User's Guide</citetitle> for further
information about arrays): information about arrays):
<programlisting> <programlisting>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.14 2000/01/24 19:34:13 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.15 2000/03/27 17:14:43 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -99,7 +99,8 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab ...@@ -99,7 +99,8 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
Suppress double quotes around identifiers unless absolutely necessary. Suppress double quotes around identifiers unless absolutely necessary.
This may cause trouble loading this dumped data if there are reserved words This may cause trouble loading this dumped data if there are reserved words
used for identifiers. used for identifiers.
This was the default behavior in pre-v6.4 <application>pg_dump</application>. This was the default behavior for
<application>pg_dump</application> prior to v6.4.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/Attic/pg_upgrade.sgml,v 1.8 1999/09/28 15:59:10 momjian Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/Attic/pg_upgrade.sgml,v 1.9 2000/03/27 17:14:43 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -38,7 +38,7 @@ pg_upgrade [ -f <replaceable class="parameter">filename</replaceable> ] <replace ...@@ -38,7 +38,7 @@ pg_upgrade [ -f <replaceable class="parameter">filename</replaceable> ] <replace
<para> <para>
<application>pg_upgrade</application> <application>pg_upgrade</application>
is a utility for upgrading from a previous is a utility for upgrading from a previous
PostgreSQL release without reloading all the data. Postgres release without reloading all the data.
Not all <productname>Postgres</productname> release transitions can be Not all <productname>Postgres</productname> release transitions can be
handled this way. Check the release notes for details on your installation. handled this way. Check the release notes for details on your installation.
</para> </para>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/Attic/pgadmin-ref.sgml,v 1.5 2000/02/02 16:19:54 thomas Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/Attic/pgadmin-ref.sgml,v 1.6 2000/03/27 17:14:43 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -41,7 +41,7 @@ pgadmin [ <replaceable class="parameter">datasourcename</replaceable> [ <replace ...@@ -41,7 +41,7 @@ pgadmin [ <replaceable class="parameter">datasourcename</replaceable> [ <replace
<term><replaceable class="PARAMETER">datasourcename</replaceable></term> <term><replaceable class="PARAMETER">datasourcename</replaceable></term>
<listitem> <listitem>
<para> <para>
The name of an existing PostgreSQL ODBC System or User Data The name of an existing <productname>Postgres</productname> ODBC System or User Data
Source. Source.
</para> </para>
</listitem> </listitem>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/postgres-ref.sgml,v 1.6 1999/08/06 13:50:31 thomas Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/postgres-ref.sgml,v 1.7 2000/03/27 17:14:43 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -190,7 +190,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ - ...@@ -190,7 +190,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
Dates are accepted by the backend in a wide variety of formats, Dates are accepted by the backend in a wide variety of formats,
and for input dates this switch mostly affects the interpretation and for input dates this switch mostly affects the interpretation
for ambiguous cases. for ambiguous cases.
See <citetitle>The PostgreSQL User's Guide</citetitle> See the <citetitle>PostgreSQL User's Guide</citetitle>
for more information. for more information.
</para> </para>
</listitem> </listitem>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.29 2000/03/21 01:52:12 momjian Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.30 2000/03/27 17:14:43 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -16,7 +16,7 @@ Postgres documentation ...@@ -16,7 +16,7 @@ Postgres documentation
<application>psql</application> <application>psql</application>
</refname> </refname>
<refpurpose> <refpurpose>
<productname>PostgreSQL</productname> interactive terminal <productname>Postgres</productname> interactive terminal
</refpurpose> </refpurpose>
</refnamediv> </refnamediv>
...@@ -36,8 +36,8 @@ Postgres documentation ...@@ -36,8 +36,8 @@ Postgres documentation
<para> <para>
<application>psql</application> is a terminal-based front-end to <application>psql</application> is a terminal-based front-end to
<productname>PostgreSQL</productname>. It enables you to type in queries <productname>Postgres</productname>. It enables you to type in queries
interactively, issue them to <productname>PostgreSQL</productname>, and see interactively, issue them to <productname>Postgres</productname>, and see
the query results. Alternatively, input can be from a file. the query results. Alternatively, input can be from a file.
In addition, it provides a number of meta-commands and In addition, it provides a number of meta-commands and
various shell-like features to facilitate writing scripts and automating a wide various shell-like features to facilitate writing scripts and automating a wide
...@@ -63,7 +63,7 @@ Postgres documentation ...@@ -63,7 +63,7 @@ Postgres documentation
<title>Connecting To A Database</title> <title>Connecting To A Database</title>
<para> <para>
<application>psql</application> is a regular <productname>PostgreSQL</productname> <application>psql</application> is a regular <productname>Postgres</productname>
client application. In order to connect to a database you need to know the client application. In order to connect to a database you need to know the
name of your target database, the hostname and port number of the server name of your target database, the hostname and port number of the server
and what user name you want to connect as. <application>psql</application> can be and what user name you want to connect as. <application>psql</application> can be
...@@ -316,7 +316,7 @@ testdb=> ...@@ -316,7 +316,7 @@ testdb=>
<term><literal>\copyright</literal></term> <term><literal>\copyright</literal></term>
<listitem> <listitem>
<para> <para>
Shows the copyright and distribution terms of <application>PostgreSQL</application>. Shows the copyright and distribution terms of <application>Postgres</application>.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -387,7 +387,7 @@ testdb=> ...@@ -387,7 +387,7 @@ testdb=>
<note> <note>
<para> <para>
<productname>PostgreSQL</productname> stores the object descriptions in the <productname>Postgres</productname> stores the object descriptions in the
pg_description system table. pg_description system table.
</para> </para>
</note> </note>
...@@ -637,7 +637,7 @@ Tue Oct 26 21:40:57 CEST 1999 ...@@ -637,7 +637,7 @@ Tue Oct 26 21:40:57 CEST 1999
<para> <para>
List all the databases in the server as well as their owners. Append a List all the databases in the server as well as their owners. Append a
<quote>+</quote> to the command name to see any descriptions <quote>+</quote> to the command name to see any descriptions
for the databases as well. If your <productname>PostgreSQL</productname> for the databases as well. If your <productname>Postgres</productname>
installation was installation was
compiled with multibyte encoding support, the encoding scheme of each compiled with multibyte encoding support, the encoding scheme of each
database is shown as well. database is shown as well.
...@@ -677,7 +677,7 @@ Tue Oct 26 21:40:57 CEST 1999 ...@@ -677,7 +677,7 @@ Tue Oct 26 21:40:57 CEST 1999
<listitem> <listitem>
<para> <para>
Stores the file into a <productname>PostgreSQL</productname> <quote>large object</quote>. Stores the file into a <productname>Postgres</productname> <quote>large object</quote>.
Optionally, it associates the given comment with the object. Example: Optionally, it associates the given comment with the object. Example:
<programlisting> <programlisting>
foo=> <userinput>\lo_import '/home/peter/pictures/photo.xcf' 'a picture of me'</userinput> foo=> <userinput>\lo_import '/home/peter/pictures/photo.xcf' 'a picture of me'</userinput>
...@@ -709,7 +709,7 @@ lo_import 152801 ...@@ -709,7 +709,7 @@ lo_import 152801
<term><literal>\lo_list</literal></term> <term><literal>\lo_list</literal></term>
<listitem> <listitem>
<para> <para>
Shows a list of all <productname>PostgreSQL</productname> <quote>large Shows a list of all <productname>Postgres</productname> <quote>large
objects</quote> currently stored in the database along with their owners. objects</quote> currently stored in the database along with their owners.
</para> </para>
</listitem> </listitem>
...@@ -1674,7 +1674,7 @@ bar ...@@ -1674,7 +1674,7 @@ bar
<listitem> <listitem>
<para> <para>
When this variable is set and a backslash command queries the database, the query When this variable is set and a backslash command queries the database, the query
is first shown. This way you can study the <productname>PostgreSQL</productname> is first shown. This way you can study the <productname>Postgres</productname>
internals and provide similar functionality in your own programs. If you set the internals and provide similar functionality in your own programs. If you set the
variable to the value <quote>noexec</quote>, the queries are just shown but are variable to the value <quote>noexec</quote>, the queries are just shown but are
not actually sent to the backend and executed. not actually sent to the backend and executed.
...@@ -1770,7 +1770,7 @@ bar ...@@ -1770,7 +1770,7 @@ bar
<term><envar>LO_TRANSACTION</envar></term> <term><envar>LO_TRANSACTION</envar></term>
<listitem> <listitem>
<para> <para>
If you use the <productname>PostgreSQL</productname> large object If you use the <productname>Postgres</productname> large object
interface to specially store data that does not fit into one tuple, interface to specially store data that does not fit into one tuple,
all the operations must be contained in a transaction block. (See the all the operations must be contained in a transaction block. (See the
documentation of the large object interface for more information.) Since documentation of the large object interface for more information.) Since
...@@ -1939,7 +1939,7 @@ testdb=> <userinput>\set content `sed -e "s/'/\\\\\\'/g" < my_file.txt`</userinp ...@@ -1939,7 +1939,7 @@ testdb=> <userinput>\set content `sed -e "s/'/\\\\\\'/g" < my_file.txt`</userinp
case you can escape a colon with a backslash to protect it from interpretation. case you can escape a colon with a backslash to protect it from interpretation.
(The colon syntax for variables is standard <acronym>SQL</acronym> for embedded (The colon syntax for variables is standard <acronym>SQL</acronym> for embedded
query languages, such as <application>ecpg</application>. The colon syntax for query languages, such as <application>ecpg</application>. The colon syntax for
array slices and type casts are <productname>PostgreSQL</productname> extensions, array slices and type casts are <productname>Postgres</productname> extensions,
hence the conflict.) hence the conflict.)
</para> </para>
...@@ -2111,7 +2111,7 @@ $endif ...@@ -2111,7 +2111,7 @@ $endif
<para> <para>
If you have the readline library installed but <application>psql</application> If you have the readline library installed but <application>psql</application>
does not seem to use it, you must make sure that <productname>PostgreSQL</productname>'s does not seem to use it, you must make sure that <productname>Postgres</productname>'s
top-level <filename>configure</filename> script finds it. <filename>configure</filename> top-level <filename>configure</filename> script finds it. <filename>configure</filename>
needs to find both the library <filename>libreadline.a</filename> needs to find both the library <filename>libreadline.a</filename>
(or a shared library equivalent) (or a shared library equivalent)
...@@ -2145,7 +2145,7 @@ $ ./configure --with-includes=/opt/gnu/include --with-libs=/opt/gnu/lib ... ...@@ -2145,7 +2145,7 @@ $ ./configure --with-includes=/opt/gnu/include --with-libs=/opt/gnu/lib ...
<para> <para>
This section only shows a few examples specific to <application>psql</application>. This section only shows a few examples specific to <application>psql</application>.
If you want to learn <acronym>SQL</acronym> or get familiar with If you want to learn <acronym>SQL</acronym> or get familiar with
<productname>PostgreSQL</productname>, you might wish to read the Tutorial that <productname>Postgres</productname>, you might wish to read the Tutorial that
is included in the distribution. is included in the distribution.
</para> </para>
</note> </note>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/select.sgml,v 1.27 2000/03/26 18:32:27 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/select.sgml,v 1.28 2000/03/27 17:14:43 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -419,13 +419,15 @@ SELECT title, date_prod + 1 AS newlen FROM films ORDER BY newlen; ...@@ -419,13 +419,15 @@ SELECT title, date_prod + 1 AS newlen FROM films ORDER BY newlen;
</programlisting></para> </programlisting></para>
<para> <para>
From release 6.4 of PostgreSQL, it is also possible to ORDER BY It is also possible to ORDER BY
arbitrary expressions, including fields that do not appear in the arbitrary expressions (an extension to SQL92),
including fields that do not appear in the
SELECT result list. SELECT result list.
Thus the following statement is now legal: Thus the following statement is legal:
<programlisting> <programlisting>
SELECT name FROM distributors ORDER BY code; SELECT name FROM distributors ORDER BY code;
</programlisting> </programlisting>
Note that if an ORDER BY item is a simple name that matches both Note that if an ORDER BY item is a simple name that matches both
a result column name and an input column name, ORDER BY will interpret a result column name and an input column name, ORDER BY will interpret
it as the result column name. This is the opposite of the choice that it as the result column name. This is the opposite of the choice that
...@@ -581,7 +583,7 @@ SELECT name FROM distributors ORDER BY code; ...@@ -581,7 +583,7 @@ SELECT name FROM distributors ORDER BY code;
</para> </para>
<para> <para>
As of PostgreSQL 7.0, the As of <productname>Postgres</productname> 7.0, the
query optimizer takes LIMIT into account when generating a query plan, query optimizer takes LIMIT into account when generating a query plan,
so you are very likely to get different plans (yielding different row so you are very likely to get different plans (yielding different row
orders) depending on what you give for LIMIT and OFFSET. Thus, using orders) depending on what you give for LIMIT and OFFSET. Thus, using
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.7 1999/12/18 08:34:49 momjian Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.8 2000/03/27 17:14:43 thomas Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -15,7 +15,7 @@ Postgres documentation ...@@ -15,7 +15,7 @@ Postgres documentation
<application>vacuumdb</application> <application>vacuumdb</application>
</refname> </refname>
<refpurpose> <refpurpose>
Clean and analyze a <productname>PostgreSQL</productname> database Clean and analyze a <productname>Postgres</productname> database
</refpurpose> </refpurpose>
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
...@@ -210,7 +210,7 @@ vacuumdb [ <replaceable class="parameter">connection options</replaceable> ] [ - ...@@ -210,7 +210,7 @@ vacuumdb [ <replaceable class="parameter">connection options</replaceable> ] [ -
<para> <para>
<application>vacuumdb</application> is a utility for cleaning a <application>vacuumdb</application> is a utility for cleaning a
<productname>PostgreSQL</productname> database. <productname>Postgres</productname> database.
<application>vacuumdb</application> will also generate internal statistics <application>vacuumdb</application> will also generate internal statistics
used by the <productname>Postgres</productname> query optimizer. used by the <productname>Postgres</productname> query optimizer.
</para> </para>
...@@ -219,7 +219,7 @@ vacuumdb [ <replaceable class="parameter">connection options</replaceable> ] [ - ...@@ -219,7 +219,7 @@ vacuumdb [ <replaceable class="parameter">connection options</replaceable> ] [ -
<application>vacuumdb</application> is a shell script wrapper around the <application>vacuumdb</application> is a shell script wrapper around the
backend command backend command
<xref linkend="SQL-VACUUM" endterm="SQL-VACUUM-title"> via <xref linkend="SQL-VACUUM" endterm="SQL-VACUUM-title"> via
the <productname>PostgreSQL</productname> interactive terminal the <productname>Postgres</productname> interactive terminal
<xref linkend="APP-PSQL" endterm="APP-PSQL-title">. There is no effective <xref linkend="APP-PSQL" endterm="APP-PSQL-title">. There is no effective
difference between vacuuming databases via this or other methods. difference between vacuuming databases via this or other methods.
<application>psql</application> must be found by the script and <application>psql</application> must be found by the script and
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment