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

The postgresql throws an exception when the PRIMARY KEY is not type long. #293

Closed
fx8080 opened this issue Dec 27, 2016 · 2 comments
Closed
Assignees
Milestone

Comments

@fx8080
Copy link

fx8080 commented Dec 27, 2016

org.postgresql.util.PSQLException: Bad value for type long : xxxxxx

case at com.speedment.runtime.core.internal.db.AbstractDbmsOperationHandler.handleSqlStatement(AbstractDbmsOperationHandler.java:234)

the source code is:
try (final ResultSet generatedKeys = ps.getGeneratedKeys()) {
while (generatedKeys.next()) {
sqlStatement.addGeneratedKey(generatedKeys.getLong(1));
}
}
}

@fx8080 fx8080 changed the title org.postgresql.util.PSQLException: Bad value for type long : xxxxxx if PRIMARY KEY is not long type The postgresql throws an exception when the PRIMARY KEY is not type long. Dec 27, 2016
@minborg
Copy link
Contributor

minborg commented Dec 28, 2016

Can you please post the table creation statements and it will be easier to reproduce the error.

@minborg minborg added the bug label Dec 28, 2016
@minborg minborg added this to the 3.0.5 Forest milestone Feb 15, 2017
@minborg minborg modified the milestones: 3.0.5 Forest, 3.0.6 Forest Mar 11, 2017
@minborg minborg modified the milestones: 3.0.6 Forest, 3.0.7 Forest Apr 17, 2017
@lawesson
Copy link
Contributor

Reproduced with

CREATE TABLE salesinfo.serialid
(
    id character varying(255) NOT NULL,
    email character varying(255),
    CONSTRAINT primarykey PRIMARY KEY (id)
)

and

    @Test
    public void testInsert() { 
        serialIds.persist(new SerialidImpl().setId("foo").setEmail("mail"));
        Serialid item = serialIds.stream().findAny().orElseThrow(RuntimeException::new);
    }

@minborg minborg modified the milestones: 3.0.10 Forest, 3.0.9 Forest May 12, 2017
lawesson added a commit that referenced this issue May 16, 2017
@lawesson lawesson added the fixed label May 16, 2017
@minborg minborg closed this as completed May 16, 2017
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

3 participants