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

PGSQL: ERROR: column "[" does not exist #1

Closed
jbtruffault opened this issue Apr 5, 2022 · 1 comment
Closed

PGSQL: ERROR: column "[" does not exist #1

jbtruffault opened this issue Apr 5, 2022 · 1 comment

Comments

@jbtruffault
Copy link

I guess this request won't work with PGSQL database:

SELECT perm.name,
role_link.parentfield AS field,
CONCAT("[",GROUP_CONCAT('"', role_link.role_name, '"'),"]") AS val
FROM "tabWorkspace Perms" perm
INNER JOIN "tabRole Link" role_link ON perm.name = role_link.parent
GROUP BY perm.name, role_link.parentfield

Do you know how to convert it to pgsql ?

Regards

@jbtruffault
Copy link
Author

I think I found a solution:

SELECT perm.name,
role_link.parentfield AS field,

CONCAT('[',STRING_AGG(CONCAT('"',role_link.role_name, '"'), ','),']') AS val
FROM "tabWorkspace Perms" perm
INNER JOIN "tabRole Link" role_link ON perm.name = role_link.parent
GROUP BY perm.name, role_link.parentfield

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