Design question: Using Array datatypes

Started by Joe Tomcatover 23 years ago2 messagesgeneral
Jump to latest
#1Joe Tomcat
tomcat@mobile.mp

I noticed that PG supports arrays. I noticed also that one of the rules
of DB normalization is "no repeating fields". It seems like using
arrays would violate that. I have a particular need that would benefit
from using arrays. There will be no need to search elements in the
array, so it seems like a good place to use it. What are opinions on
array usage? Is it a horrible misfeature, never to be used, or is it
the right way to go in some situations? I have never used arrays in a
db design.

Thanks for an opinions on this.

#2Oleg Bartunov
oleg@sai.msu.su
In reply to: Joe Tomcat (#1)
Re: Design question: Using Array datatypes

On 23 Sep 2002, Mr. Tomcat wrote:

I noticed that PG supports arrays. I noticed also that one of the rules
of DB normalization is "no repeating fields". It seems like using
arrays would violate that. I have a particular need that would benefit
from using arrays. There will be no need to search elements in the
array, so it seems like a good place to use it. What are opinions on
array usage? Is it a horrible misfeature, never to be used, or is it
the right way to go in some situations? I have never used arrays in a
db design.

Thanks for an opinions on this.

contrib/intarray is what you need. We use arrays extensively and rather
happy. It's not a "repeating fields", it's a field with "repeating elements"

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83