rename pg_log directory?

Started by Peter Eisentrautalmost 9 years ago16 messages
#1Peter Eisentraut
peter.eisentraut@2ndquadrant.com

How about changing the default for log_directory from 'pg_log' to, say,
'log'?

We have been emphasizing that the prefix "pg_" is for things reserved to
PostgreSQL, whereas the pg_log directory is entirely an arbitrary
user-space name. Also, with a different name, the directory would stand
out more between all the other pg_* directories in the data directory.

Obviously, users could set the name back to the old one if they want.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

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

#2David Fetter
david@fetter.org
In reply to: Peter Eisentraut (#1)
Re: rename pg_log directory?

On Mon, Feb 27, 2017 at 09:05:16AM -0500, Peter Eisentraut wrote:

How about changing the default for log_directory from 'pg_log' to, say,
'log'?

+1

A lot of work has already gone into this release to clarify what
things are PostgreSQL internals and which ones are not. This will
help.

Yes, monitoring tools will need to take this into account. The people
this will help will be the majority of our users, namely people who
have yet to adopt PostgreSQL[1]The project could fail completely next week, making our past and current users could be the majority, but that would be very sad. -- David Fetter <david(at)fetter(dot)org> http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com.

Best,
David.

[1]: The project could fail completely next week, making our past and current users could be the majority, but that would be very sad. -- David Fetter <david(at)fetter(dot)org> http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
current users could be the majority, but that would be very sad.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

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

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#1)
Re: rename pg_log directory?

Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:

How about changing the default for log_directory from 'pg_log' to, say,
'log'?

We have been emphasizing that the prefix "pg_" is for things reserved to
PostgreSQL, whereas the pg_log directory is entirely an arbitrary
user-space name. Also, with a different name, the directory would stand
out more between all the other pg_* directories in the data directory.

No objection to the basic point, but "log" seems perhaps a little too
generic to me. Would something like "server_log" be better?

regards, tom lane

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

#4Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#3)
Re: rename pg_log directory?

On Mon, Feb 27, 2017 at 09:51:26AM -0500, Tom Lane wrote:

Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:

How about changing the default for log_directory from 'pg_log' to, say,
'log'?

We have been emphasizing that the prefix "pg_" is for things reserved to
PostgreSQL, whereas the pg_log directory is entirely an arbitrary
user-space name. Also, with a different name, the directory would stand
out more between all the other pg_* directories in the data directory.

No objection to the basic point, but "log" seems perhaps a little too
generic to me. Would something like "server_log" be better?

"activity_log"? I like the idea of a rename.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +

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

#5Magnus Hagander
magnus@hagander.net
In reply to: Bruce Momjian (#4)
Re: rename pg_log directory?

On Tue, Feb 28, 2017 at 4:01 AM, Bruce Momjian <bruce@momjian.us> wrote:

On Mon, Feb 27, 2017 at 09:51:26AM -0500, Tom Lane wrote:

Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:

How about changing the default for log_directory from 'pg_log' to, say,
'log'?

We have been emphasizing that the prefix "pg_" is for things reserved

to

PostgreSQL, whereas the pg_log directory is entirely an arbitrary
user-space name. Also, with a different name, the directory would

stand

out more between all the other pg_* directories in the data directory.

No objection to the basic point, but "log" seems perhaps a little too
generic to me. Would something like "server_log" be better?

"activity_log"? I like the idea of a rename.

server_log seems like a better choice then I think. So +1 for that.

In theory cluster_log since it's a "cluster level log", but given how many
people already get confused by the term cluster being used that way, I
think that while maybe technically correct, that would be a very bad
choice.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

#6Jorge Solórzano
jorsol@gmail.com
In reply to: Magnus Hagander (#5)
Re: rename pg_log directory?

On Tue, Feb 28, 2017 at 5:07 AM, Magnus Hagander <magnus@hagander.net>
wrote:

server_log seems like a better choice then I think. So +1 for that.

​server_log +1

Show quoted text

In theory cluster_log since it's a "cluster level log", but given how many
people already get confused by the term cluster being used that way, I
think that while maybe technically correct, that would be a very bad
choice.

#7Peter Eisentraut
peter.eisentraut@2ndquadrant.com
In reply to: Tom Lane (#3)
Re: rename pg_log directory?

On 2/27/17 09:51, Tom Lane wrote:

No objection to the basic point, but "log" seems perhaps a little too
generic to me. Would something like "server_log" be better?

Well, "log" is pretty well established. There is /var/log, and if you
unpack a, say, Kafka or Cassandra distribution, they also come with a
log or logs directory.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

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

#8Peter Eisentraut
peter.eisentraut@2ndquadrant.com
In reply to: Magnus Hagander (#5)
Re: rename pg_log directory?

On 2/28/17 06:07, Magnus Hagander wrote:

server_log seems like a better choice then I think. So +1 for that.

In theory cluster_log since it's a "cluster level log", but given how
many people already get confused by the term cluster being used that
way, I think that while maybe technically correct, that would be a very
bad choice.

Well, the premise was that we wanted to rename xlog because people think
that the "log" is "the log". So there should be no confusion if there
is only one "log" left. (cough, cough, clog, cough, cough) I think if
we invent nonstandard names, it will be more confusing, not less.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

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

#9Andreas Karlsson
andreas@proxel.se
In reply to: Peter Eisentraut (#7)
Re: rename pg_log directory?

On 03/01/2017 05:49 AM, Peter Eisentraut wrote:

On 2/27/17 09:51, Tom Lane wrote:

No objection to the basic point, but "log" seems perhaps a little too
generic to me. Would something like "server_log" be better?

Well, "log" is pretty well established. There is /var/log, and if you
unpack a, say, Kafka or Cassandra distribution, they also come with a
log or logs directory.

+1, though I am also fine with server_log.

Andreas

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

#10Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andreas Karlsson (#9)
Re: rename pg_log directory?

Andreas Karlsson <andreas@proxel.se> writes:

On 03/01/2017 05:49 AM, Peter Eisentraut wrote:

On 2/27/17 09:51, Tom Lane wrote:

No objection to the basic point, but "log" seems perhaps a little too
generic to me. Would something like "server_log" be better?

Well, "log" is pretty well established. There is /var/log, and if you
unpack a, say, Kafka or Cassandra distribution, they also come with a
log or logs directory.

+1, though I am also fine with server_log.

FWIW, I'm not strongly advocating for "server_log", I just thought it
was worth having some discussion around the name. Peter's point above
is pretty good though.

regards, tom lane

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

#11Andreas Karlsson
andreas@proxel.se
In reply to: Peter Eisentraut (#1)
1 attachment(s)
Re: rename pg_log directory?

On 02/27/2017 03:05 PM, Peter Eisentraut wrote:

How about changing the default for log_directory from 'pg_log' to, say,
'log'?

I have attached a patch which does this. I do not care much about which
name is picked as long as we get rid off the "pg_" prefix.

Btw, is there a reason for why global and base do not have the "pg_" prefix?

Andreas

Attachments:

rename-log-dir-v1.patchtext/x-diff; name=rename-log-dir-v1.patchDownload
commit 0b71fcdb328f05349775675e0491ba1b82127d4e
Author: Andreas Karlsson <andreas@proxel.se>
Date:   Mon Mar 6 23:52:49 2017 +0100

    Rename default log directory from pg_log to log

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index cd82c04b05..4ee1f605bc 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -4324,8 +4324,8 @@ SELECT * FROM parent WHERE key = 2400;
         find the logs currently in use by the instance. Here is an example of
         this file's content:
 <programlisting>
-stderr pg_log/postgresql.log
-csvlog pg_log/postgresql.csv
+stderr log/postgresql.log
+csvlog log/postgresql.csv
 </programlisting>
 
         <filename>current_logfiles</filename> is recreated when a new log file
@@ -4427,7 +4427,7 @@ local0.*    /var/log/postgresql
         cluster data directory.
         This parameter can only be set in the <filename>postgresql.conf</>
         file or on the server command line.
-        The default is <literal>pg_log</literal>.
+        The default is <literal>log</literal>.
        </para>
       </listitem>
      </varlistentry>
diff --git a/doc/src/sgml/file-fdw.sgml b/doc/src/sgml/file-fdw.sgml
index 309a303e03..359f222352 100644
--- a/doc/src/sgml/file-fdw.sgml
+++ b/doc/src/sgml/file-fdw.sgml
@@ -262,7 +262,7 @@ CREATE FOREIGN TABLE pglog (
   location text,
   application_name text
 ) SERVER pglog
-OPTIONS ( filename '/home/josh/9.1/data/pg_log/pglog.csv', format 'csv' );
+OPTIONS ( filename '/home/josh/9.1/data/log/pglog.csv', format 'csv' );
 </programlisting>
   </para>
 
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 0707f66631..69b9cdacff 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -3298,7 +3298,7 @@ static struct config_string ConfigureNamesString[] =
 			GUC_SUPERUSER_ONLY
 		},
 		&Log_directory,
-		"pg_log",
+		"log",
 		check_canonical_path, NULL, NULL
 	},
 	{
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index 157d775853..e6dbc31591 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -343,7 +343,7 @@
 					# (change requires restart)
 
 # These are only used if logging_collector is on:
-#log_directory = 'pg_log'		# directory where log files are written,
+#log_directory = 'log'			# directory where log files are written,
 					# can be absolute or relative to PGDATA
 #log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'	# log file name pattern,
 					# can include strftime() escapes
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index e5cb348f4c..1c87e39e0d 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -560,7 +560,7 @@ sub _backup_fs
 		$backup_path,
 		filterfn => sub {
 			my $src = shift;
-			return ($src ne 'pg_log' and $src ne 'postmaster.pid');
+			return ($src ne 'log' and $src ne 'postmaster.pid');
 		});
 
 	if ($hot)
diff --git a/src/test/perl/RecursiveCopy.pm b/src/test/perl/RecursiveCopy.pm
index 3e98813286..457488ba5b 100644
--- a/src/test/perl/RecursiveCopy.pm
+++ b/src/test/perl/RecursiveCopy.pm
@@ -48,9 +48,9 @@ attempted.
 
  RecursiveCopy::copypath('/some/path', '/empty/dir',
     filterfn => sub {
-		# omit pg_log and contents
+		# omit log and contents
 		my $src = shift;
-		return $src ne 'pg_log';
+		return $src ne 'log';
 	}
  );
 
#12Bruce Momjian
bruce@momjian.us
In reply to: Andreas Karlsson (#11)
Re: rename pg_log directory?

On Tue, Mar 7, 2017 at 12:01:04AM +0100, Andreas Karlsson wrote:

On 02/27/2017 03:05 PM, Peter Eisentraut wrote:

How about changing the default for log_directory from 'pg_log' to, say,
'log'?

I have attached a patch which does this. I do not care much about which name
is picked as long as we get rid off the "pg_" prefix.

Btw, is there a reason for why global and base do not have the "pg_" prefix?

"data" and "base" where chosen because it is a "data-base", but with the
pg_ prefixes it would be a pg_data_pg_base. ;-)

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +

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

#13Andreas Karlsson
andreas@proxel.se
In reply to: Bruce Momjian (#12)
Re: rename pg_log directory?

On 03/09/2017 11:25 PM, Bruce Momjian wrote:

"data" and "base" where chosen because it is a "data-base", but with the
pg_ prefixes it would be a pg_data_pg_base. ;-)

Haha, I had not spotted that one despite always naming my data directory
"data" while developing. Fun little tidbit there.

Andreas

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

#14Bruce Momjian
bruce@momjian.us
In reply to: Andreas Karlsson (#13)
Re: rename pg_log directory?

On Fri, Mar 10, 2017 at 11:23:54AM +0100, Andreas Karlsson wrote:

On 03/09/2017 11:25 PM, Bruce Momjian wrote:

"data" and "base" where chosen because it is a "data-base", but with the
pg_ prefixes it would be a pg_data_pg_base. ;-)

Haha, I had not spotted that one despite always naming my data directory
"data" while developing. Fun little tidbit there.

Yeah, we can thank the creative Berkeley students for that one, I think.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +

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

#15Peter Eisentraut
peter.eisentraut@2ndquadrant.com
In reply to: Andreas Karlsson (#11)
Re: rename pg_log directory?

On 3/6/17 18:01, Andreas Karlsson wrote:

On 02/27/2017 03:05 PM, Peter Eisentraut wrote:

How about changing the default for log_directory from 'pg_log' to, say,
'log'?

I have attached a patch which does this. I do not care much about which
name is picked as long as we get rid off the "pg_" prefix.

Committed.

While digging around a bit, I found in release-old.sgml that before
PostgreSQL 7.2, pg_clog was called pg_log. Go figure.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

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

#16Andreas Karlsson
andreas@proxel.se
In reply to: Peter Eisentraut (#15)
Re: rename pg_log directory?

On 03/27/2017 04:38 PM, Peter Eisentraut wrote:

Committed.

Thanks!

While digging around a bit, I found in release-old.sgml that before
PostgreSQL 7.2, pg_clog was called pg_log. Go figure.

Yeah, I noticed that too when writing the patch. :)

Andreas

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