Larry Rosenman wrote:
> [EMAIL PROTECTED] wrote:
>> i found the problem:
>>
>>
>>
>> sys=> create table test2(
>> sys(> id serial,
>> sys(> name varchar(10),
>> sys(> primary key(id)
>> sys(> );
>> NOTICE: CREATE TABLE will create implicit sequence "test2_id_seq"
>> for "serial" column "test2.
On Mon, Jul 05, 2004 at 01:42:35 +0200,
Markus Bertheau <[EMAIL PROTECTED]> wrote:
> ?? ??, 02.07.2004, ?? 19:22, [EMAIL PROTECTED] ??:
> > Hello
> > i have:
> > create table student(
> > id SERIAL NOT NULL,
> > name VARCHAR(35) NOT NULL,
> > primary
Ð ÐÑÐ, 02.07.2004, Ð 19:22, [EMAIL PROTECTED] ÐÐÑÐÑ:
> Hello
> i have:
> create table student(
> id SERIAL NOT NULL,
> name VARCHAR(35) NOT NULL,
> primary key (id)
> );
>
> and when i try to insert like this:
> insert into student (name) values('me');
> i receiv
Martha Stewart called it a Good Thing when [EMAIL PROTECTED] wrote:
> Hello
> i have:
> create table student(
> id SERIAL NOT NULL,
> name VARCHAR(35) NOT NULL,
> primary key (id)
> );
>
> and when i try to insert like this:
> insert into student (name) values('me
[EMAIL PROTECTED] wrote:
> i found the problem:
>
>
>
> sys=> create table test2(
> sys(> id serial,
> sys(> name varchar(10),
> sys(> primary key(id)
> sys(> );
> NOTICE: CREATE TABLE will create implicit sequence "test2_id_seq"
> for "serial" column "test2.id"
> NOTICE: CREATE TABLE / PRIMA
On Fri, Jul 02, 2004 at 21:40:02 +0200,
[EMAIL PROTECTED] wrote:
> i found the problem:
>
>
>
> sys=> create table test2(
> sys(> id serial,
> sys(> name varchar(10),
> sys(> primary key(id)
> sys(> );
> NOTICE: CREATE TABLE will create implicit sequence "test2_id_seq" for
> "serial" column
[EMAIL PROTECTED] wrote:
i found the problem:
sys=> insert into test2 values(1,'myname');
INSERT 18765 1
sys=> insert into test2 (name) values('myname2');
ERROR: duplicate key violates unique constraint "test2_pkey"
sys=>
Why is it so ?
Because you explicitly put in 1:
values(1,'myname')
and t
i found the problem:
sys=> create table test2(
sys(> id serial,
sys(> name varchar(10),
sys(> primary key(id)
sys(> );
NOTICE: CREATE TABLE will create implicit sequence "test2_id_seq" for
"serial" column "test2.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test2_pkey"
fo
The serial datatype creates a sequence in the background. So, in your
example, you'll have a sequence called "student_id_seq". Your sequence was
probably reset, dropped/created, or whatever, to cause it to feed IDs back
that already exist in your table.
On July 2, 2004 10:22 am, [EMAIL PROTEC
On Fri, Jul 02, 2004 at 19:22:17 +0200,
[EMAIL PROTECTED] wrote:
> Hello
> i have:
> create table student(
> id SERIAL NOT NULL,
> name VARCHAR(35) NOT NULL,
> primary key (id)
> );
>
> and when i try to insert like this:
> insert into student (name) values('me
[EMAIL PROTECTED] wrote:
>
> Hello
> i have:
> create table student(
> id SERIAL NOT NULL,
> name VARCHAR(35) NOT NULL,
> primary key (id)
> );
>
> and when i try to insert like this:
> insert into student (name) values('me');
> i receive error:
> ERROR: duplic
Hello
i have:
create table student(
id SERIAL NOT NULL,
name VARCHAR(35) NOT NULL,
primary key (id)
);
and when i try to insert like this:
insert into student (name) values('me');
i receive error:
ERROR: duplicate key violates unique constraint "student_pkey"
W
12 matches
Mail list logo