Skip to content

Create Postgress Table With Million Rows

Create a Postgres table with a million rows

Section titled “Create a Postgres table with a million rows”
  1. use docker to Spinnup the progress image
    Terminal window
    docker run -e POSGRESS_PASSWORD=postgress --name pg1 progress
  2. get into the Postgres shell using the following command
    Terminal window
    docker exec -it pg1 psql -U progress
  3. create a table
    Terminal window
    create table temp(t int);
  4. insert random values using the following command
    Terminal window
    insert into temp(t) random()*100 from generate_series(0,1000000);
  5. check the number of rows inside the temp table
    Terminal window
    select count(*) from temp;