Re: Specific Database Vars

Поиск
Список
Период
Сортировка
От Adrian von Bidder
Тема Re: Specific Database Vars
Дата
Msg-id 201004211007.37156@fortytwo.ch
обсуждение исходный текст
Ответ на Specific Database Vars  (Glus Xof <gtglus@gmail.com>)
Список pgsql-general
Hi,

On Tuesday 20 April 2010 15.50:35 Glus Xof wrote:

> I know that can use one-row tables but,
>
> I'd like to know if it's possible to define variables attached to one
> specific database,

Yes, one row tables :-)

What I usually do for those random values is a table like "GlobalParameters"
or similar (with three text rows: key, value, type) so I can avoid having 20
separate one row, one column tables for various settings.  Defining a
trigger to coerce the value to the desired type is trivial, so your
application can depend on not having completely bogus values in these
settings.

A more esoteric possibility would be to define functions that return a
constant value.

> & saveables when the database tables are dumped.

Not exactly sure what you mean here.  If you use pg_dump, usually the whole
db is dumped (table definition, data, sequences, functions, ...)

cheers
-- vbi

--
Wenn ein englisches Flugzeug mit deutschen Passagieren über der Grenze
zwischen Frankreich und Spanien abstürzt ... wo werden dann die
Überlebenden begraben?

Вложения

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

Предыдущее
От: Yan Cheng CHEOK
Дата:
Сообщение: Re: unable to start postgresql server services (Windows XP/Professional/Service Pack3)
Следующее
От: Adrian von Bidder
Дата:
Сообщение: Re: Specific database vars, again...