Re: Execute Immediate

From: Michael Gould <mgould(at)intermodalsoftwaresolutions(dot)net>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Execute Immediate
Date: 2009-07-12 16:35:01
Message-ID: 11b27f3ce880fe77534f5ed2d887b47b@intermodalsoftwaresolutions.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks, that is exactly what I need as a workaround to session variables.
The temp tables will work as we need them as we only have a 5 that are temp
tables and preserve is needed only for the active session, once the session
has ended the temp table should go away.

"Pavel Stehule" wrote:
> 2009/7/12 Michael Gould <mgould(at)intermodalsoftwaresolutions(dot)net>:
>> It does look to me that PostGres supports temporary tables and using with
>> the commit preserve rows appears to work similar to how global or local
temp
>> tables would work. The only thing I need to know (or test) is whether
they
>> are session or connection safe.
>
> temp tables in pg are related to session. After session end, the temp
> tables are automatically dropped.
>
> postgresql has not session variables - but you can emulate it
>
>
http://www.postgres.cz/index.php/PostgreSQL_SQL_Tricks#Any_other_session_variables
> http://www.postgresql.org/docs/8.3/static/plperl-global.html
>
> regards
> Pavel Stehule
>
>>
>> Besides global or local temp tables, I would like to see a CREATE
Variable
>> which would allow a global variable to be created and used.  It would
allow
>> the ability to set and retrieve values once instead of doing the select
each
>> time. These variables have a session life and must be set each time you
>> login to the system.
>>
>> Best Regards
>>
>> Michael Gould
>>
>>
>>
>>
>> "Pavel Stehule" wrote:
>>> Hello
>>>
>>> plpgsql has execute statement, that has similar behave like execute
>>> immediate in others systems.
>>>
>>> note - postgresql doesn't support global temp tables yet.
>>>
>>> regards
>>> Pavel Stehule
>>>
>>> 2009/7/12 Michael Gould <mgould(at)intermodalsoftwaresolutions(dot)net>:
>>>> In many SQL dialets there is the availability of Execute immediate
which
>>>> allows you to build global temp tables or views at run time and even
>> stored
>>>> procedures at runtime and then execute them inline.  Is there a way to
do
>>>> this in PostGres 8.4
>>>>
>>>>
>>>>
>>>> Best Regards
>>>>
>>>>
>>>>
>>>> ________________________________
>>>> Michael Gould, Managing Partner
>>>> Intermodal Software Solutions, LLC
>>>> 904.226.0978
>>>> 904.592.5250 fax
>>>
>>> --
>>> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
>>> To make changes to your subscription:
>>> http://www.postgresql.org/mailpref/pgsql-general
>>>
>>
>> --
>> Michael Gould, Managing Partner
>> Intermodal Software Solutions, LLC
>> 904.226.0978
>> 904.592.5250 fax
>>
>>
>>
>

--
Michael Gould, Managing Partner
Intermodal Software Solutions, LLC
904.226.0978
904.592.5250 fax

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-07-12 17:10:10 Re: Checkpoint Tuning Question
Previous Message Simon Riggs 2009-07-12 16:03:17 Re: Checkpoint Tuning Question