From ee40e7e0d7367603379b5bf0c7c67f1e16752375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Am=C3=A9d=C3=A9e=20d=27Aboville?= Date: Fri, 2 Aug 2019 12:13:01 -0400 Subject: [PATCH] Fix long column descriptions being truncated at 63 characters in pg12 (#1368) * Lengthen child_entities name comment to make tests check it does not get truncated at 63 chars. * Don't cast column description to sql_identifier type (maxlen 63 chars) when introspecting schema in DbStructure.hs --- src/PostgREST/DbStructure.hs | 2 +- test/Feature/StructureSpec.hs | 2 +- test/fixtures/schema.sql | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PostgREST/DbStructure.hs b/src/PostgREST/DbStructure.hs index 69213e95f..691010b29 100644 --- a/src/PostgREST/DbStructure.hs +++ b/src/PostgREST/DbStructure.hs @@ -437,7 +437,7 @@ allColumns tabs = nc.nspname::information_schema.sql_identifier AS table_schema, c.relname::information_schema.sql_identifier AS table_name, a.attname::information_schema.sql_identifier AS column_name, - d.description::information_schema.sql_identifier AS description, + d.description AS description, a.attnum::information_schema.cardinal_number AS ordinal_position, pg_get_expr(ad.adbin, ad.adrelid)::information_schema.character_data AS column_default, CASE diff --git a/test/Feature/StructureSpec.hs b/test/Feature/StructureSpec.hs index 3bd7d7418..8bd20a9b3 100644 --- a/test/Feature/StructureSpec.hs +++ b/test/Feature/StructureSpec.hs @@ -125,7 +125,7 @@ spec = do "type": "integer" }, "name": { - "description": "child_entities name comment", + "description": "child_entities name comment. Can be longer than sixty-three characters long", "format": "text", "type": "string" }, diff --git a/test/fixtures/schema.sql b/test/fixtures/schema.sql index 2c373329d..92e61e97a 100755 --- a/test/fixtures/schema.sql +++ b/test/fixtures/schema.sql @@ -1226,7 +1226,7 @@ create table ranges ( comment on table child_entities is 'child_entities comment'; comment on column child_entities.id is 'child_entities id comment'; -comment on column child_entities.name is 'child_entities name comment'; +comment on column child_entities.name is 'child_entities name comment. Can be longer than sixty-three characters long'; comment on table grandchild_entities is $$grandchild_entities summary