How to Create Global temporary tables in Azure Postgresql

Velmurugan 1 Reputation point
2023-05-09T13:13:49.3466667+00:00

Hi Team,

Kindly provide us the steps to create Global temporary table for Azure database for postgresql. Currently we are using postgresql 13.

We are unable to create extension pgtt, getting error as could not open extension control file in postgresql. Kindly suggest on the same.

Azure Database for PostgreSQL
{count} votes

1 answer

Sort by: Most helpful
  1. Boris Von Dahle 3,121 Reputation points
    2023-05-09T20:16:45.0566667+00:00

    Hello,

    You're encountering this error because the extension isn't available in Azure Database for PostgreSQL.

    The extensive list can be found here :

    https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-extensions#postgres-13-extensions

    In terms of alternatives, you can't create truly "global" temporary tables in PostgreSQL in the same way you can in other RDBMS like SQL Server.

    If you need a temporary table that is shared across sessions, you'll likely need to create a regular table and manage access and cleanup manually.

    If you have a use case that requires global temporary tables, I would recommend reviewing your database architecture to see if there are different approaches you could take.