Skip to content

Commit 3f828fa

Browse files
committed
Fix array_typanalyze to work for domains over arrays.
Not sure how we missed this case, but we did. Per bug #7551 from Diego de Lima.
1 parent bcf90cc commit 3f828fa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/backend/utils/adt/array_typanalyze.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "commands/vacuum.h"
2020
#include "utils/array.h"
2121
#include "utils/datum.h"
22+
#include "utils/lsyscache.h"
2223
#include "utils/typcache.h"
2324

2425

@@ -108,11 +109,10 @@ array_typanalyze(PG_FUNCTION_ARGS)
108109
PG_RETURN_BOOL(false);
109110

110111
/*
111-
* Check attribute data type is a varlena array.
112+
* Check attribute data type is a varlena array (or a domain over one).
112113
*/
113-
element_typeid = stats->attrtype->typelem;
114-
115-
if (!OidIsValid(element_typeid) || stats->attrtype->typlen != -1)
114+
element_typeid = get_base_element_type(stats->attrtypid);
115+
if (!OidIsValid(element_typeid))
116116
elog(ERROR, "array_typanalyze was invoked for non-array type %u",
117117
stats->attrtypid);
118118

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy