Reputation: 537
created a temporary table in a postgresql function. and then calling this function from my screen to save some business logic and this screen is multi user , multiple user can access it from different 2 client machine then want to know this same temporary table can be used in it.
create temporary table temp_test
( id int, name text) on commit drop;
using this script in an function fn_test() which created it and inserting records in it. if multi user will access this screen/code then it will work or not ??
Upvotes: 0
Views: 1697
Reputation: 930
Temporary table is session specific. SO if a user created it, only that user can see the table content untill the session is expired. Even when the temp table is created by one user, no other user would be able to see the table content by selecting the table. This would help
What is the scope of a PostgreSQL Temp Table?
It is better to create a simple table, that would be accessible by all other users with different sessions. At the end of the work you can drop the table from within the function
Upvotes: 3