Search Postgresql Archives

Re: Add column

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 11, 2006 at 07:35:29PM +0300, Ioannis Theoharis wrote:
> 
> 
> Hi, there is a feature that I would be glad if it was supported by
> PostgreSQL:
> 
> I want to add a new column (attribute) to a pre-existed table, but instead
> of filling the values of this column with a default value (e.g. null) I
> would like to copy them from a file stored in my filesystem.
> 
> I didn't find any example of mixing "copy" and "alter table ... add
> column" in the Documentation, however I send this mail to check it out.

That's because it doesn't make any sense. How does the alter table know
which row in the copy matches which row in the table? It's means you
need to do a join, at which point it would be easier to just copy into
a temp table and do an update to set the values.

alter table doesn't really have any magic in it w.r.t. setting the
default value.

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog@xxxxxxxxx>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux