pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marc Eggenberger <me@ieo.ch>
To: pgsql-general@postgresql.org
Subject: Still the problem with the autoincrement field
Date: Tue, 6 Oct 1998 11:29:39 +0200
Message-ID: <199810060930.LAA10725@linux1.ieo.ch> (raw)

Hi there.

As two people said I created now a sequence .... I have the following now:

Database    = jobforum
 +------------------+----------------------------------+----------+
 |  Owner           |             Relation             |   Type   |
 +------------------+----------------------------------+----------+
 | postgres         | offene_stellen                   | table    |
 | postgres         | seq                              | sequence |
 +------------------+----------------------------------+----------+

Table    = offene_stellen
+----------------------------------+----------------------------------+-------+
|              Field               |              Type                | Length|
+----------------------------------+----------------------------------+-------+
| id                               | int4 default nextval ( 'seq' )   |     4 |
| bezeichnung                      | char()                           |   100 |
| arbeitsort                       | char()                           |   100 |
| berater                          | char()                           |   100 |
| gefordert                        | char()                           |  1000 |
| geboten                          | char()                           |  1000 |
+----------------------------------+----------------------------------+-------+

Table    = seq
+----------------------------------+----------------------------------+-------+
|              Field               |              Type                | Length|
+----------------------------------+----------------------------------+-------+
| sequence_name                    | name                             |    32 |
| last_value                       | int4                             |     4 |
| increment_by                     | int4                             |     4 |
| max_value                        | int4                             |     4 |
| min_value                        | int4                             |     4 |
| cache_value                      | int4                             |     4 |
| is_cycled                        | char                             |     1 |
| is_called                        | char                             |     1 |
+----------------------------------+----------------------------------+-------+


and when I want to add some data .. how to do this?
when I do the following:

insert into offene_stellen values ('', 'Maurer', 'Buchs', 'Rheinhalter Claudio', 'flexibilitaet', 'gutes Team');

the id field is always 0, and when I do a:

insert into offene_stellen values ('Maurer', 'Buchs', 'Rheinhalter Claudio', 'flexibilitaet', 'gutes Team');

I get a:
ERROR:  pg_atoi: error in "Maurer": can't parse "Maurer"


How do I add data, so that the id field is autoincremented?


--
mit freundlichen Gruessen
=====================================
Eggenberger Marc            me@ieo.ch
Leimbachstr. 56        Tel 01/4802800
8041 Zuerich            Fax 01/4802801
=====================================



view thread (4+ messages)  latest in thread

Message-ID: <199810060930.LAA10725@linux1.ieo.ch>
Permalink:  ../199810060930.LAA10725@linux1.ieo.ch/
Also on:    postgresql.org/message-id/199810060930.LAA10725@linux1.ieo.ch

 · 

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: me@ieo.ch, pgsql-general@postgresql.org
  Subject: Re: Still the problem with the autoincrement field
  In-Reply-To: <199810060930.LAA10725@linux1.ieo.ch>
  References: <199810060930.LAA10725@linux1.ieo.ch>

* 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