Question

When i am creating a temp table with identity in vertica , its showing error message as 'cant create a temp table with identity'. Why its not supporting? I need other solution please help me!!

Was it helpful?

Solution

Instead of an identity, which is a special case of a sequence, you can explicitly create a sequence, and use it:

CREATE SEQUENCE tstident_seq;
CREATE TEMPORARY TABLE tstident (id INT DEFAULT NEXTVAL('tstident_seq'), value INT);
INSERT INTO tstident (value) VALUES (42);
-- to check
SELECT * FROM tstident;

The output is, as expected:

 id | value
----+-------
  1 |    42
(1 row)

OTHER TIPS

create a regular table with a default projection with an identity, use it, and drop it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top