Thread: Initialization on server start-up
Is there a way to initialize a field in a table in a specific database on server startup? Alex
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 >
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
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