Re: in PostgreSQL 9.0.2 / pgAdmin III - ERROR: relation "[table name]" already exists
В списке pgsql-novice по дате отправления:
| От | Mark Kelly |
|---|---|
| Тема | Re: in PostgreSQL 9.0.2 / pgAdmin III - ERROR: relation "[table name]" already exists |
| Дата | |
| Msg-id | 201012251539.28830.pgsql@wastedtimes.net обсуждение исходный текст |
| Ответ на | in PostgreSQL 9.0.2 / pgAdmin III - ERROR: relation "[table name]" already exists (thewhitelantern <thewhitelantern@gmail.com>) |
| Список | pgsql-novice |
Hi. On Saturday 25 Dec 2010 at 15:10 thewhitelantern wrote: [snip] > However, I'm called to put a WHERE filter on the code at the end > > WHERE > id = 524 > ; > > THen when I try to execute it again, it gives this error message > > ERROR: relation "entries" already exists I suspect that you are running ALL of the code above again, with the "WHERE" clause appended. What you actually need to do is ONLY run the SELECT instruction again. The error is because you are trying to create the table (called a "relation" in this context) again. Instead of running the whole lot again the second time, just run the query: SELECT title , category FROM entries WHERE id = 524 ; All the stuff before that only has to be done once. > So does this mean that I have to delete the database EVERY TIME I CHANGE > THE CODE?!? No :) Cheers, Mark
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера