"Vilson farias" <vilson(dot)farias(at)digitro(dot)com(dot)br> writes:
>> You just do it.
> Great, it's so simple... thanks Tom.
> I just have another two questions :
> Is the index automaticly removed when connection is closed?
> The index is visible only in the actual session, am I right?
Yup. An index on a temp table is temp in just the same way as the temp
table itself. There's no "TEMP" option in CREATE INDEX, it's just done
that way for you. (Any toast table needed is also handled correctly,
although the mechanism is slightly different.)
regards, tom lane