diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-08-22 00:01:51 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-08-22 00:01:51 +0000 |
commit | b663f3443ba096a06970214c3e83e79f6e570b84 (patch) | |
tree | 049e26c1b02535c12bee6e60ba89cf1d42a41a72 /contrib/mysql | |
parent | 606c9b9d4fafe9300d039c044edc9727c0ed43c9 (diff) | |
download | postgresql-b663f3443ba096a06970214c3e83e79f6e570b84.tar.gz postgresql-b663f3443ba096a06970214c3e83e79f6e570b84.zip |
Add a bunch of pseudo-types to replace the behavior formerly associated
with OPAQUE, as per recent pghackers discussion. I still want to do some
more work on the 'cstring' pseudo-type, but I'm going to commit the bulk
of the changes now before the tree starts shifting under me ...
Diffstat (limited to 'contrib/mysql')
-rwxr-xr-x | contrib/mysql/my2pg.pl | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/contrib/mysql/my2pg.pl b/contrib/mysql/my2pg.pl index 9ceaca46f55..737fdd57cd2 100755 --- a/contrib/mysql/my2pg.pl +++ b/contrib/mysql/my2pg.pl @@ -36,7 +36,7 @@ # SUCH DAMAGE. # # $My2pg: my2pg.pl,v 1.24 2001/12/06 19:32:20 fonin Exp $ -# $Id: my2pg.pl,v 1.8 2002/04/24 01:42:29 momjian Exp $ +# $Id: my2pg.pl,v 1.9 2002/08/22 00:01:39 tgl Exp $ # TODO: # + Handle SETs @@ -47,6 +47,12 @@ # # $Log: my2pg.pl,v $ +# Revision 1.9 2002/08/22 00:01:39 tgl +# Add a bunch of pseudo-types to replace the behavior formerly associated +# with OPAQUE, as per recent pghackers discussion. I still want to do some +# more work on the 'cstring' pseudo-type, but I'm going to commit the bulk +# of the changes now before the tree starts shifting under me ... +# # Revision 1.8 2002/04/24 01:42:29 momjian # Update to my2pg 1.24. # @@ -193,7 +199,7 @@ $libtypename.='/libtypes.so'; # push header to libtypes.c open(LIBTYPES,">$libtypesource"); print LIBTYPES "/******************************************************"; -print LIBTYPES "\n * My2Pg \$Revision: 1.8 $ \translated dump"; +print LIBTYPES "\n * My2Pg \$Revision: 1.9 $ \translated dump"; print LIBTYPES "\n * User types definitions"; print LIBTYPES "\n ******************************************************/"; print LIBTYPES "\n\n#include <postgres.h>\n"; @@ -308,11 +314,11 @@ int2* $typename"."_in (char *str) { print LIBTYPES "\n * Types for table ".uc($table_name); print LIBTYPES "\n */\n"; - $types.="\nCREATE FUNCTION $typename"."_in (opaque) + $types.="\nCREATE FUNCTION $typename"."_in (cstring) RETURNS $typename AS '$libtypename' LANGUAGE 'c' - WITH (ISCACHABLE);\n"; + WITH (ISSTRICT, ISCACHABLE);\n"; # creating output function my $func_out=" @@ -362,11 +368,11 @@ bool $typename"."_ge(int2* a, int2* b) { return (*a>=*b); }\n"; - $types.="\nCREATE FUNCTION $typename"."_out (opaque) - RETURNS opaque + $types.="\nCREATE FUNCTION $typename"."_out ($typename) + RETURNS cstring AS '$libtypename' LANGUAGE 'c' - WITH (ISCACHABLE);\n"; + WITH (ISSTRICT, ISCACHABLE);\n"; $types.="\nCREATE TYPE $typename ( internallength = 2, @@ -509,7 +515,7 @@ $typesize* $typename"."_in (char *str) { print LIBTYPES "\n * Types for table ".uc($table_name); print LIBTYPES "\n */\n"; - $types.="\nCREATE FUNCTION $typename"."_in (opaque) + $types.="\nCREATE FUNCTION $typename"."_in (cstring) RETURNS $typename AS '$libtypename' LANGUAGE 'c';\n"; @@ -561,8 +567,8 @@ $typesize find_in_set($typesize *a, $typesize *b) { \n"; - $types.="\nCREATE FUNCTION $typename"."_out (opaque) - RETURNS opaque + $types.="\nCREATE FUNCTION $typename"."_out ($typename) + RETURNS cstring AS '$libtypename' LANGUAGE 'c';\n"; @@ -725,7 +731,7 @@ close(LIBTYPES); open(MAKE,">Makefile"); print MAKE "# -# My2Pg \$Revision: 1.8 $ \translated dump +# My2Pg \$Revision: 1.9 $ \translated dump # Makefile # |