dbTalk Databases Forums  

Error "cannot compare arrays of different element types" when tryingto ANALYZE

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss Error "cannot compare arrays of different element types" when tryingto ANALYZE in the comp.databases.postgresql.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Florian G. Pflug
 
Posts: n/a

Default Error "cannot compare arrays of different element types" when tryingto ANALYZE - 11-14-2004 , 04:45 PM






Hi

Since sometime yesterday, my postgresql (7.4.5) reports
"ERROR: cannot compare arrays of different element types",
when I analyze a specific table in my database.

Here is the tables definition:
Column | Type | Modifiers
-------------------+------------------------+----------------------------------------------------
self | datagraph."GOLink" | not null default
nextval('datagraph.s_self'::text)
Bezeichnung | datagraph."Char" |
virtual | datagraph."Boolean" | default true
Mitarbeiter | datagraph."GOLinkList" |
Abteilungen | datagraph."GOLinkList" |
Memo | datagraph."Text" |
Leiter | datagraph."GOLink" |
PostfachLand | datagraph."GOLink" |
PostfachOrt | datagraph."Char" |
PostfachPLZ | datagraph."Char" |
PostfachPostfach | datagraph."Char" |
PLZ | datagraph."Char" |
Ort | datagraph."Char" |
Land | datagraph."GOLink" |
Strasse | datagraph."Char" |
Telefon | datagraph."GOLinkList" |
Telefax | datagraph."GOLinkList" |
eMail | datagraph."GOLinkList" |
BS Nummer | datagraph."Char" |
Aktiv | datagraph."Boolean" |
Eroeffnung | datagraph."Date" |
Schliessung | datagraph."Date" |
Eintritt | datagraph."Date" |
Austritt | datagraph."Date" |
TUI Agenturnummer | datagraph."Char" |
Bankverbindungen | datagraph."GOLinkList" |
Marke | datagraph."GOLink" |
Buchhaltungsinfo | datagraph."GOLink" |
Name | datagraph."Char" |
Oeffnungszeiten | datagraph."Text" |
Zusatz | datagraph."Char" |
HR Firma | datagraph."GOLink" |
www | datagraph."GOLinkList" |
Vertraege | datagraph."GOLinkList" |
Standortinfo | datagraph."GOLink" |
Marketinginfo | datagraph."GOLink" |
OnChange | datagraph."GOLinkList" |
Historie | datagraph."GOLinkList" |

The datatypes are all domains with the basetype being what the name
suggest (e.g. datagraph."Date" is a domain with basetype date).
GOLink has the basetype int8, which GOLinkList has the basetype int8[].

Google just returns one(!) hit when searching for the error-message,
which points to the file generating the error
"/cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c".

greetings, Florian Pflug

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: Error "cannot compare arrays of different element types" when trying to ANALYZE - 11-14-2004 , 05:21 PM






"Florian G. Pflug" <fgp (AT) phlo (DOT) org> writes:
Quote:
Since sometime yesterday, my postgresql (7.4.5) reports
"ERROR: cannot compare arrays of different element types",
when I analyze a specific table in my database.
...
GOLink has the basetype int8, which GOLinkList has the basetype int8[].
I wonder whether you have somehow managed to store some GOLinkList
entries that internally show their element type as GOLink rather than
int8. That shouldn't happen (since we don't support arrays of domain
types) but it would explain the error message. Any idea what you did
to create this situation?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend



Reply With Quote
  #3  
Old   
Florian G. Pflug
 
Posts: n/a

Default Re: Error "cannot compare arrays of different element types" - 11-14-2004 , 06:11 PM



Tom Lane wrote:
Quote:
"Florian G. Pflug" <fgp (AT) phlo (DOT) org> writes:

Since sometime yesterday, my postgresql (7.4.5) reports
"ERROR: cannot compare arrays of different element types",
when I analyze a specific table in my database.
...
GOLink has the basetype int8, which GOLinkList has the basetype int8[].

I wonder whether you have somehow managed to store some GOLinkList
entries that internally show their element type as GOLink rather than
int8. That shouldn't happen (since we don't support arrays of domain
types) but it would explain the error message. Any idea what you did
to create this situation?
Hm.. We hade some strange problems a week or so ago, where updating
fields of type GOLinkList would mange the numbers we where trying to
store. E.h, we did 'update datagraph."Filiale" set "Historie" =
"Historie" || array[1] where self = ...', but after the the update, the
last number in the "Historie" field would be some strangly large number
(somewhere in the range of a few millions). I'm not sure that these
problems happened for the "Filiale" table - I'll check with my collegue
who stumbled upton this...

Anyway, this only happened for a few records, and the problem vanished
after deleting and reinserting those records. Could it be that we
somehow managed to insert "GOLink"s instead of int8s into the
GOLinkList, and
those got misinterpretet as int8s when selecting, thus causing the
data-mangling?

greetings, Florian Pflug

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.