Skip to content

Conversation

@beikov
Copy link
Member

@beikov beikov commented Nov 9, 2021

https://hibernate.atlassian.net/browse/HHH-14211

Also see the discussion here:

@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Nov 9, 2021

Thanks for your pull request!

This pull request appears to follow the contribution rules.

› This message was automatically generated.

@sebersole
Copy link
Member

@gavinking
Copy link
Member

OK, interesting, so it looks like the issue here was actually the precise opposite of what was reported.

That is, the problem was actually that we used the wrong column type (by default) for things that really are CLOBs and belong in pg_large_objects, and that we never realized because the broken-ass postgres drivers tolerate this and work fine with it and make it seem totally legit, right up until your DBA runs some command line tool.

And unfortunately users were reporting this issue as the exact opposite problem: that when they use @lob they wanted things TOASTed, not stored as oids, which just didn't seem to make any sense at all. Because I guess they were abusing @lob in order to change the SQL column type to text.

Thanks for untangling this @beikov.

@beikov
Copy link
Member Author

beikov commented Nov 12, 2021

Exactly @gavinking, you pretty much nailed the gist of this :)

@jannic
Copy link

jannic commented Nov 19, 2021

And unfortunately users were reporting this issue as the exact opposite problem: that when they use @lob they wanted things TOASTed, not stored as oids, which just didn't seem to make any sense at all. Because I guess they were abusing @lob in order to change the SQL column type to text.

I guess this is because of misleading tutorials like https://www.baeldung.com/jpa-annotation-postgresql-text-type

@jannic
Copy link

jannic commented Nov 19, 2021

Ping to @Baeldung, perhaps you'd like to comment? If the analysis in this ticket is correct (and as far as I know, it is), the mentioned tutorial should be updated.

@beikov beikov merged commit 77776a6 into hibernate:5.6 Dec 6, 2021
@beikov beikov deleted the HHH-14211 branch May 22, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants