In my database I have various temporary tables, I do not want to drop, which is default behaviour of temp tables, these tables after each transaction.
To reduce such drop overhead, I have written following definition of the temp tables
CREATE TEMPORARY TABLE TEMPTABLEINPOSTGRESDB (LIKE PERMTABLE INCLUDING INDEXES) ON COMMIT DELETE;
Could you tell me the behaviour of such table? Will DB clear the table instead dropping it every time?
Is there any alternate solution to achieve functionality mentioned below?
Application is adding few records in each session, and application must delete the data once the session completes. The data added in the middle of the session, must not be visible to any other thread of the application.
Edit: Read session instead transaction.