postgresql7.1
select to_char(to_date(:current_date, 'yyyy-mm-dd'), 'D')
as day_of_the_week,
to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'SUNDAY'))
as sunday_of_the_week,
to_char(next_day(to_date(:current_date, 'yyyy-mm-dd'), 'Saturday'))
as saturday_of_the_week
from dual