Create a new function named extract_mailing_list()
that returns a table with the following columns:
RETURNS TABLE (
title character varying(8),
first_name character varying(255),
last_name character varying(255),
email_address character varying(255),
newsletter_name character varying(256)
)
When it starts, the function should log the following message with the 'INFO'
level:
ETL process Extract Mailing List Started
The type of newsletter must equal 'E-mail'
, and the final result set should contain only distinct records ordered by the email_address
column.
When the function finishes, it should log the following message with the 'INFO'
level:
ETL process Extract Mailing List Finished
Remember to pass in 'extract_mailing_list()'
as the process name when logging.