In jupyter lab
I can do:
query = """
select * from crosstab(
'SELECT
s.subject,
w.pubyear,
count(s.ut)
FROM
country c
left join utcountry_mv u on u.code = c.code
left join world_arts_reviews_mv w on w.ut = u.ut
LEFT JOIN art_subject_mv s ON s.ut = w.ut
WHERE
s.ut IS NOT NULL
and
c.region ~''africa''::citext
AND pubyear BETWEEN 2000 AND 2017
GROUP BY
1,
2
order by subject',
'select m from generate_series(2000,2017) m')
as (subject varchar,
"2000" int,
"2001" int,
"2002" int,
"2003" int,
"2004" int,
"2005" int,
"2006" int,
"2007" int,
"2008" int,
"2009" int,
"2010" int,
"2011" int,
"2012" int,
"2013" int,
"2014" int,
"2015" int,
"2016" int,
"2017" int);
"""
without a problem.
In Atom I get
syntax: incomplete: invalid string syntax
I suspect this is a bug. Or do I have to add some plugin to Atom to handle this?