Re: [HACKERS] array behavior

2011-12-19 Thread Marti Raudsepp
On Fri, Dec 16, 2011 at 00:15, amit sehas wrote: > There is the TOAST mechanism for oversized tuples but that is still > considered to be a single tuple. Is there any circumstance in which an > attribute which is an array will be broken up into individual > tuples which are somehow associated with

[HACKERS] array behavior

2011-12-18 Thread amit sehas
If a field(attribute) in a type is declared to be an array. Then is it always the case that the array will be packed into a single tuple that resides in the database. There is the TOAST mechanism for oversized tuples but that is still considered to be a single tuple. Is there any circumstance in

Re: [HACKERS] Array behavior oddities

2008-03-26 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > If any dimension is written as a slice, i.e. contains a colon, then all > > dimensions are treated as slices. > > > Is the the behavior of assuming an entry with no colon is a slice what > > we want, or are we just stuck with it?

Re: [HACKERS] Array behavior oddities

2008-01-16 Thread Jens-Wolfhard Schicke
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Bruce Momjian wrote: > An array subscript expression will return null if either the array itself > or any of the subscript expressions are null. Also, null is returned > if a subscript is outside the array bounds (this case does not raise an >

Re: [HACKERS] Array behavior oddities

2008-01-15 Thread Tom Lane
Gregory Stark <[EMAIL PROTECTED]> writes: > Here's something else which confused me just now. Why does the second query > return NULL instead of an array slice? Because it isn't a slice expression --- you used colon nowhere, so the result type is going to be text not text[]. (Remember that the pa

Re: [HACKERS] Array behavior oddities

2008-01-15 Thread Gregory Stark
"Bruce Momjian" <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Why do you find that surprising? It's either a slice or it isn't, >> there's no halfway point. Are you proposing to throw an error if only >> some of the subscripts have colons? What would be the point? > > What is confusing is if

Re: [HACKERS] Array behavior oddities

2008-01-15 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > If any dimension is written as a slice, i.e. contains a colon, then all > > dimensions are treated as slices. > > > Is the the behavior of assuming an entry with no colon is a slice what > > we want, or are we just stuck with it?

Re: [HACKERS] Array behavior oddities

2008-01-14 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > If any dimension is written as a slice, i.e. contains a colon, then all > dimensions are treated as slices. > Is the the behavior of assuming an entry with no colon is a slice what > we want, or are we just stuck with it? Why do you find that surpri

[HACKERS] Array behavior oddities

2008-01-14 Thread Bruce Momjian
In reading our array documentation I came across two unusual behaviors. The issue relates to slices: We can also access arbitrary rectangular slices of an array, or subarrays. An array slice is denoted by writing lower-bound:upper-bound for one or more array dimensions. For example, th