In SQL, string/character literals (constants) need to be enclosed in single quotes, not double quotes.
"second_type"
refers to a column named second_type
you want 'second_type'
:
CREATE OR REPLACE VIEW
some_view
AS
SELECT
'first_type' as type,
t1.id,
t1.author_id,
t1.content,
FROM t1
UNION ALL
SELECT
'second_type' as type,
t2.id,
t2.author_id,
t2.content,
FROM t2
For more details see the manual:http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS