Re: pg and number of parameters by insert

From: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>
To: pginfo <pginfo(at)t1(dot)unisoftbg(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg and number of parameters by insert
Date: 2002-12-04 10:59:31
Message-ID: 3DEDE013.50908@mega-bucks.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

pginfo wrote:
>
> Hmm, Ok I try to explain:

Try again. I can't quite get what you mean.

>If I write: insert into table_1 values ('f1_value',10);
>
>It is error because I try to insert 2 fields in 3-fields table. The
>reason is that I can make write error.

If your table is:

create table_1 (
a text,
b int,
c int
);

Why should insert into table_1 values ('f1_value',10) be an error?

Explain to me why the above SQL query is wrong and maybe I can help you.
But I can't see why a DB should give an error. If you want to force the
user to give values for *every* column when doing an insert then all you
need to do is create a table like this:

create table_1 (
a text NOT NULL,
b int NOT NULL,
c int NOT NULL
);

Maybe I am missing your point?

Jc

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message suresh s 2002-12-04 11:16:12 Re: problem startting postgresql
Previous Message Thomas Beutin 2002-12-04 10:48:35 Re: problem starting postgresql i.e postmaster