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