Missing FROM-clause entry for table HTTEMP123...

We see entries in the Server log like
org.postgresql.util.PSQLException: ERROR: missing FROM-clause entry for table “HTTEMP1482141051962108”

It seems that a SQL statement that Servoy generated with some temporary tables can not be processed by postgres.
The first part of such a SQL statement looks like this:

select project_elements.project_element_id from project_elements project_elements
inner join projects projects on project_elements.project_id=projects.project_id and (projects.tenant_id = ? or projects.tenant_id is null) and (projects.is_deleted = ? or projects.is_deleted is null)
and “HTTEMP1482141051962108”.svy_check__1482141052 is not null
left outer join HT_TEMP_1482141051 “HTTEMP1482141051962108” on projects.project_id=“HTTEMP1482141051962108”.project_id_1482141053
where …

Due to which reason does Servoy insert those temporary tables, and is it possible to avoid that behaviour, so that postgres does not fail?

Bernd

I’ve seen also those entries in the Server log and think they are related to the use AddTableFilterParam where a query is trying to work on records that are outside the FilterParam.

I had a screen that listed all Global stockholders and made various calculations based on their stock and my suspicion was that this error was thrown when it was used by Sales Staff who only had access to a limited number of stockholders. Could not reproduce consistently so changed the way that Stock was presented.

If Servoy/Postgres gurus have an explanation I’d be very interested though.

Bernd,

Servoy adds a joint to a temporary table when a condition cannot be expressed in the sql straight away.

Please file a case in the Servoy Support system with a sample solution that shows this issue.

Rob

Hi Rob,

thanks for the hint, now I know where we have to search. We will track down where the SQL statement is produced and post a case.