Limits of arrays - Mailing list pgsql-general

From Harald Armin Massa
Subject Limits of arrays
Date
Msg-id 7be3f35d0609190645n3708ad95ne609d8e576668227@mail.gmail.com
Whole thread Raw
List pgsql-general

I found a rather strange but working method to compare the contents of two tables in different databases:

select 'otformularfeld' as which, md5(array_to_string(array(
select md5(id_pkff||id_formular||id_formfeld||id_bf) from otformularfeld where quarant=0 order by id_pkff
),''))

So:
 -  basically I take the relevant columns from a table
 -  cast them to text and concattenate the strings
 - find the md5 hash of this row
 - then take the md5 of all rows,
concattenate them to string
 - and finally find the md5 of this string

That works surprisingly fast and gives a quick check "data in those 2 tables is the same or not".

Now, the maximum rowcount in one table so far is 180000; and still there is no crash. Are there limits for the maximum "rows" in one arrays?
Limits the maximum length of one string?

The only near information I could find in the documentations was "1 GB per field", which will propably be the size limit for the array and the string. Are there more limits?

Or is that md5 / concattenation process done in an iterative manner, that is: all the intermediate results are consumed and not cached in memory?

Harald




--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
0173/9409607
-
Let's set so double the killer delete select all.
--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
0173/9409607
-
Let's set so double the killer delete select all.

pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: unique key issue
Next
From: Bill Moran
Date:
Subject: Re: vista