Error while inserting UUID array with PostgreSQL
up vote
1
down vote
favorite
I have an attribute in one of my entity class as below
@Column(name = "idc_reviewer", columnDefinition="_uuid")
private UUID reviewer;
While saving the entity, I am getting below error.
ERROR: column "idc_reviewer" is of type uuid but expression is of type bytea
Hint: You will need to rewrite or cast the expression.
I tried replacing columnDefinition with pg-uuid but that too didn't work.
Software Version:
Hibernate: 5.2.17
SpringBoot: 2.0.3
java postgresql hibernate spring-boot postgresql-10
add a comment |
up vote
1
down vote
favorite
I have an attribute in one of my entity class as below
@Column(name = "idc_reviewer", columnDefinition="_uuid")
private UUID reviewer;
While saving the entity, I am getting below error.
ERROR: column "idc_reviewer" is of type uuid but expression is of type bytea
Hint: You will need to rewrite or cast the expression.
I tried replacing columnDefinition with pg-uuid but that too didn't work.
Software Version:
Hibernate: 5.2.17
SpringBoot: 2.0.3
java postgresql hibernate spring-boot postgresql-10
How do you expect that postgres will store an array in a table column?
– M. Deinum
21 hours ago
4
@M.Deinum: because Postgres supports it (but apparently Hibernate does not)
– a_horse_with_no_name
21 hours ago
Hmm... Learned something new :). You probably need a custom type for this then. And of course Vlad has you already covered (see vladmihalcea.com/…).
– M. Deinum
20 hours ago
@M.Deinum If there is no other approach, Thats a last option for me :)
– CuriousMind
19 hours ago
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have an attribute in one of my entity class as below
@Column(name = "idc_reviewer", columnDefinition="_uuid")
private UUID reviewer;
While saving the entity, I am getting below error.
ERROR: column "idc_reviewer" is of type uuid but expression is of type bytea
Hint: You will need to rewrite or cast the expression.
I tried replacing columnDefinition with pg-uuid but that too didn't work.
Software Version:
Hibernate: 5.2.17
SpringBoot: 2.0.3
java postgresql hibernate spring-boot postgresql-10
I have an attribute in one of my entity class as below
@Column(name = "idc_reviewer", columnDefinition="_uuid")
private UUID reviewer;
While saving the entity, I am getting below error.
ERROR: column "idc_reviewer" is of type uuid but expression is of type bytea
Hint: You will need to rewrite or cast the expression.
I tried replacing columnDefinition with pg-uuid but that too didn't work.
Software Version:
Hibernate: 5.2.17
SpringBoot: 2.0.3
java postgresql hibernate spring-boot postgresql-10
java postgresql hibernate spring-boot postgresql-10
edited 21 hours ago
asked 21 hours ago
CuriousMind
2,12422135
2,12422135
How do you expect that postgres will store an array in a table column?
– M. Deinum
21 hours ago
4
@M.Deinum: because Postgres supports it (but apparently Hibernate does not)
– a_horse_with_no_name
21 hours ago
Hmm... Learned something new :). You probably need a custom type for this then. And of course Vlad has you already covered (see vladmihalcea.com/…).
– M. Deinum
20 hours ago
@M.Deinum If there is no other approach, Thats a last option for me :)
– CuriousMind
19 hours ago
add a comment |
How do you expect that postgres will store an array in a table column?
– M. Deinum
21 hours ago
4
@M.Deinum: because Postgres supports it (but apparently Hibernate does not)
– a_horse_with_no_name
21 hours ago
Hmm... Learned something new :). You probably need a custom type for this then. And of course Vlad has you already covered (see vladmihalcea.com/…).
– M. Deinum
20 hours ago
@M.Deinum If there is no other approach, Thats a last option for me :)
– CuriousMind
19 hours ago
How do you expect that postgres will store an array in a table column?
– M. Deinum
21 hours ago
How do you expect that postgres will store an array in a table column?
– M. Deinum
21 hours ago
4
4
@M.Deinum: because Postgres supports it (but apparently Hibernate does not)
– a_horse_with_no_name
21 hours ago
@M.Deinum: because Postgres supports it (but apparently Hibernate does not)
– a_horse_with_no_name
21 hours ago
Hmm... Learned something new :). You probably need a custom type for this then. And of course Vlad has you already covered (see vladmihalcea.com/…).
– M. Deinum
20 hours ago
Hmm... Learned something new :). You probably need a custom type for this then. And of course Vlad has you already covered (see vladmihalcea.com/…).
– M. Deinum
20 hours ago
@M.Deinum If there is no other approach, Thats a last option for me :)
– CuriousMind
19 hours ago
@M.Deinum If there is no other approach, Thats a last option for me :)
– CuriousMind
19 hours ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53370908%2ferror-while-inserting-uuid-array-with-postgresql%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
How do you expect that postgres will store an array in a table column?
– M. Deinum
21 hours ago
4
@M.Deinum: because Postgres supports it (but apparently Hibernate does not)
– a_horse_with_no_name
21 hours ago
Hmm... Learned something new :). You probably need a custom type for this then. And of course Vlad has you already covered (see vladmihalcea.com/…).
– M. Deinum
20 hours ago
@M.Deinum If there is no other approach, Thats a last option for me :)
– CuriousMind
19 hours ago