How to print to console in SQL?
With psql you could \echo text (or \qecho if using \o), for example executing with psql -f a file with contents:

select 'Straight';
\echo BETWEEN
select 'the lines.';


outputs:

 ?column? 
----------
 Straight
(1 row)

BETWEEN
  ?column?  
------------
 the lines.
(1 row)