Обсуждение: Specific database vars, again...

Поиск
Список
Период
Сортировка

Specific database vars, again...

От
Glus Xof
Дата:
Hi again,

Maybe, I didn't explain my question enough.

I need to record properties that belongs to an specific database (and
so, they work at database level... not at global scope:

* Could I use the \set statements ? but... the vars defined are not in
a database scope but a global, aren't they ?... furthermore, could
save these vars when try to dump the database ??? )

* Or, must to create an specific one-row table ?.

Glus

Re: Specific database vars, again...

От
Adrian von Bidder
Дата:
On Tuesday 20 April 2010 19.53:34 Glus Xof wrote:
> Could I use the \set statements

\set is a feature of the "psql" commandline frontend.  These values are
never even seen by the database and are not preserved anywhere.  Also, if
you develop applications, you'll usually not use the psql frontend but use
PostgreSQL through some other interface (libpq, Perl DBD, JDBC, ...), so
there won't be a "\set" command.

cheers
-- vbi

--
If you continually give you will continually have.

Вложения

Re: [NOVICE] Specific database vars, again...

От
Rene Schickbauer
Дата:
Glus Xof wrote:
> Hi again,
>
> Maybe, I didn't explain my question enough.
>
> I need to record properties that belongs to an specific database (and
> so, they work at database level... not at global scope:
>
> * Could I use the \set statements ? but... the vars defined are not in
> a database scope but a global, aren't they ?... furthermore, could
> save these vars when try to dump the database ??? )
>
> * Or, must to create an specific one-row table ?.

The first things to ask is: Do multiple transactions change this data?
What is something goes wrong - do you need rollback to work?

Anyway, a table with one or only a few rows is very likely to be cached
in RAM by postgres anyway if you access it regulary. So performance
shouldn't be an issue.

LG
Rene

Re: Specific database vars, again...

От
Glus Xof
Дата:
Thanks to all that replied my question !

I'll implement the Thomas Kellerer's.

Glus