Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUBSTRB #172

Closed
zyl6628156 opened this issue Apr 1, 2022 · 3 comments
Closed

SUBSTRB #172

zyl6628156 opened this issue Apr 1, 2022 · 3 comments

Comments

@zyl6628156
Copy link

`
-- oracle

SQL> SELECT SUBSTRB('aaabbbccc',-4,1) FROM DUAL;

S

b

SQL> SELECT SUBSTRB('aaabbbccc',-4,2) FROM DUAL;

SU

bc

SQL> SELECT SUBSTRB('aaabbbccc',-4,3) FROM DUAL;

SUB

bcc

SQL> SELECT SUBSTRB('aaabbbccc',-4,6) FROM DUAL;

SUBS

bccc

-- orafce 3.18

postgres=# SELECT SUBSTRB('aaabbbccc',-4,1) FROM DUAL;
substrb

(1 row)

postgres=# SELECT SUBSTRB('aaabbbccc',-4,2) FROM DUAL;
substrb

(1 row)

postgres=# SELECT SUBSTRB('aaabbbccc',-4,3) FROM DUAL;
substrb

(1 row)

postgres=# SELECT SUBSTRB('aaabbbccc',-4,6) FROM DUAL;
substrb

a
(1 row)

`

@okbob
Copy link
Contributor

okbob commented Apr 1, 2022

The substrb call is forward to call PostgreSQL bytea_substr function now. These functions doesn't support negative arguments. I'll try to fix it.

okbob added a commit that referenced this issue Apr 1, 2022
…ce used buildin bytea substr function. Now it recalculate start argument.

see issue #172
@okbob
Copy link
Contributor

okbob commented Apr 1, 2022

It should be fixed in master branch - see last commit 7206c10

@zyl6628156
Copy link
Author

thanks

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

No branches or pull requests

2 participants