diff options
author | Marc G. Fournier <scrappy@hub.org> | 1998-08-30 19:37:51 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 1998-08-30 19:37:51 +0000 |
commit | eec4c7366f04aa258bb8b7fcd2bbc90eda1cc271 (patch) | |
tree | dfb6b70845221063cc0515177b993713595ff69c /contrib/string/string_io.sql.in | |
parent | 3067ac8e77369c1b41195b4d90e2ff2c0b23bc7f (diff) |
From: Massimo Dal Zotto <dz@cs.unitn.it>
Here is a tar file the new directories, which substitute the old ones
in contrib. Please remove the old directories array, datetime, miscutil,
string and userlock before unpacking the tar file in contrib.
Note that as the modules are now installed in lib/modules I install all
my sql code in lib/sql. In my opinion also the other contributors should
follow these rules.
Diffstat (limited to 'contrib/string/string_io.sql.in')
-rw-r--r-- | contrib/string/string_io.sql.in | 87 |
1 files changed, 31 insertions, 56 deletions
diff --git a/contrib/string/string_io.sql.in b/contrib/string/string_io.sql.in index ad1a51607cd..a1fafbc3ae8 100644 --- a/contrib/string/string_io.sql.in +++ b/contrib/string/string_io.sql.in @@ -1,32 +1,18 @@ +-- string_io.sql -- +-- -- SQL code to define the new string I/O functions - --- This is not needed because escapes are handled by the parser -- --- create function c_textin(opaque) --- returns text --- as 'MODULE_PATHNAME' --- language 'c'; +-- Copyright (c) 1998, Massimo Dal Zotto <dz@cs.unitn.it> +-- +-- This file is distributed under the GNU General Public License +-- either version 2, or (at your option) any later version. +-- Define the new output functions. +-- create function c_charout(opaque) returns int4 as 'MODULE_PATHNAME' language 'c'; -create function c_char2out(opaque) returns int4 - as 'MODULE_PATHNAME' - language 'c'; - -create function c_char4out(opaque) returns int4 - as 'MODULE_PATHNAME' - language 'c'; - -create function c_char8out(opaque) returns int4 - as 'MODULE_PATHNAME' - language 'c'; - -create function c_char16out(opaque) returns int4 - as 'MODULE_PATHNAME' - language 'c'; - create function c_textout(opaque) returns int4 as 'MODULE_PATHNAME' language 'c'; @@ -35,70 +21,59 @@ create function c_varcharout(opaque) returns int4 as 'MODULE_PATHNAME' language 'c'; +-- This is not needed because escapes are handled by the parser +-- +-- create function c_textin(opaque) +-- returns text +-- as 'MODULE_PATHNAME' +-- language 'c'; --- Define a function which sets the new output routines for char types +-- Define a function which sets the new output routines for char types. -- -- select c_mode(); -- create function c_mode() returns text - as 'update pg_type set typoutput=''c_charout'' where typname=''char''; - update pg_type set typoutput=''c_char2out'' where typname=''char2''; - update pg_type set typoutput=''c_char4out'' where typname=''char4''; - update pg_type set typoutput=''c_char8out'' where typname=''char8''; - update pg_type set typoutput=''c_char16out'' where typname=''char16''; - update pg_type set typoutput=''c_textout'' where typname=''text''; + as 'update pg_type set typoutput=''c_textout'' where typname=''SET''; + update pg_type set typoutput=''c_varcharout'' where typname=''bpchar''; update pg_type set typoutput=''c_textout'' where typname=''bytea''; + update pg_type set typoutput=''c_charout'' where typname=''char''; + update pg_type set typoutput=''c_textout'' where typname=''text''; update pg_type set typoutput=''c_textout'' where typname=''unknown''; - update pg_type set typoutput=''c_textout'' where typname=''SET''; update pg_type set typoutput=''c_varcharout'' where typname=''varchar''; - update pg_type set typoutput=''c_varcharout'' where typname=''bpchar''; select ''c_mode''::text' language 'sql'; --- Define a function which restores the original routines for char types +-- Define a function which restores the standard routines for char types. -- -- select pg_mode(); -- create function pg_mode() returns text - as 'update pg_type set typoutput=''charout'' where typname=''char''; - update pg_type set typoutput=''char2out'' where typname=''char2''; - update pg_type set typoutput=''char4out'' where typname=''char4''; - update pg_type set typoutput=''char8out'' where typname=''char8''; - update pg_type set typoutput=''char16out'' where typname=''char16''; - update pg_type set typoutput=''textout'' where typname=''text''; + as 'update pg_type set typoutput=''textout'' where typname=''SET''; + update pg_type set typoutput=''varcharout'' where typname=''bpchar''; update pg_type set typoutput=''textout'' where typname=''bytea''; + update pg_type set typoutput=''charout'' where typname=''char''; + update pg_type set typoutput=''textout'' where typname=''text''; update pg_type set typoutput=''textout'' where typname=''unknown''; - update pg_type set typoutput=''textout'' where typname=''SET''; update pg_type set typoutput=''varcharout'' where typname=''varchar''; - update pg_type set typoutput=''varcharout'' where typname=''bpchar''; select ''pg_mode''::text' language 'sql'; - --- Use these if you want do the updates manually +-- Use these to do the changes manually. -- +-- update pg_type set typoutput='textout' where typname='SET'; +-- update pg_type set typoutput='varcharout' where typname='bpchar'; +-- update pg_type set typoutput='textout' where typname='bytea'; -- update pg_type set typoutput='charout' where typname='char'; --- update pg_type set typoutput='char2out' where typname='char2'; --- update pg_type set typoutput='char4out' where typname='char4'; --- update pg_type set typoutput='char8out' where typname='char8'; --- update pg_type set typoutput='char16out' where typname='char16'; -- update pg_type set typoutput='textout' where typname='text'; --- update pg_type set typoutput='textout' where typname='bytea'; -- update pg_type set typoutput='textout' where typname='unknown'; --- update pg_type set typoutput='textout' where typname='SET'; -- update pg_type set typoutput='varcharout' where typname='varchar'; --- update pg_type set typoutput='varcharout' where typname='bpchar'; -- +-- update pg_type set typoutput='c_textout' where typname='SET'; +-- update pg_type set typoutput='c_varcharout' where typname='bpchar'; +-- update pg_type set typoutput='c_textout' where typname='bytea'; -- update pg_type set typoutput='c_charout' where typname='char'; --- update pg_type set typoutput='c_char2out' where typname='char2'; --- update pg_type set typoutput='c_char4out' where typname='char4'; --- update pg_type set typoutput='c_char8out' where typname='char8'; --- update pg_type set typoutput='c_char16out' where typname='char16'; -- update pg_type set typoutput='c_textout' where typname='text'; --- update pg_type set typoutput='c_textout' where typname='bytea'; -- update pg_type set typoutput='c_textout' where typname='unknown'; --- update pg_type set typoutput='c_textout' where typname='SET'; -- update pg_type set typoutput='c_varcharout' where typname='varchar'; --- update pg_type set typoutput='c_varcharout' where typname='bpchar'; -- end of file |