Re: [PATCHES] Release.sgml markup

2003-07-21 Thread Peter Eisentraut
Rod Taylor writes:

 Attached is the new file based on itemizedlists blocks, and simplelist
 blocks for the names.

 Simplelist was used with the intent that stylesheets would dictate
 surrounding brackets at some point in the future.

I don't understand that.  The names are quite obviously not lists, and I
don't see what stylesheets providing the brackets will gain us, except
breaking the semantics of simplelist.

-- 
Peter Eisentraut   [EMAIL PROTECTED]

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


Re: [PATCHES] Eliminate information_schema from oid2name listing

2003-07-21 Thread Peter Eisentraut
Kenji Sugita writes:

 This small patch eliminates relations in information_schema from oid2name
 listing.

Why would one want to do that?

-- 
Peter Eisentraut   [EMAIL PROTECTED]

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [PATCHES] ruleutils with pretty-print option

2003-07-21 Thread Andreas Pflug
Hi Bruce,
so here's the complete patch against the current cvs.
Description:
The attached patches will add
  pg_get_ruledef(oid, bool)
  pg_get_viewdef(text, bool)
  pg_get_viewdef(oid, bool)
  pg_get_indexdef(oid, int4, bool)
  pg_get_constraintdef(oid, bool)
  pg_get_expr(text, oid, bool)
If the last parameter pretty-print is false, these function will 
return the same result as their original counterparts without that 
parameter. The source is based on ruleutils.c 1.145 and pg_proc 1.309, 
and should return exactly the same result as before if no pretty-print 
is selected. My tests didn't show any differences for pg_dump output 
with old or new version.

If the last parameter pretty-print is true, parentheses are checked; 
only necessary parentheses will be emitted. Additionally, line and 
indentation formatting is performed.

pg_get_indexdef has one additional parameter. The second parameter 
(int4) selects the nth expression of an index (1..indnatts). If zero, a 
complete CREATE INDEX statement is generated to obtain the previous 
behaviour.
The third is the pretty-print option as described.

example:
pg_get_indexdef(12345, 0, true)  - CREATE INDEX foo ON bar (numcol, 
length(txtcol), intcol2, (8+length(txtcol2)))
pg_get_indexdef(12345, 1, true)  - numcol
pg_get_indexdef(12345, 2, true)  - length(txtcol)
pg_get_indexdef(12345, 3, true)  - intcol2
pg_get_indexdef(12345, 4, true)  - (8+length(txtcol2))

Regards,
Andreas
Index: pg_proc.h
===
RCS file: /projects/cvsroot/pgsql-server/src/include/catalog/pg_proc.h,v
retrieving revision 1.309
diff -r1.309 pg_proc.h
3407a3408,3421
 /* System-view support functions with pretty-print option */
 DATA(insert OID = 2504 (  pg_get_ruledef PGNSP PGUID 12 f f t f s 2 25 26 
 16  pg_get_ruledef - _null_ ));
 DESCR(source text of a rule with pretty-print option);
 DATA(insert OID = 2505 (  pg_get_viewdef PGNSP PGUID 12 f f t f s 2 25 25 
 16  pg_get_viewdef_name - _null_ ));
 DESCR(select statement of a view with pretty-print option);
 DATA(insert OID = 2506 (  pg_get_viewdef PGNSP PGUID 12 f f t f s 2 25 26 
 16  pg_get_viewdef - _null_ ));
 DESCR(select statement of a view with pretty-print option);
 DATA(insert OID = 2507 (  pg_get_indexdefPGNSP PGUID 12 f f t f s 3 25 26 
 23 16  pg_get_indexdef - _null_ ));
 DESCR(index description (full create statement or single expression) with 
 pretty-print option);
 DATA(insert OID = 2508 (  pg_get_constraintdef PGNSP PGUID 12 f f t f s 2 25 26 16 
  pg_get_constraintdef - _null_ ));
 DESCR(constraint description with pretty-print option);
 DATA(insert OID = 2509 (  pg_get_exprPGNSP PGUID 12 f f t f s 3 25 25 
 26 16 pg_get_expr - _null_ ));
 DESCR(deparse an encoded expression with pretty-print option);
 
Index: ruleutils.c
===
RCS file: /projects/cvsroot/pgsql-server/src/backend/utils/adt/ruleutils.c,v
retrieving revision 1.145
diff -r1.145 ruleutils.c
73a74,92
 /**
  * Pretty formatting constants
  **/
 
 /* Indent counts */
 #define PRETTYINDENT_STD8
 #define PRETTYINDENT_JOIN  13
 #define PRETTYINDENT_JOIN_ON(PRETTYINDENT_JOIN-PRETTYINDENT_STD)
 #define PRETTYINDENT_VAR4
 
 /* Pretty flags */
 #define PRETTYFLAG_PAREN1
 #define PRETTYFLAG_INDENT   2
 
 /* macro to test if pretty action needed */
 #define PRETTY_PAREN(context)   (context-prettyFlags  PRETTYFLAG_PAREN)
 #define PRETTY_INDENT(context)  (context-prettyFlags  PRETTYFLAG_INDENT)
 
 
83a103,104
 int prettyFlags;/* enabling/disabling of 
 pretty-print functions */
 int indentLevel;/* for prettyPrint, current space 
 indents are counted */
126c147,153
 static text *pg_do_getviewdef(Oid viewoid);
---
 static char *get_simple_binary_op_name(OpExpr *expr);
 static void appendStringInfoSpace(StringInfo buf, int count);
 static void appendContextKeyword(deparse_context *context, char *str, int 
 indentBefore, int indentAfter, int indentPlus);
 static char *deparse_expression_pretty(Node *expr, List *dpcontext,
 bool forceprefix, bool showimplicit, int prettyFlags, int 
 startIndent);
 static bool isSimpleNode(Node *node, Node *parentNode, int prettyFlags);
 static text *pg_do_getviewdef(Oid viewoid, int prettyFlags);
129,130c156,157
 static void make_ruledef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc);
 static void make_viewdef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc);
---
 static void make_ruledef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc, int 
 prettyFlags);
 static void make_viewdef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc, int 
 prettyFlags);
132c159
 TupleDesc resultDesc);
---
 TupleDesc resultDesc, int prettyFlags, int 

Re: [PATCHES] patch for Oracle initcap compatibility

2003-07-21 Thread Bruce Momjian

Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---


[EMAIL PROTECTED] wrote:
 This makes the initcap function compatible with Oracle 9i, it has been
 tested on both redhat 8 and FreebSD.
 --
 Mike Nolan
 
 RCS file: /projects/cvsroot/pgsql-server/src/backend/utils/adt/oracle_compat.c,v
 retrieving revision 1.44
 diff -c -r1.44 oracle_compat.c
 *** oracle_compat.c 23 May 2003 22:33:20 -  1.44
 --- oracle_compat.c 17 Jul 2003 08:03:41 -
 ***
 *** 132,138 
 
while (m--  0)
{
 !   if (isspace((unsigned char) ptr[-1]))
*ptr = toupper((unsigned char) *ptr);
else
*ptr = tolower((unsigned char) *ptr);
 --- 132,139 
 
while (m--  0)
{
 !   /* Oracle capitalizes after all non-alphanumeric */
 !   if (!isalnum((unsigned char) ptr[-1]))
*ptr = toupper((unsigned char) *ptr);
else
*ptr = tolower((unsigned char) *ptr);
 
 
 ---(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 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [PATCHES] psql patches for win32

2003-07-21 Thread Bruce Momjian

Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---


Christoph Dalitz wrote:
 Hello Bruce,
 
 here are the patches for psql on Win32:
 
   psql4win32.patch  - changes in the psql source code
   psql-ref.patch- changes in the documentation psql-ref.sgml
   (for new builtin variable WIN32_CONSOLE)
 
 To apply them use patch -p 1 in the root directory of the
 postgres source directory.
 
 If you are not the right adressee for these patches, please let me
 know whom I can send them instead.
 
 These patches fix the following problems of psql on Win32
 (all changes only have effect #ifdef WIN32):
 
   a) Problem:  Static library libpq.a did not work
  Solution: Added WSAStartup() in fe-connect.c
 
   b) Problem:  Secret Password was echoed by psql
  Solution: Password echoing disabled in sprompt.c
 
   c) Problem:  8bit characters were displayed/interpreted wrong in psql
This is due to the fact that the Win32 console uses a
different encoding than the rest of the Windows system
  Solution: Introduced a new psql variable WIN32_CONSOLE
When set with \set WIN32_console, the function OemToChar()
is applied after reading input and CharToOem() before
displaying Output
 
 Christoph Dalitz
 
 PS: How was your talk at LinuxTag?
 Was there strong interest in PostgreSQL?

[ Attachment, skipping... ]

[ Attachment, skipping... ]

-- 
  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 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [PATCHES] nitpick consistency patch for pg_dump.c

2003-07-21 Thread Bruce Momjian

Later patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---


Andrew Dunstan wrote:
 
 This is a totally trivial patch for something that was a very minor nit that
 annoyed me the other day while I was documenting my current project. It
 makes pg_dump use the same layout for types as for tables, by putting \n\t
 before the first field and \n before the final );
 
 Can't really justify this too much except to say I had an itch and I
 scratched it ;-)
 
 cheers
 
 andrew
 
 
 
 *** pg_dump.c~  2003-06-25 00:08:19.0 -0400
 --- pg_dump.c   2003-07-17 15:34:52.0 -0400
 ***
 *** 3412,3418 
 i_attname = PQfnumber(res, attname);
 i_atttypdefn = PQfnumber(res, atttypdefn);
 
 !   appendPQExpBuffer(q, CREATE TYPE %s AS (,
   fmtId(tinfo-typname));
 
 for (i = 0; i  ntups; i++)
 --- 3412,3418 
 i_attname = PQfnumber(res, attname);
 i_atttypdefn = PQfnumber(res, atttypdefn);
 
 !   appendPQExpBuffer(q, CREATE TYPE %s AS (\n,
   fmtId(tinfo-typname));
 
 for (i = 0; i  ntups; i++)
 ***
 *** 3423,3433 
 attname = PQgetvalue(res, i, i_attname);
 atttypdefn = PQgetvalue(res, i, i_atttypdefn);
 
 !   if (i  0)
 !   appendPQExpBuffer(q, ,\n\t);
 !   appendPQExpBuffer(q, %s %s, fmtId(attname), atttypdefn);
 }
 !   appendPQExpBuffer(q, );\n);
 
 /*
  * DROP must be fully qualified in case same name appears in
 --- 3423,3431 
 attname = PQgetvalue(res, i, i_attname);
 atttypdefn = PQgetvalue(res, i, i_atttypdefn);
 
 !   appendPQExpBuffer(q, \n\t%s %s, fmtId(attname),
 atttypdefn);}
 !   appendPQExpBuffer(q, \n);\n);
 
 /*
  * DROP must be fully qualified in case same name appears in
 
 
 
 
 
 
 
 ---(end of broadcast)---
 TIP 2: you can get off all lists at once with the unregister command
 (send unregister YourEmailAddressHere 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 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [PATCHES] Adding Rendezvous support to postmaster

2003-07-21 Thread Bruce Momjian

OK, new patch attached, with the adjustment you suggested.  We do
probably have a few days to resolve this, but if we run out of time, I
will drop it like a hot potato and keep it for 7.5.  :-)

---

Chris Campbell wrote:
 On Monday, Jul 21, 2003, at 21:17 US/Eastern, Bruce Momjian wrote:
 
  Again, why does the current code pass NULL as the first param --- that
  was from your orignal patch.
 
 The original patch passed the service_name variable (which you've now 
 renamed rendezvous_name) as the first parameter. I'm not sure how that 
 NULL got there. You're correct: the first parameter is the string to 
 use as the service name. To use the default (the Computer Name),  
 should be passed (the empty string). Which, if rendezvous_name defaults 
 to , means that rendezvous_name should be passed in all cases.
 
  I figure because we have a Rendezvous config param, then they want it 
  on
  by default.
 
 I agree with that thinking. In my original patch, I required that a 
 service_name = directive be in the config file to turn on Rendezvous 
 service advertisement, and that service_name =  be in there to use 
 the default service name (the Computer Name), but I like this way 
 better: always advertise a service (if HAVE_RENDEZVOUS is defined) and 
 use the default service name () unless a service name is configured 
 with rendezvous_name = in the config file.
 
 I like it. I'll check out your pointers on getting initdb to work in OS 
 X, make sure I've got a good looking patch, then mail you a patch to 
 HEAD. Probably tomorrow? That work?
 
 Thanks!
 
 - Chris
 
 

-- 
  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/runtime.sgml
===
RCS file: /cvsroot/pgsql-server/doc/src/sgml/runtime.sgml,v
retrieving revision 1.193
diff -c -c -r1.193 runtime.sgml
*** doc/src/sgml/runtime.sgml   14 Jul 2003 20:00:22 -  1.193
--- doc/src/sgml/runtime.sgml   22 Jul 2003 03:41:50 -
***
*** 732,737 
--- 732,747 
/listitem
   /varlistentry
   
+  varlistentry
+   termvarnameRENDEZVOUS_NAME/varname (typestring/type)/term
+   listitem
+para
+ Specifies the Rendezvous broadcast name.  By default, the
+ computer name is used, specified as ''.
+/para
+   /listitem
+  /varlistentry
+  
   /variablelist
   /sect3
   sect3 id=runtime-config-connection-security
Index: src/backend/postmaster/postmaster.c
===
RCS file: /cvsroot/pgsql-server/src/backend/postmaster/postmaster.c,v
retrieving revision 1.333
diff -c -c -r1.333 postmaster.c
*** src/backend/postmaster/postmaster.c 12 Jun 2003 07:36:51 -  1.333
--- src/backend/postmaster/postmaster.c 22 Jul 2003 03:41:54 -
***
*** 210,215 
--- 210,217 
  bool  Log_connections = false;
  bool  Db_user_namespace = false;
  
+ char  *rendezvous_name;
+ 
  /* For FNCTL_NONBLOCK */
  #if defined(WIN32) || defined(__BEOS__)
  long ioctlsocket_ret;
