Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unclosed bracket error, but works on pgadmin #168

Closed
u007 opened this issue Jul 11, 2018 · 2 comments
Closed

unclosed bracket error, but works on pgadmin #168

u007 opened this issue Jul 11, 2018 · 2 comments

Comments

@u007
Copy link
Member

u007 commented Jul 11, 2018

migration sample code:

raw(`
CREATE MATERIALIZED VIEW view_papers AS
 SELECT papers.created_at,
    papers.updated_at,
    papers.id,
    papers.name,
    (   setweight(to_tsvector(papers.name::text), 'A'::"char") || 
        setweight(to_tsvector(papers.author_name), 'B'::"char")
    ) || setweight(to_tsvector(papers.description), 'C'::"char")
    AS paper_vector
   FROM
   ( SELECT papers.id, string_agg(categories.code, ',') as categories
    FROM papers
    LEFT JOIN paper_categories ON paper_categories.paper_id=papers.id LEFT JOIN (select * from categories order by weight asc) categories ON categories.id=paper_categories.category_id
    GROUP BY papers.id
   ) a
   LEFT JOIN papers on a.id=papers.id
  WHERE (papers.doc_status = ANY (ARRAY[1, 3])) AND papers.status = 1
WITH DATA
`)

got this error:

...view_papers.up.fizz: line 9: expected next token to be ), got IDENT instead
line 23: no prefix parse function for ) found
line 50: expected next token to be ), got IDENT instead
line 65: no prefix parse function for ) found
@u007
Copy link
Member Author

u007 commented Jul 11, 2018

i think it has something todo with plush script runner

@u007
Copy link
Member Author

u007 commented Jul 11, 2018

i found the work around, replace all " with

 \"

but i think plush should by default be able to handle single " when we use ` in fizz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant