Re: pg and number of parameters by insert

Поиск
Список
Период
Сортировка
От Jean-Christian Imbeault
Тема Re: pg and number of parameters by insert
Дата
Msg-id 3DEDE013.50908@mega-bucks.co.jp
обсуждение исходный текст
Ответ на pg and number of parameters by insert  (pginfo <pginfo@t1.unisoftbg.com>)
Ответы Re: pg and number of parameters by insert  (Dennis Björklund <db@zigo.dhs.org>)
Список 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


В списке pgsql-general по дате отправления:

Предыдущее
От: Thomas Beutin
Дата:
Сообщение: Re: problem starting postgresql i.e postmaster
Следующее
От: suresh s
Дата:
Сообщение: Re: problem startting postgresql