Re: How to INSERT empty line into SEQUENTIAL table from PHP
От | Julius Tuskenis |
---|---|
Тема | Re: How to INSERT empty line into SEQUENTIAL table from PHP |
Дата | |
Msg-id | 48560E38.4070907@gmail.com обсуждение исходный текст |
Ответ на | How to INSERT empty line into SEQUENTIAL table from PHP (Stefan Schwarzer <stefan.schwarzer@grid.unep.ch>) |
Ответы |
Re: How to INSERT empty line into SEQUENTIAL table from PHP
|
Список | pgsql-general |
Hi, Stefan. your second example should work for you. INSERT INTO table_xx (field2, field3, field4) VALUES ('', '', ''); (keeping in mind, that your ID column is of type serial or has DEFAULT NEXTVAL('some_sequence') ). You can also insert values yourself: INSERT INTO table_xx (ID, field2, field3, field4) VALUES (NEXTVAL('some_sequence'), '', '', ''); Julius Tuskenis Stefan Schwarzer rašė: > Hi, > > rahter dump question, I guess.... > > But I have a table with a sequential index field, into which I would > like to add from time to time another line (via webbrowser), which in > turn, stays first empty, before it's being filled in later (via > webbrowser). > > Because the ID field is sequential and indexed, I can't use > > INSERT INTO table_xx (ID, field2, field3, field4) VALUES ('', '', > '', ''); > > neither (skipping ID because it should be filled in automatically): > > INSERT INTO table_xx (field2, field3, field4) VALUES ('', '', ''); > > How am I supposed to do it? > > Thanks for any hints, > > Stef > >
В списке pgsql-general по дате отправления: