I want to get all the weeks of a month with the start and end dates of those weeks without creating a table My SQL is:

SELECT date_trunc('week', '2020-06-01'::timestamp)::date ||'-'|| 
(date_trunc('week', '2020-06-01'::timestamp)+ '6 days'::interval)::date;


However, using this code it shows only one week's output (2020-06-01-2020-06-07). The actual output I want is:

 (2020-06-01-2020-06-07,
 2020-06-08-2020-06-14,
 2020-06-15-2020-06-21,
 2020-06-22-2020-06-28)
generate_series() with timestamp arguments will do what you want.

testdb=# select d::date::text||'-'||(d+interval '6 days')::date::text from
generate_series('2020-06-01', '2020-06-01'::date + interval '3 weeks', interval '1 weeks') d;
       ?column?        
-----------------------
 2020-06-01-2020-06-07
 2020-06-08-2020-06-14
 2020-06-15-2020-06-21
 2020-06-22-2020-06-28
(4 rows)

Time: 0.645 ms