pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ireneusz Pluta <ipluta@wp.pl>
To: marchesini@unipg.it
Cc: pgsql-sql@postgresql.org
Subject: Re: insert a sequence
Date: Fri, 11 May 2007 12:03:11 +0200
Message-ID: <46443F5F.7060603@wp.pl> (raw)
In-Reply-To: <1178808572.4294.15.camel@ivangeo>
References: <1178808572.4294.15.camel@ivangeo>

ivan marchesini napisaƂ(a):
> Dear postgres Users,
> I have a simple question I think.
> I have a table that contains some columns
> one of these columns (the columns ID) contains distinct integer
> values ...
> I need to insert into this table some other records but I only need that
> values were inserted into the ID column and that they were
> progressive... (a sequence starting from 100 and ending to 300, step=1) 
> the other columns must remains null....
> can I do this with a sequence and then an "insert into"?
>
> many thanks 
>
>
>
>
>   
INSERT INTO your_table (id) SELECT generate_series(100, 300, 1);

-> http://www.postgresql.org/docs/8.2/interactive/functions-srf.html




view thread (2+ messages)

Message-ID: <46443F5F.7060603@wp.pl>
Permalink:  ../46443F5F.7060603@wp.pl/
Also on:    postgresql.org/message-id/46443F5F.7060603@wp.pl

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ipluta@wp.pl, marchesini@unipg.it
  Subject: Re: insert a sequence
  In-Reply-To: <46443F5F.7060603@wp.pl>

* 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