***
*** 756,772 
socket.);
}
}
! #ifdef USE_RENDEZVOUS
! if (service_name != NULL)
! {
! DNSServiceRegistrationCreate(NULL,/* default to hostname 
*/
!  _postgresql._tcp.,
!  ,
!  htonl(PostPortNumber),
!  ,
!  
(DNSServiceRegistrationReply)reg_reply,
!  NULL);
! }
  #endif
}
  
--- 758,774 
socket.);
}
}
! #ifdef USE_RENDEZVOUS  
!   if (service_name != NULL)
!   {
!   
DNSServiceRegistrationCreate(rendezvous_name,
!  
  _postgresql._tcp.,
!  
  ,
!  
  htonl(PostPortNumber),
!  

Re: [PATCHES] ruleutils with pretty-print option

2003-07-21 Thread Bruce Momjian

Andreas, looks good, but I need a diff -c, context diff.

---

Andreas Pflug wrote:
 Hi Bruce,
 so here's the complete patch against the current cvs.
 
 Description:
 The attached patches will add
pg_get_ruledef(oid, bool)
pg_get_viewdef(text, bool)
pg_get_viewdef(oid, bool)
pg_get_indexdef(oid, int4, bool)
pg_get_constraintdef(oid, bool)
pg_get_expr(text, oid, bool)
 
 If the last parameter pretty-print is false, these function will 
 return the same result as their original counterparts without that 
 parameter. The source is based on ruleutils.c 1.145 and pg_proc 1.309, 
 and should return exactly the same result as before if no pretty-print 
 is selected. My tests didn't show any differences for pg_dump output 
 with old or new version.
 
 If the last parameter pretty-print is true, parentheses are checked; 
 only necessary parentheses will be emitted. Additionally, line and 
 indentation formatting is performed.
 
 pg_get_indexdef has one additional parameter. The second parameter 
 (int4) selects the nth expression of an index (1..indnatts). If zero, a 
 complete CREATE INDEX statement is generated to obtain the previous 
 behaviour.
 The third is the pretty-print option as described.
 
 example:
 pg_get_indexdef(12345, 0, true)  - CREATE INDEX foo ON bar (numcol, 
 length(txtcol), intcol2, (8+length(txtcol2)))
 pg_get_indexdef(12345, 1, true)  - numcol
 pg_get_indexdef(12345, 2, true)  - length(txtcol)
 pg_get_indexdef(12345, 3, true)  - intcol2
 pg_get_indexdef(12345, 4, true)  - (8+length(txtcol2))
 
 Regards,
 Andreas
 

 Index: pg_proc.h
 ===
 RCS file: /projects/cvsroot/pgsql-server/src/include/catalog/pg_proc.h,v
 retrieving revision 1.309
 diff -r1.309 pg_proc.h
 3407a3408,3421
  /* System-view support functions with pretty-print option */
  DATA(insert OID = 2504 (  pg_get_ruledef   PGNSP PGUID 12 f f t f s 2 25 26 
  16  pg_get_ruledef - _null_ ));
  DESCR(source text of a rule with pretty-print option);
  DATA(insert OID = 2505 (  pg_get_viewdef   PGNSP PGUID 12 f f t f s 2 25 25 
  16  pg_get_viewdef_name - _null_ ));
  DESCR(select statement of a view with pretty-print option);
  DATA(insert OID = 2506 (  pg_get_viewdef   PGNSP PGUID 12 f f t f s 2 25 26 
  16  pg_get_viewdef - _null_ ));
  DESCR(select statement of a view with pretty-print option);
  DATA(insert OID = 2507 (  pg_get_indexdef  PGNSP PGUID 12 f f t f s 3 25 26 
  23 16  pg_get_indexdef - _null_ ));
  DESCR(index description (full create statement or single expression) with 
  pretty-print option);
  DATA(insert OID = 2508 (  pg_get_constraintdef PGNSP PGUID 12 f f t f s 2 25 26 
  16  pg_get_constraintdef - _null_ ));
  DESCR(constraint description with pretty-print option);
  DATA(insert OID = 2509 (  pg_get_expr  PGNSP PGUID 12 f f t f s 3 
  25 25 26 16 pg_get_expr - _null_ ));
  DESCR(deparse an encoded expression with pretty-print option);
  

 Index: ruleutils.c
 ===
 RCS file: /projects/cvsroot/pgsql-server/src/backend/utils/adt/ruleutils.c,v
 retrieving revision 1.145
 diff -r1.145 ruleutils.c
 73a74,92
  /**
   * Pretty formatting constants
   **/
  
  /* Indent counts */
  #define PRETTYINDENT_STD8
  #define PRETTYINDENT_JOIN  13
  #define PRETTYINDENT_JOIN_ON(PRETTYINDENT_JOIN-PRETTYINDENT_STD)
  #define PRETTYINDENT_VAR4
  
  /* Pretty flags */
  #define PRETTYFLAG_PAREN1
  #define PRETTYFLAG_INDENT   2
  
  /* macro to test if pretty action needed */
  #define PRETTY_PAREN(context)   (context-prettyFlags  PRETTYFLAG_PAREN)
  #define PRETTY_INDENT(context)  (context-prettyFlags  PRETTYFLAG_INDENT)
  
  
 83a103,104
  int prettyFlags;/* enabling/disabling of 
  pretty-print functions */
  int indentLevel;/* for prettyPrint, current space 
  indents are counted */
 126c147,153
  static text *pg_do_getviewdef(Oid viewoid);
 ---
  static char *get_simple_binary_op_name(OpExpr *expr);
  static void appendStringInfoSpace(StringInfo buf, int count);
  static void appendContextKeyword(deparse_context *context, char *str, int 
  indentBefore, int indentAfter, int indentPlus);
  static char *deparse_expression_pretty(Node *expr, List *dpcontext,
bool forceprefix, bool showimplicit, int prettyFlags, int 
  startIndent);
  static bool isSimpleNode(Node *node, Node *parentNode, int prettyFlags);
  static text *pg_do_getviewdef(Oid viewoid, int prettyFlags);
 129,130c156,157
  static void make_ruledef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc);
  static void make_viewdef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc);
 ---
  static void make_ruledef(StringInfo buf,