Re: Self-referencing table question

Поиск
Список
Период
Сортировка
От Edmund Bacon
Тема Re: Self-referencing table question
Дата
Msg-id 424316EC.2090207@onesystem.com
обсуждение исходный текст
Ответ на Re: Self-referencing table question  (Sean Davis <sdavis2@mail.nih.gov>)
Ответы Re: Self-referencing table question  (Sean Davis <sdavis2@mail.nih.gov>)
Список pgsql-sql
Sean Davis wrote:

> Nice.  Thanks for doing my work for me!

Yeah, well put it down to a certain amount of curiosity and a slack 
period at work ...

> I guess I will have to think about it more seriously.
>
> It could be a slight bit complicated because my code is running under 
> mod_perl, so connections are cached.  As I understand it, the temp 
> table will stick around, so I will have to be careful to explicitly 
> drop it if I don't want it to persist?  

I'm guessing so.    However you could put everything in a transaction 
and use CREATE TEMP TABLE ... ON COMMIT DROP, and use INSERT INTO rather 
than SELECT INTO.  The speed should be about equivalent - but you'd have 
to test to make sure.

> Also each table will need a unique name (I have a session_id I can 
> use), as it is possible that multiple temp tables will exist and be 
> visible to each other?

Each session (connection in your case?) has it's own temporary table 
space, so you shouldn't have to worry about that.

>  
>
> Thanks again,
> Sean
>

-- 
Edmund Bacon <ebacon@onesystem.com>



В списке pgsql-sql по дате отправления:

Предыдущее
От: Sean Davis
Дата:
Сообщение: Re: Self-referencing table question
Следующее
От: "Moran.Michael"
Дата:
Сообщение: Re: Funtions + plpgsql + contrib/pgcrypto = ??