[ADMIN] logfile per DataBase

2012-02-24 Thread Lutz Steinborn
Hello,

is it possible to configure postgresql to produce one logfile per database
in a cluster?
I can't find any hint about this in the doc.

Something like:
log_filename = 'postgresql-[DBNAME]-%Y-%m-%d_%H%M%S.log'

It would be very use full for a development server. 

have a happy weekend

Lutz

-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


Re: [ADMIN] logfile per DataBase

2012-02-24 Thread Igor Neyman


 -Original Message-
 From: Lutz Steinborn [mailto:l.steinb...@4c-ag.de]
 Sent: Friday, February 24, 2012 8:55 AM
 To: pgsql-admin@postgresql.org
 Subject: logfile per DataBase
 
 Hello,
 
 is it possible to configure postgresql to produce one logfile per
 database in a cluster?
 I can't find any hint about this in the doc.
 
 Something like:
 log_filename = 'postgresql-[DBNAME]-%Y-%m-%d_%H%M%S.log'
 
 It would be very use full for a development server.
 
 have a happy weekend
 
 Lutz

No, it is not possible.

But, inside log file you can use %d for log_line_prefix to specify
which db emitted particular line.

Regards,
Igor Neyman 


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


[ADMIN] Problems with pg_restore (plpgsql already exists)

2012-02-24 Thread Brian Weaver
I'm running into a problem where I can't restore a previous database using 
pg_restore because the plpgsql language already exists. All the searching I've 
done implies that the fix is to created the database from template0, but that 
doesn't seem to be working in my case for some reason. I'm running 9.1.2 and 
here's the basic procedure that I'm using to try to restore if anyone has any 
ideas why it's not working.

1) Create a new data directory
2) Run initdb to initialize the database directories
3) Run 'pg_restore --create postgresql.pgr --dbname=template1'

I use the '--dbname=template1' option to allow the process to connect to the 
server and create the database for me. It's my understanding from reading the 
man page that's the correct way to connect. Since it's a new database there's 
no other database to connect to since template0 refuses connections (or at 
least it has when I've tried recently).  Also, this is a new problem I didn't 
run into when I was using PostgreSQL 8.4 and it's only happened since I've 
upgraded to 9.1.2.

If I just run 'pg_restore --create postgresql.pgr' I see the following relevant 
lines:

CREATE DATABASE foo WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 
'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8';


ALTER DATABASE foo OWNER TO foo;

\connect foo

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

--
-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: postgres
--

CREATE PROCEDURAL LANGUAGE plpgsql;


ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO postgres;

SET search_path = public, pg_catalog;


-- END SNIPPET

As you can see the database is cloned from template0 so I don't know why 
plpgsql would already exists.

-- Brian
-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


Re: [ADMIN] Problems with pg_restore (plpgsql already exists)

2012-02-24 Thread Brian Weaver
So when did the installation of PL/PgSQL into all databases become standard
operating procedure? It wasn't standard (or at least it didn't choke) on
the installation of versions 8.3 and 8.4 that I have used on CentOS 5.

Seems like a fairly substantial change. Did I miss it in the release notes?

-- Brian

On Friday, February 24, 2012, Dinesh Bhandary wrote:

 one way to get over this issue is to do  pg_dump of postgres 8.4 db using
 postgres 9.1.2 binaries.
 Here is a note from postgres 9.1.2 documentation

 In a default PostgreSQL installation, the handler for the PL/pgSQL
 language is built and installed into the library directory; furthermore,
 the PL/pgSQL language itself is installed in all databases. If Tcl support
 is configured in, the handlers for PL/Tcl and PL/TclU are built and
 installed in the library directory, but the language itself is not
 installed in any database by default. Likewise, the PL/Perl and PL/PerlU
 handlers are built and installed if Perl support is configured, and the
 PL/PythonU handler is installed if Python support is configured, but these
 languages are not installed by default.

 hope this helps.

 Thanks.
 Dinesh

 On 2/24/2012 2:30 PM, Brian Weaver wrote:

 CREATE DATABASE foo WITH TEMPLATE = template0 ENCODING = 'UTF8'
 LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8';



 --
 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
 To make changes to your subscription:
 http://www.postgresql.org/**mailpref/pgsql-adminhttp://www.postgresql.org/mailpref/pgsql-admin



-- 

/* insert witty comment here */