From 5390fb702de78e9d76bf4cd38154de265d2dab67 Mon Sep 17 00:00:00 2001 From: Ruslan Talpa Date: Sat, 24 Oct 2015 23:06:19 +0300 Subject: [PATCH] Fix for #321 --- src/PostgREST/PgStructure.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PostgREST/PgStructure.hs b/src/PostgREST/PgStructure.hs index fe5c039a2..7a1cf6147 100644 --- a/src/PostgREST/PgStructure.hs +++ b/src/PostgREST/PgStructure.hs @@ -119,7 +119,7 @@ allRelations = do LATERAL (SELECT array_agg(cols.attname) AS cols, array_agg(cols.attnum) AS nums, array_agg(refs.attname) AS refs - FROM unnest(conkey, confkey) AS _(col, ref), + FROM ( SELECT unnest(conkey) AS col, unnest(confkey) AS ref) k, LATERAL (SELECT * FROM pg_attribute WHERE attrelid = conrelid AND attnum = col) AS cols,