Thread: Initialization on server start-up

Initialization on server start-up

From
Alex du Plessis
Date:
Is there a way to initialize a field in a table in a specific database
on server startup?

Alex

Re: Initialization on server start-up

From
Abdelkader Boudih
Date:
Are you speaking about the default values ? Your question is a little
odd! please explain your problem a little more
regards

Alex du Plessis wrote:
> Is there a way to initialize a field in a table in a specific database
> on server startup?
>
> Alex
>


Re: Initialization on server start-up

From
Bob McConnell
Date:
Abdelkader Boudih wrote:
> Are you speaking about the default values ? Your question is a little
> odd! please explain your problem a little more
> regards
>
> Alex du Plessis wrote:
>> Is there a way to initialize a field in a table in a specific database
>> on server startup?
>>
>> Alex

Sounds pretty clear to me. Every time the server starts up, he wants a
specified field in one table to be set to some known value, possibly a
time stamp. I suspect he wants to use it to detect when the server has
been down.

Bob McConnell


Re: Initialization on server start-up

From
Frank Bax
Date:
Alex du Plessis wrote:
> Is there a way to initialize a field in a table in a specific database
> on server startup?


Simple; just add something like this to a server startup script:

psql -c 'update table set field=value where ...' database user

or

echo 'update table set field=value where ...' | psql database user