[postgis-users] How can I add one column to the table in my existing query?!

BladeOfLight16 bladeoflight16 at gmail.com
Fri Aug 2 02:31:39 PDT 2013


On Thu, Jul 25, 2013 at 6:37 AM, mane moshref <many_yammy at yahoo.com> wrote:

> <snip>
> It works perfectly but my problem is that I need also to have a unique id
> for each line in the created table. How can I include the column of line
> ids to this table?
> <snip>
>

Is there any reason you couldn't do an ALTER TABLE to add it after the
table has been created like so?

ALTER TABLE many_line
ADD COLUMN many_line_id SERIAL PRIMARY KEY;

That would probably be the simplest solution, if you can afford the
two-commit process.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130802/9f92c5b1/attachment.html>


More information about the postgis-users mailing list