From 0ed8ec98685fee121851f3b55f1d1b490d3eab6d Mon Sep 17 00:00:00 2001 From: Ruslan Talpa Date: Sat, 24 Oct 2015 22:50:03 +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 1217cf74b..4fa3d35be 100644 --- a/src/PostgREST/PgStructure.hs +++ b/src/PostgREST/PgStructure.hs @@ -105,7 +105,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,