Position() Bug ? In PostgreSQL 9.2 - Mailing list pgsql-general

From Amit Langote
Subject Position() Bug ? In PostgreSQL 9.2
Date
Msg-id CA+HiwqGtPyWvrFq0jD6rh7XmGMstCQBrkSrHBBz=Nd9yK-QcwQ@mail.gmail.com
Whole thread Raw
List pgsql-general
This behavior is similar to strstr(3) ('needle in a haystack'
substring locating C function).
which is,

char *strstr(const char *haystack, const char *needle)

which returns haystack (that is main string) if needle (string to be
located) is empty.

Assuming position() tries to do something similar, it returns first
index (which is 1) of the main string (haystack!). Although this does
not answer if it's a bug or not, I tend to think it is deliberate.

--

Amit Langote


pgsql-general by date:

Previous
From: Larry Rosenman
Date:
Subject: Re: LONG delete with LOTS of FK's
Next
From: roshan2013
Date:
Subject: Re: Save postgresql node to catch only DML except delete queries