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

feat: allow multiple subscripts #411

Open
usamoi opened this issue Mar 5, 2024 · 5 comments
Open

feat: allow multiple subscripts #411

usamoi opened this issue Mar 5, 2024 · 5 comments

Comments

@usamoi
Copy link
Collaborator

usamoi commented Mar 5, 2024

Ref:

x[1:2][3:4] in PostgreSQL represents fetching x[0..1, 2..3]. Since vector is always an 1D array we do not support it for the first.

Later we would like to keep consistency with Python haviours. So there are no reason why we do not support multiple subscripts attached to a vector value now. We should implement it for convenience.

@PeterWrighten
Copy link

Could I work for this issue?

@usamoi
Copy link
Collaborator Author

usamoi commented Mar 12, 2024

Could I work for this issue?

Sure!

@PeterWrighten
Copy link

@usamoi Hi, after I tried implementing this feature, and modifying to get multiple subscripts in transform(), I have no idea in modifying sbs_check_subscripts and something else.

I assume it should be implemented with a loop operation, but seems let state = &mut *(*op).d.sbsref.state; is not a list or implemented any memeber function to head next one.

Is there any tutorial, ref or blog to help understand pgrx::pg_sys::SubscriptRef, pgrx::pg_sys::SubscriptRefState and pgrx::pg_sys::SubscriptRoutines?

@usamoi
Copy link
Collaborator Author

usamoi commented Apr 9, 2024

I think you need to read PostgreSQL source code. You can read the implementation for arrays.

@PeterWrighten
Copy link

I think you need to read PostgreSQL source code. You can read the implementation for arrays.

Thanks!

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

No branches or pull requests

2 participants