From: | Greg Youngblood <YoungblG(at)houstoncellular(dot)com> |
---|---|
To: | "'Marc Eggenberger'" <me(at)ieo(dot)ch>, pgsql-general(at)postgreSQL(dot)org |
Subject: | RE: [GENERAL] Still the problem with the autoincrement field |
Date: | 1998-10-06 14:48:31 |
Message-ID: | 2B9713A99045D211BB4E0008C75668690B1149@SCORPEXC1.houstoncell.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Try:
insert into
offene_stellen (bezeichnung,arbeitsort,berater,gefordert,geboten)
values
('Maurer', 'Buchs', 'Rheinhalter Claudio', 'flexibilitaet', 'gutes Team');
Gregory S. Youngblood
ext 2164
-----Original Message-----
From: Marc Eggenberger [mailto:me(at)ieo(dot)ch]
Sent: Tuesday, October 06, 1998 4:30 AM
To: pgsql-general(at)postgreSQL(dot)org
Subject: [GENERAL] Still the problem with the autoincrement field
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(at)ieo(dot)ch
Leimbachstr. 56 Tel 01/4802800
8041 Zuerich Fax 01/4802801
=====================================
From | Date | Subject | |
---|---|---|---|
Next Message | Lorenzo Huerta | 1998-10-06 15:21:22 | Re: [GENERAL] status on IPv6 implementation... |
Previous Message | G | 1998-10-06 13:13:38 | Performance |