plpgsql CREATE FUNCTION syntax error at or near 'CREATE'
问题 Can't seem to get this function to Create, even when I empty out all the DECLARE block and the BEGIN-END block and just try to return a string. Can anyone help me with what I've done wrong here? Trying to execute this in pgAdminIII (Ubuntu): CREATE OR REPLACE FUNCTION split_country() RETURNS text as $$ DECLARE titlecsv text; arCountries text[]; country_cursor CURSOR FOR SELECT DISTINCT country FROM festfriend.films; BEGIN OPEN country_cursor; LOOP FETCH NEXT FROM country_cursor INTO titlecsv;