1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Fix logic in insert() function.

This commit is contained in:
Peter Eisentraut
2001-10-13 19:16:32 +00:00
parent 9ca41c0413
commit d1c6983899

View File

@ -1,5 +1,5 @@
-- PostgreSQL catalog extensions for ODBC compatibility -- PostgreSQL catalog extensions for ODBC compatibility
-- $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/odbc.sql,v 1.2 2001/10/09 22:32:33 petere Exp $ -- $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/odbc.sql,v 1.3 2001/10/13 19:16:32 petere Exp $
-- ODBC functions are described here: -- ODBC functions are described here:
-- <http://msdn.microsoft.com/library/en-us/odbc/htm/odbcscalar_functions.asp> -- <http://msdn.microsoft.com/library/en-us/odbc/htm/odbcscalar_functions.asp>
@ -33,7 +33,7 @@ CREATE OR REPLACE FUNCTION concat(text, text) RETURNS text AS '
-- INSERT(string1, start, len, string2) -- INSERT(string1, start, len, string2)
CREATE OR REPLACE FUNCTION insert(text, integer, integer, text) RETURNS text AS ' CREATE OR REPLACE FUNCTION insert(text, integer, integer, text) RETURNS text AS '
SELECT substring($1 from 1 for $2) || $4 || substring($1 from $2 + $3 + 1); SELECT substring($1 from 1 for $2 - 1) || $4 || substring($1 from $2 + $3);
' LANGUAGE SQL; ' LANGUAGE SQL;