Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.

old postgres needs 'right' and 'left' string functions - provided here #57

Open
rkboyce opened this issue Mar 16, 2016 · 0 comments
Open

Comments

@rkboyce
Copy link

rkboyce commented Mar 16, 2016

Hi,

I unfortunately am stuck running postgres 8.4 on an old RHEL system and found that Achilles would report the following error:

 statement, ...): execute JDBC update query failed in dbSendUpdate (ERROR: function right(text, integer) does not exist
  Hint: No function matches the given name and argument types. You might need to add explicit type casts.

Something similar occurred for the 'left' function. 'right' and 'left' are a part of postgresql >=9 so I created these functions and Achilles completed its run without error:

CREATE OR REPLACE FUNCTION left(text, integer) RETURNS text AS $$ select substring($1 from 0 for $2 + 1); $$ LANGUAGE SQL IMMUTABLE;

CREATE OR REPLACE FUNCTION right(text, integer) RETURNS text AS $$ select substring($1 from char_length($1) +1 - $2); $$ LANGUAGE SQL IMMUTABLE;

Posting here in case it helps someone later.

-R

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant