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

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: [GENERAL] Specific database vars, again...
Date: 2010-04-20 20:23:34
Message-ID: hql2g3$o6v$1@dough.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice

Glus Xof wrote on 20.04.2010 21:35:
> The idea is storing values that can be remotely accessed by a
> C++/libpqxx application. So, I just see that the first alternative
> that I proposed (the use of \set variables) is really not good. But
> the rest remains...
>
> Now, the only option I have is to create a table, define one column
> per variable, for using just one row. This can be accessed by a select
> sql command...
>

I don't understand why you need a column per variable.

I'd use something like

CREATE TABLE configuration_settings
(
variable_name text primary key not null,
variable_value text
);

INSERT INTO configuration_settings
(variable_name, variable_value)
VALUES
('myfirstvar', 'Some value');

INSERT INTO configuration_settings
(variable_name, variable_value)
VALUES
('mysecondvar', 'Another value');

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Harald Fuchs 2010-04-20 20:25:34 Re: Ltree - how to sort nodes on parent node
Previous Message Glus Xof 2010-04-20 20:08:03 Re: [GENERAL] Specific database vars, again...

Browse pgsql-novice by date

  From Date Subject
Next Message Glus Xof 2010-04-20 21:11:01 Re: [GENERAL] Specific database vars, again...
Previous Message Glus Xof 2010-04-20 20:08:03 Re: [GENERAL] Specific database vars, again...