On Wed, Oct 14, 2009 at 12:04:26PM -0500, Andrew Bailey wrote:
> I cant find in the documentation support for a 3 dimensional vector,
> I have only seen the array type, I am interested in doing vector dot
> products and vector cross products, also summing vectors and
> multiplying by a scalar quantity

If you did do this, I'd be tempted to use something like:

  create type point3d AS (
    x float8, y float8, z float8
  );

and then write your functions using this.  The length of an array isn't
part of its type and so PG wouldn't be able to stop you from writing:

  select array[1,2,3] + array[2,3,4,5,6];

if you provided the appropriate operators.  If you use a fixed sized
tuple, as above, you'd get errors if you tried to use points of the
wrong dimensionality.

-- 
  Sam  http://samason.me.uk/

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to