pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: igor <igor_kh@mailru.com>
Cc: pgsql-novice@postgreSQL.org
Subject: Re: Alter table with arrays
Date: Mon, 24 Jul 2000 12:41:34 -0400
Message-ID: <635.964456894@sss.pgh.pa.us> (raw)
In-Reply-To: <15913127324.20000724175410@mailru.com>
References: <00072401305903.00253@comptechnews>
	<23362.964418697@sss.pgh.pa.us>
	<15913127324.20000724175410@mailru.com>

igor <igor_kh@mailru.com> writes:
>  Help me please to alter table with arrays .
> And now I would like to increase the number of colomns of array from
> two to tree. What is the way to fulfill these operation?

As of 7.0.*, the only way to change the size of an array is to replace
the whole array, ie,
	UPDATE table SET arraycol = '{ .... }'

I have recently fixed the array code so that you can enlarge an array
by assigning to an element or slice.  For example, given an array with
current dimensions [1:3] you can assign to array[4] (or array[0], or
array[2:7], etc).  Restriction: you can't leave "holes" in the array,
so it only works for 1-D arrays.  This will appear in 7.1.

			regards, tom lane



view thread (2+ messages)

Message-ID: <635.964456894@sss.pgh.pa.us>
Permalink:  ../635.964456894@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/635.964456894@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, igor_kh@mailru.com, pgsql-novice@postgreSQL.org
  Subject: Re: Alter table with arrays
  In-Reply-To: <635.964456894@sss.pgh.pa.us>
  References: <00072401305903.00253@comptechnews> <23362.964418697@sss.pgh.pa.us> <15913127324.20000724175410@mailru.com> <635.964456894@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox