Re: [PATCHES] [HACKERS] 8.0 libpq: missing get_home_path()

2004-08-19 Thread Gaetano Mendola
Bruce Momjian wrote:
OK, patch attached and applied.  I also updated the docs.
Just a note for the docs:
%USERPROFILE%/.pgpass shall be not %USERPROFILE%\.pgpass ?
Regards
Gaetano Mendola
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [PATCHES] [BUGS] 8.0.0beta1: -lpthread missing

2004-08-19 Thread Bruce Momjian
Martin Münstermann wrote:
 Bruce Momjian wrote:
  OK, I got it working now.  Seems the code needed more help to loop than
  I though, and of course trying to change it as little as possible caused
  me to miss that.
  
  The attached, applied patch properly aggregates the thread flags.  The
  bad news is that on my platform that needs _no_ thread flags or
  libraries I have:
  
  PTHREAD_CFLAGS  =3D   -Kthread -kthread -pthread -pthreads
  -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS
  PTHREAD_LIBS=3D
  
  I assume those are just ignored for portability so I assume we are OK.
 
 Current CVS is working for Solaris, too.
 Compiles and libthread.so is used at runtime. :-)
 
 PTHREAD_CFLAGS  =  -pthreads   -Kthread -kthread -pthread 
 -pthreads  -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS
 PTHREAD_LIBS=  -lpthread-lpthread
 
 The -Kthread -kthread is not needed here, but is included because gcc 
 3.2 does not treat them as error, but just dumps out gcc: unrecognized 
 option `-kthread'.

Yep, same here.  I am hoping we come up with a cleaner solution someday. :-)

But I am thrilled to have this threading all automated now.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [PATCHES] [HACKERS] 7.4.3 8.0.0beta1 + Solaris 9: default pg_hba.conf

2004-08-19 Thread Andrew Dunstan

Tom Lane wrote:
Andrew Dunstan [EMAIL PROTECTED] writes:
 

At this stage of the game I would just change pg_hba.conf.sample to use 
'127.0.0.1/32' instead of '127.0.0.1 255.255.255.255'.
   

Yeah, that's probably the path of least resistance.  Note that the
comments and possibly the SGML docs need to be adjusted to match,
however, so it's not quite a one-liner.
 

I think the SGML is fine. Here's a patch for the sample file.
cheers
andrew
Index: src/backend/libpq/pg_hba.conf.sample
===
RCS file: /projects/cvsroot/pgsql-server/src/backend/libpq/pg_hba.conf.sample,v
retrieving revision 1.49
diff -c -r1.49 pg_hba.conf.sample
*** src/backend/libpq/pg_hba.conf.sample	1 Aug 2004 05:58:35 -	1.49
--- src/backend/libpq/pg_hba.conf.sample	19 Aug 2004 17:30:56 -
***
*** 35,40 
--- 35,43 
  # encrypted passwords.  OPTION is the ident map or the name of the PAM
  # service.
  #
+ # Note: On some Solaris systems, an IP-MASK of 255.255.255.255 is known not to work.
+ # The corresponding CIDR-MASK of /32 does work.
+ #
  # Database and user names containing spaces, commas, quotes and other special
  # characters can be quoted. Quoting one of the keywords all, sameuser or
  # samegroup  makes the name lose its special character, and just match a 
***
*** 49,56 
  # --
  #
  # If you want to allow non-local connections, you need to add more
! # host records.  Also, remember TCP/IP connections are only enabled
! # if you enable tcpip_socket in postgresql.conf.
  
  @authcomment@
  
--- 52,61 
  # --
  #
  # If you want to allow non-local connections, you need to add more
! # host records. In that case you will also need to make PostgreSQL listen
! # on a non-local interface via the listen_addresses configuration parameter, or
! # the -i or -h command line switches.
! #
  
  @authcomment@
  
***
*** 58,63 
  
  local   all all @authmethod@
  # IPv4-style local connections:
! hostall all 127.0.0.1 255.255.255.255   @authmethod@
  # IPv6-style local connections:
  hostall all ::1/128 @authmethod@
--- 63,68 
  
  local   all all @authmethod@
  # IPv4-style local connections:
! hostall all 127.0.0.1/32@authmethod@
  # IPv6-style local connections:
  hostall all ::1/128 @authmethod@

---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [PATCHES] Postgresql.conf Documentation change

2004-08-19 Thread Bruce Momjian

Patch withdrawn to be revisited in 8.1.

---

Josh Berkus wrote:
 Tom,
 
 Attached is that patch I talked to you about on hackers.   It changes the 
 description at the top and uncomments most (but not all) of the lines in an 
 effort to make it clear that commenting is not a way to restore the defaults.
 
 I've tested this on my machine and we end up with the exact same defaults with 
 this patch as without, so no changes to initdb should be required.
 
 -- 
 -Josh Berkus
 
 __AGLIO DATABASE SOLUTIONS___
 Josh Berkus
 Enterprise vertical business[EMAIL PROTECTED]
  and data analysis solutions(415) 752-2500
   and database optimization   fax 752-2387
   utilizing Open Source technology  San Francisco

[ Attachment, skipping... ]

 
 ---(end of broadcast)---
 TIP 7: don't forget to increase your free space map settings

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


Re: [PATCHES] [BUGS] Bug: century/millenium still broken

2004-08-19 Thread Bruce Momjian

Patch applied.  Thanks.

---


Fabien COELHO wrote:
 
 Dear Tom,
 
  After all that about numbering centuries and millenia correctly,
  why does CVS tip still give me
 
  regression=# select extract(century from now());
   date_part
  ---
  20
  (1 row)
  [ ... looks in code ... ]
 
  Apparently it's because you fixed only timestamp_part, and not
  timestamptz_part.  I'm not too sure about what timestamp_trunc or
  timestamptz_trunc should do, but they may be wrong as well.
 
 Sigh... as usual, what is not tested does not work:-(
 
 
  Could we have a more complete patch?
 
 Please find a submission attached. I hope it really fixes all decade,
 century and millenium issues for extract and *_trunc functions on interval
 and other timestamp types. If someone could check that the results
 are reasonnable, it would be great.
 
 I indeed overlooked the fact that there were two functions. The patch
 fixes the code so that both variants agree.
 
 I added comments to interval extractions, because it relies on the C
 division to have a negative remainder: -7/10 = 0 and remains -7.
 
 As for *_trunc functions, I have chosen to put the first year of the
 century or millennium: -100, 1, 101... 1001 2001 etc. Indeed, I don't
 think it would make sense to put 2000 (last year of the 2nd millennium)
 for rounding all years of the third millenium.
 
 I also fixed the code so that all decades last 10 years and decade 199
 means the 1990's.
 
 I have added some tests that are relevant to deal with tricky cases. The
 formula may be simplified, but all these cases must pass. Please keep
 them.
 
 Have a nice day,
 
 -- 
 Fabien Coelho - [EMAIL PROTECTED]

Content-Description: 

[ Attachment, skipping... ]

 
 ---(end of broadcast)---
 TIP 8: explain analyze is your friend

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [PATCHES] pg_dump 'die on errors' option

2004-08-19 Thread Bruce Momjian

Patch applied.  Thanks.

I renamed 'die-on-errors' to 'exit-on-error' which I think was clearer. 
Modified patch attached.

---


Fabien COELHO wrote:
 
 Dear patchers,
 
 Please find attached a submission to add a die on errors option to
 pg_restore, as it seems that some people have scripts that rely on the
 previous abort on error default behavior when restoring data with a
 direct connection.
 
 It works for me. Maybe Philip could test that it works for him?
 
 Have a nice day,
 
 -- 
 Fabien Coelho - [EMAIL PROTECTED]

Content-Description: 

[ Attachment, skipping... ]

 
 ---(end of broadcast)---
 TIP 6: Have you searched our list archives?
 
http://archives.postgresql.org

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073
Index: doc/src/sgml/ref/pg_restore.sgml
===
RCS file: /cvsroot/pgsql-server/doc/src/sgml/ref/pg_restore.sgml,v
retrieving revision 1.47
diff -c -c -r1.47 pg_restore.sgml
*** doc/src/sgml/ref/pg_restore.sgml13 Jul 2004 02:59:49 -  1.47
--- doc/src/sgml/ref/pg_restore.sgml20 Aug 2004 04:09:31 -
***
*** 130,135 
--- 130,147 
   /varlistentry
  
   varlistentry
+   termoption-e/option/term
+   termoption--exit-on-error/option/term
+   listitem
+para
+ Exit if an error is encountered while sending SQL commands to
+ the database. The default is to continue and to display a count of 
+ errors at the end of the restoration.
+/para
+   /listitem
+  /varlistentry
+ 
+  varlistentry
termoption-f replaceablefilename/replaceable/option/term
termoption--file=replaceablefilename/replaceable/option/term
listitem
Index: src/bin/pg_dump/pg_backup.h
===
RCS file: /cvsroot/pgsql-server/src/bin/pg_dump/pg_backup.h,v
retrieving revision 1.31
diff -c -c -r1.31 pg_backup.h
*** src/bin/pg_dump/pg_backup.h 13 Jul 2004 03:00:17 -  1.31
--- src/bin/pg_dump/pg_backup.h 20 Aug 2004 04:09:37 -
***
*** 59,65 
int maxRemoteVersion;
  
/* error handling */
!   booldie_on_errors;  /* whether to die on sql errors... */
int n_errors;   /* number of errors (if no 
die) */
  
/* The rest is private */
--- 59,65 
int maxRemoteVersion;
  
/* error handling */
!   boolexit_on_error;  /* whether to exit on SQL errors... */
int n_errors;   /* number of errors (if no 
die) */
  
/* The rest is private */
***
*** 103,108 
--- 103,109 
char   *username;
int ignoreVersion;
int requirePassword;
+   int exit_on_error;
  
bool   *idWanted;
boollimitToList;
Index: src/bin/pg_dump/pg_backup_archiver.c
===
RCS file: /cvsroot/pgsql-server/src/bin/pg_dump/pg_backup_archiver.c,v
retrieving revision 1.92
diff -c -c -r1.92 pg_backup_archiver.c
*** src/bin/pg_dump/pg_backup_archiver.c13 Aug 2004 21:37:28 -  1.92
--- src/bin/pg_dump/pg_backup_archiver.c20 Aug 2004 04:09:41 -
***
*** 457,462 
--- 457,463 
  
opts-format = archUnknown;
opts-suppressDumpWarnings = false;
+   opts-exit_on_error = false;
  
return opts;
  }
***
*** 1227,1233 
  {
va_list ap;
va_start(ap, fmt);
!   if (AH-public.die_on_errors)
{
_die_horribly(AH, modulename, fmt, ap);
}
--- 1228,1234 
  {
va_list ap;
va_start(ap, fmt);
!   if (AH-public.exit_on_error)
{
_die_horribly(AH, modulename, fmt, ap);
}
***
*** 1693,1699 
}
  
/* sql error handling */
!   AH-public.die_on_errors = true;
AH-public.n_errors = 0;
  
return AH;
--- 1694,1700 
}
  
/* sql error handling */
!   AH-public.exit_on_error = true;
AH-public.n_errors = 0;
  
return AH;
Index: src/bin/pg_dump/pg_restore.c
===
RCS file: /cvsroot/pgsql-server/src/bin/pg_dump/pg_restore.c,v
retrieving revision 1.59
diff -c -c -r1.59 pg_restore.c
*** src/bin/pg_dump/pg_restore.c13 Jul 2004 03:00:17 -  1.59
--- 

Re: [PATCHES] ALTER INDEX

2004-08-19 Thread Bruce Momjian

Patch applied.  Thanks.

I originally thought of this as a feature addition, but I realized that
ALTER INDEX is being added because people are going to want to move
tablespaces for indexes, and without this, they can't easily.

---


Gavin Sherry wrote:
 This patch has a fix for a 'thought-o' in the docs.
 
 Gavin

Content-Description: 

[ Attachment, skipping... ]

 
 ---(end of broadcast)---
 TIP 7: don't forget to increase your free space map settings

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [PATCHES] ALTER INDEX

2004-08-19 Thread Bruce Momjian

I have made this adjustment.

---

Stefan Kaltenbrunner wrote:
 Gavin Sherry wrote:
 
 
  Index: src/bin/psql/tab-complete.c
  ===
  RCS file: /usr/local/cvsroot/pgsql-server/src/bin/psql/tab-complete.c,v
  retrieving revision 1.109
  diff -2 -c -r1.109 tab-complete.c
  *** src/bin/psql/tab-complete.c 28 Jul 2004 14:23:30 -  1.109
  --- src/bin/psql/tab-complete.c 13 Aug 2004 06:34:55 -
  ***
  *** 633,637 
  {
  static const char *const list_ALTER[] =
  !   {DATABASE, GROUP, SCHEMA, TABLE, TRIGGER, USER, NULL};

  COMPLETE_WITH_LIST(list_ALTER);
  --- 633,638 
  {
  static const char *const list_ALTER[] =
  !   {DATABASE, GROUP, SCHEMA, TABLE, TRIGGER, USER, INDEX,
  !NULL};

  COMPLETE_WITH_LIST(list_ALTER);
  ***
  *** 647,650 
  --- 648,661 
  COMPLETE_WITH_LIST(list_ALTERDATABASE);
  }
  +   /* ALTER INDEX name */
  +   else if (pg_strcasecmp(prev3_wd, ALTER) == 0 
  +  pg_strcasecmp(prev2_wd, INDEX) == 0)
  + {
  + static const char *const list_ALTERDATABASE[] =
  + {SET TABLESPACE, OWNER TO, RENAME TO, NULL};
  + 
  + COMPLETE_WITH_LIST(list_ALTERDATABASE);
 
 minor issue/nit(?): reusing list_ALTERDATABASE for the ALTER INDEX part 
 looks a little strange ...
 
 
 Stefan(who could really need some feedback on his own tab-complete patch 
 *g*)
 
 ---(end of broadcast)---
 TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
 

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [PATCHES] ALTER INDEX

2004-08-19 Thread Marc G. Fournier
On Fri, 20 Aug 2004, Bruce Momjian wrote:
Patch applied.  Thanks.
I originally thought of this as a feature addition, but I realized that
ALTER INDEX is being added because people are going to want to move
tablespaces for indexes, and without this, they can't easily.
Which would fall under adding a feature onto the tablespaces, not fixing a 
bug in tablespaces itself ... does *not* having ALTER INDEX *break* 
tablespaces?  Causes it not to work, or not build?


---
Gavin Sherry wrote:
This patch has a fix for a 'thought-o' in the docs.
Gavin
Content-Description:
[ Attachment, skipping... ]
---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings
--
 Bruce Momjian|  http://candle.pha.pa.us
 [EMAIL PROTECTED]   |  (610) 359-1001
 +  If your life is a hard drive, |  13 Roberts Road
 +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073
---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings

Marc G. Fournier   Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 7615664
---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [PATCHES] ALTER INDEX

2004-08-19 Thread Bruce Momjian
Marc G. Fournier wrote:
 On Fri, 20 Aug 2004, Bruce Momjian wrote:
 
 
  Patch applied.  Thanks.
 
  I originally thought of this as a feature addition, but I realized that
  ALTER INDEX is being added because people are going to want to move
  tablespaces for indexes, and without this, they can't easily.
 
 Which would fall under adding a feature onto the tablespaces, not fixing a 
 bug in tablespaces itself ... does *not* having ALTER INDEX *break* 
 tablespaces?  Causes it not to work, or not build?

No, but it is a missing capability many will complain about.  I can
easily remove it.  I saw no one comment when I added it to the patches
queue.


-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [PATCHES] ALTER INDEX

2004-08-19 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes:
 No, but it is a missing capability many will complain about.  I can
 easily remove it.  I saw no one comment when I added it to the patches
 queue.

I hadn't seen you add it to the patches queue ...

I did see Gavin's submission but did not yet have time to look at the
details.  What does it *do* exactly --- simply allow INDEX as a
substitute for TABLE in the syntax, or more?  I'm not thrilled at the
idea of adding a lot of duplicate coding for this.

regards, tom lane

---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [PATCHES] ALTER INDEX

2004-08-19 Thread Gavin Sherry
On Fri, 20 Aug 2004, Tom Lane wrote:

 Bruce Momjian [EMAIL PROTECTED] writes:
  No, but it is a missing capability many will complain about.  I can
  easily remove it.  I saw no one comment when I added it to the patches
  queue.

 I hadn't seen you add it to the patches queue ...

 I did see Gavin's submission but did not yet have time to look at the
 details.  What does it *do* exactly --- simply allow INDEX as a
 substitute for TABLE in the syntax, or more?  I'm not thrilled at the
 idea of adding a lot of duplicate coding for this.

I tried to avoid any duplication. The patch still uses all the ALTER TABLE
code. Its just a grammar modification and some setting of completion tags.

That being said, I felt obliged to provide at patch when I started hearing
noise about ALTER TABLE index name being a bit of a hack -- which it is.

Gavin

---(end of broadcast)---
TIP 8: explain analyze is your friend