我正在将某些东西从Oracle转换为PostgreSQL。在Oracle文件中,有一个功能:
instr(string,substring,starting point,nth location)
Run Code Online (Sandbox Code Playgroud)
或它在我的文件中
instr(string,chr(10),instr(string,substring),1)
Run Code Online (Sandbox Code Playgroud)
在PostgreSQL中不存在,因此我查找了一个等效函数。我发现:
position(substring in string)
Run Code Online (Sandbox Code Playgroud)
但这不允许起始位置和第n个位置参数。
无论如何,要使此功能在给定的点开始?还是在PostgreSQL中可以使用更好的功能来指定起始位置和第n个位置?
这将必须在PostgreSQL 8.2.15上工作,因为那是我们在数据库上运行的版本。