Re: [GENERAL] Find difference between two Text fields

2009-07-24 Thread Aleksander Kmetec
Hi, there might be a better solution out there, but it seemed like an interesting problem so I wrote this function: CREATE OR REPLACE FUNCTION stringdiff(text, text) RETURNS TEXT AS $$ SELECT array_to_string(ARRAY( SELECT CASE WHEN substring($1 FROM n FOR 1) = substring(

[GENERAL] Find difference between two Text fields

2009-07-24 Thread Peter Hunsberger
Can anyone give me a way to find the difference between two text fields on a character by character basis. Essentially, I'd like to logically AND the two together and for any position that has a non-zero result show whatever character is in that position for the second string. The solution can b