this is my original postgresql.conf:
#
#Wed Jul 23 16:13:09 IST 2014
lc_monetary='English_India.1252' # locale for monetary formatting
listen_addresses='*' # what IP address(es) to listen on;
max_connections=100 # (change requires restart)
port=5433
shared_buffers=128MB # min 128kB
log_timezone='Asia/Calcutta'
timezone='Asia/Calcutta'
datestyle='iso, dmy'
lc_numeric='English_India.1252' # locale for number formatting
lc_time='English_India.1252' # locale for time formatting
default_text_search_config='pg_catalog.english'
lc_messages='English_India.1252' # locale for system error message
I'm updating postgresql.conf at runtime from java using following code:
Properties input = new java.util.Properties();
InputStream reader=new
FileInputStream(System.getProperty("user.dir")+"/postgresql.conf");
input.load(reader);
input.setProperty("port", String.valueOf(Installer.newport));
OutputStream confFile=new FileOutputStream(System.getProperty("user.dir")+"\\postgresql.conf");
input.store(confFile, "");
confFile.close();
This code results in following postgresql.conf :
#
#Wed Jul 23 16:13:09 IST 2014
lc_monetary='English_India.1252'\t\t\t\# locale for monetary formatting
listen_addresses='*'\t\t\# what IP address(es) to listen on;
max_connections=100\t\t\t\# (change requires restart)
port=5433
shared_buffers=128MB\t\t\t\# min 128kB
log_timezone='Asia/Calcutta'
timezone='Asia/Calcutta'
datestyle='iso, dmy'
lc_numeric='English_India.1252'\t\t\t\# locale for number formatting
lc_time='English_India.1252'\t\t\t\t\# locale for time formatting
default_text_search_config='pg_catalog.english'
lc_messages='English_India.1252'\t\t\t\# locale for system error message
Somehow the '\t' characters are getting added or rather seen as escape sequence.
I've also tried by specifying encoding with:
Reader reader = new InputStreamReader(new FileInputStream(System.getProperty("user.dir")+"/postgresql.conf"),"UTF-8");
and
OutputStreamWriter confFile=new OutputStreamWriter(new FileOutputStream(System.getProperty("user.dir")+"\\postgresql.conf"),"UTF-8");
Whats going wrong here?