cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
29.9k stars 3.78k forks source link

sql: support postgres' API to handle blob storage (incl lo_creat, lo_from_bytea) #26725

Open BramGruneir opened 6 years ago

BramGruneir commented 6 years ago

Blob storage currently isn't supported, see #243.

While running the Hibernate tests suite, the following tests require support for lo_creat function: org.hibernate.userguide.mapping.basic.BlobTest test org.hibernate.userguide.mapping.basic.BlobByteArrayTest test org.hibernate.userguide.mapping.basic.ClobCharArrayTest test org.hibernate.userguide.mapping.basic.ClobStringTest test org.hibernate.userguide.mapping.basic.ClobTest test

Details on the function and how Large Object storage works can be found here: https://www.postgresql.org/docs/9.6/static/lo-interfaces.html https://www.postgresql.org/docs/10/static/lo-funcs.html

If we do add blob support, we should consider using the same interface as Postgres.

Jira issue: CRDB-4988

rafiss commented 5 years ago

It comes up in PGJDBC's tests as well: org.postgresql.test.jdbc4.BlobTest

github-actions[bot] commented 3 years ago

We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 5 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!

vy-ton commented 2 years ago

This was on closed boards, should we put in the backlog

petergeneric commented 2 years ago

This would be really useful for migrations where PGDUMP has TEXT columns that are stored as large objects

shenker commented 2 years ago

I agree that a stub implementation would be really useful for the sake of Postgres API compatibility. I have a legacy Postgres application I can't modify that uses the large object API (even though the objects aren't actually very large and can be stored just fine as normal columns).

petergeneric commented 1 year ago

@jlinder / @michae2 are these functions (e.g. lo_create, lo_open, lo_write) something that could be created as stubs using the CREATE FUNCTION capabilities currently in CockroachDB? It seems possible, although I've never used functions in CockroachDB before, so a high-level thought on whether it's possible would be useful before I dig in and try to write impls that'd work for basic compat

michae2 commented 1 year ago

@jlinder / @michae2 are these functions (e.g. lo_create, lo_open, lo_write) something that could be created as stubs using the CREATE FUNCTION capabilities currently in CockroachDB? It seems possible, although I've never used functions in CockroachDB before, so a high-level thought on whether it's possible would be useful before I dig in and try to write impls that'd work for basic compat

@petergeneric this would be a better question for @mgartner but I think the answer is something like: it might be possible in v23.2 (currently under development) when mutations in user-defined functions are supported, but definitely not in v23.1 which only supports SELECT in UDFs.