Bug 269 : Postgres specific ERROR: subquery in FROM must have an alias ... FROM (SELECT ...) [AS] foo.
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.6.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
11/04/2010
Updated 
11/04/2010
Type 
Bug
 
Attachments 
No attachments

javax.persistence.PersistenceException: org.postgresql.util.PSQLException: ERROR: subquery in FROM must have an alias
Hint: For example, FROM (SELECT ...) [AS] foo.
Position: 22
at com.avaje.ebeaninternal.server.query.CQueryEngine.findRowCount(CQueryEngine.java:138)
at com.avaje.ebeaninternal.server.query.DefaultOrmQueryEngine.findRowCount(DefaultOrmQueryEngine.java:57)

 
Rob 11 Apr 04:01
Hmmm,

This occurs when a count is used on a query with a predicate on a *ToMany property. In this case there is a select count(*) from ( ... ) wrapped around the sql.

In this case Postgres needs a " AS c" alias added to the sql.

Rob 11 Apr 04:02
Fixed in HEAD

Fixed in HEAD.

woResponse

Upload a file