Saturday 12 August 2023

What Are Global Temporary Tables And Temp Tables In PostgreSQL Database ...






Only 3.9% of viewers are subscribing to my channel 😓.
I request you to please give click on Subscribe button.
It really helps me grow 😢.

Please Like, Comment, and Subscribe to my channel. ❤




-- Global Temporary Tables In PostgreSQL Database

create temporary table temp_location
(
city varchar(50),
street varchar(40)
) on commit delete rows;

select * from temp_location;


create temp table temp_cities
(
name character varying(100)
) on commit delete rows;


select * from temp_cities;

drop table temp_cities;

begin transaction;

insert into temp_cities values ('Mumbai');

insert into temp_cities values ('Pune');

commit;


create temp table temp_cities
(
name character varying(100)
) on commit preserve rows;

begin transaction;
create temp table temp_cities
(
name character varying(100)
) on commit drop;

select * from temp_cities;

No comments:

Post a Comment