why no create variable

Started by Michael Gouldabout 14 years ago4 messagesgeneral
Jump to latest
#1Michael Gould
mgould@isstrucksoftware.net

There seems to be CREATE everything in Postgres but it would be really
nice to have a CREATE VARIABLE which would allow us to create global
variables. I know there are other techniques but this would be the
easiest when doing a init routine when a user logs in to the
application.

Best Regards

Michael Gould
Intermodal Software Solutions, LLC
904-226-0978

#2Jasen Betts
jasen@xnet.co.nz
In reply to: Michael Gould (#1)
Re: why no create variable

On 2012-03-08, <mgould@isstrucksoftware.net> <mgould@isstrucksoftware.net> wrote:

There seems to be CREATE everything in Postgres but it would be really
nice to have a CREATE VARIABLE which would allow us to create global
variables. I know there are other techniques but this would be the
easiest when doing a init routine when a user logs in to the
application.

create a table.

--
⚂⚃ 100% natural

#3Michael Gould
mgould@isstrucksoftware.net
In reply to: Jasen Betts (#2)
Re: why no create variable

Attachments:

top.letterheadimage/png; name=top.letterheadDownload+3-1
#4Chris Angelico
rosuav@gmail.com
In reply to: Michael Gould (#3)
Re: why no create variable

On Sun, Mar 18, 2012 at 11:26 PM, <mgould@isstrucksoftware.net> wrote:

Getting the information from a table works.  I now have a sessionsettings table, but I'm making way to many calls to it because there is no global pool of variable.  Not IMO an efficient use of a table.

Chances are that table, if you are indeed using it a lot, will be
cached. It'll end up fairly cheap. But just out of vague curiosity, I
wonder how viable it would be to create functions for all your global
variables - each one is thus a function returning its value.

ChrisA