0

Outputting from Postgres to CSV


\f ','
\a
\t
\o /home/john/moocow.csv
SELECT foo,bar FROM whatever;
\o
\q
 
If a field has newlines, this will break. You can do something like  this instead..... 
 
SELECT foo, bar, '"' || REPLACE(REPLACE(field_with_newilne, '\n', '\\n'), '"', '""') || '"'
FROM whatever;
 
Then you can import the data into another database if needed:
copy whatever(foo,bar) FROM
'/home/john/moocow.csv' DELIMITER ','
CSV HEADER; 

0

can't set default printer to Windows terminal server users

The problem can be happened when using Windows 2003 SP1 and terminal server.

Based on the solutions on the internet. Someone mentioned it could be related to problem in registry at [HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows] a advised to export this key from working user profile to non-working one, this works well.

But if you want to make all your users being able to set default printer, try this:

1.) Create some new account and set its profile. This will be a default profile for all accounts created from now on.
2.) Import this key to registry:

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows]
"DebugOptions"="2048"
"Documents"=""
"DosPrint"="no"
"load"=""
"NetMessage"="no"
"NullPort"="None"
"Programs"="com exe bat pif cmd"
"Device"="PDF,winspool,FPP2:"