From 9de6b9f1408ba590294450bd10f31f8dd5a90693 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sat, 13 Oct 2001 19:16:32 +0000 Subject: [PATCH] Fix logic in insert() function. --- odbc.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/odbc.sql b/odbc.sql index 341f755..7e78740 100644 --- a/odbc.sql +++ b/odbc.sql @@ -1,5 +1,5 @@ -- PostgreSQL catalog extensions for ODBC compatibility --- $Header: /home/heikki/psqlodbc-cvs-copy/psqlodbc/odbc.sql,v 1.2 2001/10/09 22:32:33 petere Exp $ +-- $Header: /home/heikki/psqlodbc-cvs-copy/psqlodbc/odbc.sql,v 1.3 2001/10/13 19:16:32 petere Exp $ -- ODBC functions are described here: -- @@ -33,7 +33,7 @@ CREATE OR REPLACE FUNCTION concat(text, text) RETURNS text AS ' -- INSERT(string1, start, len, string2) 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; -- 2.39.5