Hi all, I'm tryng to write query that on commit drops the temporary table but I'm doing someting wrong. According do documentation, I can create a temporary table using this syntax: CREATE TEMP TABLE table_name AS SELECT * from table_select; or I can create a table like this: CREATE TEMP TABLE table_name (fld1 integer) ON COMMIT DROP; But how can I create a table using a query and putting ON COMMIT DROP. Putting this on the end of the first sentence (CREATE TEMP TABLE table_name AS SELECT * from table_select ON COMMIT DROP;) gives the ERROR: syntax error at or near "ON" at character 60. Thanks in advance for you answers. Luis Sousa
Luis Sousa <llsousa@ualg.pt> writes:
> But how can I create a table using a query and putting ON COMMIT DROP.
You can't. Use INSERT ... SELECT to fill the table, instead.
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера