ERROR:  invalid input syntax for integer: "sun"
LINE 1: select ctg from ewf.story  where id='sun'
                                            ^

select ctg from ewf.story  where id='sun'

ERROR:  column "sun" does not exist
LINE 1: ...ng(array(select nam from ewf.story_tag where s_id=sun), ', '...
                                                             ^

select array_to_string(array(select nam from ewf.story_tag where s_id=sun), ', ') as txt

ERROR:  current transaction is aborted, commands ignored until end of transaction block

select id,title,to_char(etm,'HH:MI PM') as etm from ewf.story_1 order by 1 desc limit 10