Skip to content

Instantly share code, notes, and snippets.

@soc
Last active August 29, 2015 14:12
Show Gist options
  • Save soc/691a8dc4009c05872698 to your computer and use it in GitHub Desktop.
Save soc/691a8dc4009c05872698 to your computer and use it in GitHub Desktop.
WITH role_oids AS (
INSERT INTO pg_authid SELECT concat('Role', id), false, false, false, false, false, true, false, -1, md5(id::text), NULL FROM person RETURNING oid
)
INSERT INTO pg_auth_members
SELECT
(SELECT oid FROM pg_authid WHERE rolname = 'enduser'),
role_oids,
10,
false
FROM role_oids;
ERROR: column "member" is of type oid but expression is of type record
ZEILE 7: role_oids,
^
TIP: You will need to rewrite or cast the expression.
********** Fehler **********
ERROR: column "member" is of type oid but expression is of type record
SQL Status:42804
Hinweis:You will need to rewrite or cast the expression.
Zeichen:272
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment