-
Notifications
You must be signed in to change notification settings - Fork 177
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
LargeObject support via OID #255
Comments
Thanks for your proposal. How does this work right now with PGJDBC? Ideally, we can reuse |
Here is the API of PGJDBC
Methods of
Argument Methods of
Argument Internally |
I reconsidered my request. |
Thanks for the details. The Large Object API is pretty different from a plain Blob, so it seems using
With this API being a driver-specific API, we can use Netty's The FastPath API is largely deprecated with the background of using parameterized statements. Maybe @davecramer can shed a bit of light here. |
@mp911de what is the question ? |
The actual question is how the replacement should look like. I wasn't able to find an example how to call functionality required for the Large Object API such as |
Interesting looks like the driver still uses FastPath and we don't have any tests for it. Honestly I don't use it but could probably figure it out when I have some time. If they happen to figure it out first that would be awesome |
Thanks, Dave. I marked this ticket as ideal for contribution. It makes sense to add such a feature to our library and we can work out the actual API when we receive a design proposal in form of a PR. |
@fzoli You can call any of those functions without driver's explicit support. Take a look here. |
In JDBC, the OID-based large objects are exposed as |
That was at first also my thought. The large object API allows for several additional methods such as seeking, truncation, length introspection. We need a bit of code to see how this enhancement goes and how the API shapes up. |
So is LO support a necessity? I don't really see many people using this in JDBC ? |
I don't know as I'm not so much involved in how folks use Postgres with large objects. I don't mind making sure our driver is able to work with server-side functions so that this feature could live also outside of the driver. |
Makes sense I guess. I probably wouldn't prioritize it. |
As an actual Postgres user, blob support is crucial. A bytea is not a blob. This is like arguing you don’t need to support char because you don’t see many people using it. |
Speaking from some authority as primary maintainer for the PostgreSQL JDBC driver and major contributor for Postgres and long time user (since 1999) I honestly don't see a lot of use of large objects. Now perhaps I am myopic, I don't know. That said I didn't say don't support it, I said I wouldn't prioritize it. |
If by "large objects" you mean |
Yes I was referring to LargeObjects. |
Feature Request
PostgreSQL supports two type of large object:
R2DBC SPI
supports it withBlob
)SPI
has no such support)Here are the differences:
Stream-style makes it possible to implement a server that supports HTTP range requests.
Is it possible to create an extension for
r2dbc-postgresql
to support LargeObject with OID?Describe the solution you'd like
Blob
from theSPI
can not be used because data manipulation of a LargeObject is not possible with insert/update clauses.io.r2dbc.postgresql.api.PostgresqlConnection
could provide something like:Publisher<ByteBuffer> readLargeObject(long oid)
Publisher<ByteBuffer> readLargeObject(long oid, Range range)
Mono<Long> createLargeObject(Publisher<ByteBuffer>)
Mono<Void> deleteLargeObject(long oid)
The
Range
can be described with two attribute:long
starts from zerolong
maximum number of requested bytes (optional)The text was updated successfully, but these errors were encountered: