INSERT INTO public.applications (
    application_key, 
    application_timestamp, 
    application_ssn, 
    application_email_address, 
    application_bank_account_number, 
    application_is_rejected, 
    application_date_of_birth,
    application_customer_type
)
VALUES (
    $application_key, 
    $application_timestamp, 
    $application_ssn, 
    $application_email_address, 
    $application_bank_account_number, 
    $application_is_rejected, 
    $application_date_of_birth,
    $application_customer_type
)
ON CONFLICT (application_key)
DO UPDATE
    SET application_timestamp        = EXCLUDED.application_timestamp,
        application_ssn              = EXCLUDED.application_ssn,
        application_email_address    = EXCLUDED.application_email_address,
        application_bank_account_number = EXCLUDED.application_bank_account_number,
        application_is_rejected      = EXCLUDED.application_is_rejected,
        application_date_of_birth    = EXCLUDED.application_date_of_birth,
        application_customer_type    = EXCLUDED.application_customer_type;