Convert Date format into bigint format in postgresql
postgres=# create table dttest ( dt date ) ;
CREATE TABLE
postgres=# insert into dttest values ( '2018-08-20' ) ;
INSERT 0 1
postgres=# select * from dttest;
     dt     
------------
 2018-08-20
(1 row)

postgres=# select to_char( dt, 'YYYYMMDD' ) from dttest ; 
 to_char  
----------
 20180820
(1 row)

postgres=# 


TO_CHAR and other date/time formatting is documented here.

Oh, and if you actually do want to cast to bigint:

select to_char( dt, 'YYYYMMDD' )::bigint from dttest ;