[PATCHES] Enums patch v1

2006-09-01 Thread Tom Dunstan

Hi folks

Here's a first cut of the enums patch for feedback when people have 
time. It follows an anyenum pseudo-type approach as foreseen by 
Nostradamus in one of the original threads. 
(http://archives.postgresql.org/pgsql-hackers/2005-11/msg00457.php).
That made the patch a little more intrusive than I had been hoping for, 
but hopefully the bits that touch core files like parse_coerce.c are 
easy to follow.


The patch is largely feature complete as far as what I wanted to 
achieve, although it's currently missing documentation patches. I'll add 
those at some point soonish. It's currently only been tested on my x86 
FC5 box.


A few notes:

 - In much of the code, anyenum is treated identically to anyelement, 
except when trying to tie down generic parameters: at this point types 
which aren't enums will be rejected if the declared type is anyenum. 
Thus there are quite a few places in the patch where ANYENUMOID has just 
kinda been added in next to ANYELEMENTOID.


 - The error messages in enum.c need some love. Apparently there's a 
document that I need to read in the sgml docco which explains error 
codes to me; currently I've got FIXME TOM comments in there.


 - One difficulty that I had was trying to write a cast-text-to-enum 
function. While input functions pass their type oid as a second 
parameter, all that cast functions can get is the typmod. I did a bit of 
an ugly hack to pass the enum oid in as an int in that parameter if it's 
an enum type; it might be cleaner to allow cast functions that take an 
oid there rather than an int and pass the correct parameter depending on 
that type. I wasn't comfortable making a change like that in this patch 
without discussion, though.


 - It appeared that to be cached in a syscache properly, the enum names 
had to be a Name/NameData thing rather than a text or whatever, so 
there's a limit of 64 characters per enum value. 64 characters should be 
enough for anybody :). Hmm, as I write this I realize that I should 
probably add some length checking to the create type function. And 
something prohibiting commas, since they're the array delimiter. 
Consider that on the TODO as well. :) Do we want to allow a customizable 
delimiter? IMO someone putting commas inside an enum value is doing 
something sick and twisted anyway, but maybe there's an argument to be 
made. They could always hack the delimiter on the array type, although 
that wouldn't survive a dump.


 - You can't create generic anyenum functions in the PL's except for 
plpgsql. You can create functions taking/returning the concrete type, 
but not anyenum. I don't consider that a huge loss; we couldn't really 
think of a use case. I haven't added a regression test involving enums 
to e.g. plperl, although I have tested it with perlpython/tcl. Is that 
worth doing, or is it being paranoid?


 - This patch requires an initdb, but I haven't bumped the catalog 
version number in the patch since I don't know when (if ever) it will be 
applied


Now a few questions from a first-time contributor:

 - Do I need to call CatalogUpdateIndexes() after I delete rows when 
dropping the type? Following the code for creating dropping standard 
user types, it's called on creation but not deletion.


 - I'm a little unclear about when pfree() should be called. My 
understanding is that it will deallocate memory from the current memory 
context, but that context will be chucked once the current statement or 
whatever is dead. Is it just nice to do when we know that we're done 
with a particular chunk and to stop the context from growing, or are 
there other occasions? Or have I misunderstood what it does?


 - Is pg_indent intended to be run by us mortals? I tried following the 
instructions in the README to make sure my indentation was kosher, but 
ran into issues with pgindent complaining about something called detab 
being missing. It's not on my Fedora box, and some quick Googling didn't 
unearth an obvious candidate, although a few dodgy looking scripts 
popped up. Is it a BSD tool?


Anyway, all comments / criticisms welcome. Have a look at the regression 
test to see what should be working.


Cheers

Tom


enums-v1.patch.gz
Description: GNU Zip compressed data

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


[PATCHES] SSL enhancement patch ver.2

2006-09-01 Thread Victor B. Wagner
This patch adds following functionality to PostgreSQL

1. If PostgreSQL is compiled with OpenSSL version 0.9.7 and above,
both backend and libpq read site-wide OpenSSL configuration file as
described in OPENSSL_config functon manual page. 

This allows to use hardware crypto acceleration modules (engines) and,
in future version 0.9.9 would allow to use additional cryptoalgorithms
(i.e. national standards) which are not included in core OpenSSL.

All other configuration parameters which are supported by OpenSSL
library also are taken into account.


2. New configuration option ssl_ciphers is added to postgresql.conf.
This option allows to change list of ciphers, acceptable by backend
during SSL connection. Changing list of ciphers can be desirable to
tighten or relax security of particular installation, and allows quick
fix on configuration file level in case if vulnerability is discovered
in one of cryptoalgorithms or their OpenSSL implementation - cipher
suites which use such algorithm can be easily disabled.


3. If libpq compiled with OpenSSL 0.9.7 and above, compiled with engine
support, it is possible to store secret key of client certificate on the
hardware token, supported by one of OpenSSL engines (Hardware Security
Module). Name of engine which supports token and engine-specific key ID
are specifyed using environment variable PGSSLKEY.

This allows use of hardware tokens such as smartcards to identify
clients, connecting to database.

This functionality can be used in installations with high security
requirements or in situations where several people can use same terminal
(such as cash register in shops or malls).

If PostgreSQL is compiled with version of OpenSSL which do not support
engines or doesn't have OPENSSL_config function, related functionality
is excluded by preprocessor conditionals, based on value of 
SSLEAY_VERSION_NUMBER preprocessor symbol which is defined by all
versions of OpenSSL.

diff -rcN ../pgsql-20060830/doc/src/sgml/config.sgml ./doc/src/sgml/config.sgml
*** ../pgsql-20060830/doc/src/sgml/config.sgml  2006-08-30 16:01:12.0 
+0400
--- ./doc/src/sgml/config.sgml  2006-09-01 11:13:34.0 +0400
***
*** 555,561 
 /para
/listitem
   /varlistentry
! 
   varlistentry id=guc-password-encryption 
xreflabel=password_encryption
termvarnamepassword_encryption/varname 
(typeboolean/type)/term
indexterm
--- 555,575 
 /para
/listitem
   /varlistentry
!varlistentry id=guc-ssl-ciphers xreflabel=ssl-ciphers
!termvarnamessl_ciphers (typestring/type)/term
!indexterm
!   primaryvarnamessl_ciphers/ configuration 
parameter/primary
!/indexterm
!listitem
! para
!   Specifies list of acronymSSL/ ciphers, which can be used to
!   establish secure connection. See manual page for
!   commandopenssl ciphers/command
!   command to find list of allowed values and their semantics.
! /para   
!/listitem
!/varlistentry
!
   varlistentry id=guc-password-encryption 
xreflabel=password_encryption
termvarnamepassword_encryption/varname 
(typeboolean/type)/term
indexterm
diff -rcN ../pgsql-20060830/doc/src/sgml/libpq.sgml ./doc/src/sgml/libpq.sgml
*** ../pgsql-20060830/doc/src/sgml/libpq.sgml   2006-08-30 16:01:12.0 
+0400
--- ./doc/src/sgml/libpq.sgml   2006-09-01 12:30:33.0 +0400
***
*** 3942,3947 
--- 3942,3959 
  listitem
  para
  indexterm
+ primaryenvarPGSSLKEY/envar/primary
+ /indexterm
+ envarPGSSLKEY/envar
+ specifies hardware token which store secret key of the client
+ certificate, instead of file. Value of this variable should consist of
+ colon separated engine name (engines are loadable modules of
+ productnameOpenSSL/) and engine-specific key identifier.
+ /para
+ /listitem
+ listitem
+ para
+ indexterm
   primaryenvarPGKRBSRVNAME/envar/primary
  /indexterm
  envarPGKRBSRVNAME/envar sets the Kerberos service name to use when
***
*** 4139,4158 
 for increased security. See xref linkend=ssl-tcp for details
 about the server-side acronymSSL/ functionality.
/para
! 
para
 If the server demands a client certificate, 
 applicationlibpq/application
 will send the certificate stored in file
 filename~/.postgresql/postgresql.crt/ within the user's home directory.
 A matching private key file filename~/.postgresql/postgresql.key/
!must also be present, and must not be world-readable.
 (On Microsoft Windows these files are named
 filename%APPDATA%\postgresql\postgresql.crt/filename and
 filename%APPDATA%\postgresql\postgresql.key/filename.)
/para
  
para
 If the file filename~/.postgresql/root.crt/ is present in the user's
 home directory,
 applicationlibpq/application will use the certificate list stored
--- 4151,4194 
 for 

Re: [PATCHES] [HACKERS] Interval aggregate regression failure

2006-09-01 Thread Michael Glaesemann


On Sep 1, 2006, at 11:31 , Bruce Momjian wrote:


Tom Lane wrote:

Bruce Momjian [EMAIL PROTECTED] writes:
I am unclear about this report.  The patch was not meant to fix  
every

interval issue, but merely to improve multiplication and division
computations.  Does it do that?


According to Michael's last report, your patch fails under
--enable-integer-datetimes.


Where does it fail?  Here?

select interval '41 mon 12 days 360:00' * 0.3 as product_a
 , interval '-41 mon -12 days +360:00' * 0.3 as product_b
 , interval '-41 mon 12 days 360:00' * 0.3 as product_c
 , interval '-41 mon -12 days -360:00' * 0.3 as product_d;
 product_a |  product_b  |
product_c  |product_d
--+-
++-
1 year 11 days 146:24:00 | -1 years -11 days +69:36:00 | -1 years -5
days +98:24:00 | -1 years -11 days -146:23:60.00
-

That is wrong, but I think we need another fix for that.  Notice the
problem is in minutes/seconds, not hours.


I was sure it was more wrong than that the first time I saw it, but  
looks like I can't be sure of anything today :(. I need more sleep.  
Sorry for the noise on this one.


Off work now, so I'm back at it.

Michael Glaesemann
grzm seespotcode net




---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [PATCHES] [HACKERS] Interval aggregate regression failure

2006-09-01 Thread Michael Glaesemann


On Sep 1, 2006, at 11:03 , Bruce Momjian wrote:


I am unclear about this report.  The patch was not meant to fix every
interval issue, but merely to improve multiplication and division
computations.  Does it do that?  I think the 23:60 is a time rounding
issue that isn't covered in this patch.  I am not against fixing  
it, but

does the submitted patch improve things or not?  Given we are
post-feature freeze, we don't have time to fix all the interval  
issues.


Your patch doesn't fix the things Tom referenced (nor did you intend  
it to). I just wanted to to collect examples of all the known issues  
with the interval code in one place. Probably too ambitious for  
September 1.


Is it worth looking into the overflow and subtraction issues for 8.2?  
It seems to me they're bugs rather than features. Or are these 8.3  
since it's so late?


Michael Glaesemann
grzm seespotcode net




---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [PATCHES] [HACKERS] Interval aggregate regression failure

2006-09-01 Thread Michael Glaesemann
Here's a patch that appears to work. Gives the same output with and  
without --enable-integer-datetimes. Answers look like they're correct.


I'm basically treating the components as three different intervals  
(with the other two components zero), rounding them each to usecs,  
and adding them together.


While it might be nice to carry a little extra precision around, it  
doesn't seem to be needed in these cases. If errors do arise, they  
should be at most 3 usec, which is pretty much noise for the floating  
point case, I suspect.


Bruce, how's it look on your machine? If it looks good, I'll add the  
examples we've been using to the regression tests.


Michael Glaesemann
grzm seespotcode net


Index: src/backend/utils/adt/timestamp.c
===
RCS file: /projects/cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v
retrieving revision 1.165
diff -c -r1.165 timestamp.c
*** src/backend/utils/adt/timestamp.c   13 Jul 2006 16:49:16 -  1.165
--- src/backend/utils/adt/timestamp.c   1 Sep 2006 11:26:12 -
***
*** 2494,2511 
float8  factor = PG_GETARG_FLOAT8(1);
double  month_remainder,
day_remainder,
!   month_remainder_days;
Interval   *result;

result = (Interval *) palloc(sizeof(Interval));

!   month_remainder = span-month * factor;
!   day_remainder = span-day * factor;
result-month = (int32) month_remainder;
result-day = (int32) day_remainder;
month_remainder -= result-month;
day_remainder -= result-day;

/*
  	 * The above correctly handles the whole-number part of the month  
and day

 * products, but we have to do something with any fractional part
--- 2494,2553 
float8  factor = PG_GETARG_FLOAT8(1);
double  month_remainder,
day_remainder,
!   month_remainder_days,
!   month_remainder_time,
!   day_remainder_time;
Interval   *result;

result = (Interval *) palloc(sizeof(Interval));

!
!   month_remainder = span-month / factor;
!   day_remainder = span-day / factor;
result-month = (int32) month_remainder;
result-day = (int32) day_remainder;
month_remainder -= result-month;
day_remainder -= result-day;

+   month_remainder_days = month_remainder * DAYS_PER_MONTH;
+   
+   /*
+   if month_remainder_days is not an integer, check to see if it's 
an
+   integer when converted to SECS or USECS.
+   If it is, round month_remainder_days to the nearest integer
+   
+*/
+   
+   if (month_remainder_days != (int32)month_remainder_days 
+   TSROUND(month_remainder_days * SECS_PER_DAY) ==
+ rint(month_remainder_days * SECS_PER_DAY))
+   month_remainder_days = rint(month_remainder_days);
+
+   result-day += (int32)month_remainder_days;
+
+ #ifdef HAVE_INT64_TIMESTAMP
+   month_remainder_time = rint((month_remainder_days -
+   
(int32)month_remainder_days) * USECS_PER_DAY);
+
+   day_remainder_time = rint(day_remainder * USECS_PER_DAY);
+
+
+   result-time = rint(rint(span-time * factor) + day_remainder_time +
+  month_remainder_time);
+ #else
+   month_remainder_time = rint((month_remainder_days -
+  (int32)month_remainder_days) 
* SECS_PER_DAY);
+   day_remainder_time = rint(day_remainder * SECS_PER_DAY);
+
+   result-time = span-time * factor + day_remainder_time +
+   month_remainder_time;
+ #endif
+   
+
+   day_remainder = span-day * factor;
+   result-day = (int32) day_remainder;
+   day_remainder -= result-day;
+
/*
  	 * The above correctly handles the whole-number part of the month  
and day

 * products, but we have to do something with any fractional part
***
*** 2518,2531 

/* fractional months full days into days */
month_remainder_days = month_remainder * DAYS_PER_MONTH;
!   result-day += (int32) month_remainder_days;
!   /* fractional months partial days into time */
!   day_remainder += month_remainder_days - (int32) month_remainder_days;

  #ifdef HAVE_INT64_TIMESTAMP
! 	result-time = rint(span-time * factor + day_remainder *  
USECS_PER_DAY);

  #else
!   result-time = span-time * factor + day_remainder * SECS_PER_DAY;
  #endif

PG_RETURN_INTERVAL_P(result);
--- 2560,2599 

/* fractional months full days into days */
month_remainder_days = month_remainder * DAYS_PER_MONTH;
!   /*
!*  The remainders suffer from float 

Re: [PATCHES] [HACKERS] Interval aggregate regression failure

2006-09-01 Thread Michael Glaesemann
Please ignore the patch I just sent. Much too quick with the send  
button.


Michael Glaesemann
grzm seespotcode net




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


[PATCHES] DOC: catalog.sgml

2006-09-01 Thread Zdenek Kotala
I little bit enhanced overview catalog tables. I added two new columns. 
First one is OID of catalog table and second one contains attributes 
which determine if the table is bootstrap, with oid and global.


I'm not able generate doc from sgml :( and verify if changes are ok :(.

Zdenek

Index: doc/src/sgml/catalogs.sgml
===
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v
retrieving revision 2.130
diff -c -r2.130 catalogs.sgml
*** doc/src/sgml/catalogs.sgml	25 Aug 2006 04:06:44 -	2.130
--- doc/src/sgml/catalogs.sgml	1 Sep 2006 12:42:47 -
***
*** 26,32 
  
para
 xref linkend=catalog-table lists the system catalogs.
!More detailed documentation of each catalog follows below.
/para
  
para
--- 26,35 
  
para
 xref linkend=catalog-table lists the system catalogs.
!More detailed documentation of each catalog follows below. Attributes
!column contains information how table was created. A bootstrap tables
!has attribut B. Table which has OID field has O. Shared/global tables
!are mark with letter G.
/para
  
para
***
*** 39,49 
table id=catalog-table
 titleSystem Catalogs/title
  
!tgroup cols=2
  thead
   row
entryCatalog Name/entry
entryPurpose/entry
   /row
  /thead
  
--- 42,54 
table id=catalog-table
 titleSystem Catalogs/title
  
!tgroup cols=4
  thead
   row
entryCatalog Name/entry
entryPurpose/entry
+   entryOid/entry
+   entryAttributes/entry
   /row
  /thead
  
***
*** 51,216 
--- 56,287 
   row
entrylink linkend=catalog-pg-aggregatestructnamepg_aggregate/structname/link/entry
entryaggregate functions/entry
+   entry2600/entry
+   entry---/entry
   /row
  
   row
entrylink linkend=catalog-pg-amstructnamepg_am/structname/link/entry
entryindex access methods/entry
+   entry2601/entry
+   entry-O-/entry
   /row
  
   row
entrylink linkend=catalog-pg-amopstructnamepg_amop/structname/link/entry
entryaccess method operators/entry
+   entry2602/entry
+   entry---/entry
   /row
  
   row
entrylink linkend=catalog-pg-amprocstructnamepg_amproc/structname/link/entry
entryaccess method support procedures/entry
+   entry2603/entry
+   entry---/entry
   /row
  
   row
entrylink linkend=catalog-pg-attrdefstructnamepg_attrdef/structname/link/entry
entrycolumn default values/entry
+   entry2604/entry
+   entry-O-/entry
   /row
  
   row
entrylink linkend=catalog-pg-attributestructnamepg_attribute/structname/link/entry
entrytable columns (quoteattributes/quote)/entry
+   entry1249/entry
+   entryB--/entry
   /row
  
   row
entrylink linkend=catalog-pg-authidstructnamepg_authid/structname/link/entry
entryauthorization identifiers (roles)/entry
+   entry1260/entry
+   entry-OG/entry
   /row
  
   row
entrylink linkend=catalog-pg-auth-membersstructnamepg_auth_members/structname/link/entry
entryauthorization identifier membership relationships/entry
+   entry1261/entry
+   entry--G/entry
   /row
  
   row
entrylink linkend=catalog-pg-autovacuumstructnamepg_autovacuum/structname/link/entry
entryper-relation autovacuum configuration parameters/entry
+   entry1248/entry
+   entry---/entry
   /row
  
   row
entrylink linkend=catalog-pg-caststructnamepg_cast/structname/link/entry
entrycasts (data type conversions)/entry
+   entry2605/entry
+   entry-O-/entry
   /row
  
   row
entrylink linkend=catalog-pg-classstructnamepg_class/structname/link/entry
entrytables, indexes, sequences, views (quoterelations/quote)/entry
+   entry1259/entry
+   entryBO-/entry
   /row
  
   row
entrylink linkend=catalog-pg-constraintstructnamepg_constraint/structname/link/entry
entrycheck constraints, unique constraints, primary key constraints, foreign key constraints/entry
+   entry2606/entry
+   entry-O-/entry
   /row
  
   row
entrylink linkend=catalog-pg-conversionstructnamepg_conversion/structname/link/entry
entryencoding conversion information/entry
+   entry2607/entry
+   entry-O-/entry
   /row
  
   row
entrylink linkend=catalog-pg-databasestructnamepg_database/structname/link/entry
entrydatabases within this database cluster/entry
+   entry1262/entry
+   entry-OG/entry
   /row
  
   row
entrylink linkend=catalog-pg-dependstructnamepg_depend/structname/link/entry
entrydependencies between database objects/entry
+   entry2608/entry
+   entry---/entry
   /row
  
  

Re: [PATCHES] [HACKERS] Interval aggregate regression failure

2006-09-01 Thread Tom Lane
Michael Glaesemann [EMAIL PROTECTED] writes:
 Is it worth looking into the overflow and subtraction issues for 8.2?  
 It seems to me they're bugs rather than features. Or are these 8.3  
 since it's so late?

IMHO they're bugs not new features, and therefore perfectly fair game
to work on during beta.  But for the moment I'd suggest staying focused
on the interval_mul/interval_div roundoff issue.

regards, tom lane

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


Re: [PATCHES] DOC: catalog.sgml

2006-09-01 Thread Tom Lane
Zdenek Kotala [EMAIL PROTECTED] writes:
 I little bit enhanced overview catalog tables. I added two new columns. 
 First one is OID of catalog table and second one contains attributes 
 which determine if the table is bootstrap, with oid and global.

Why is this a good idea?  It seems like mere clutter.

regards, tom lane

---(end of broadcast)---
TIP 1: 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: [HACKERS] [PATCHES] DOC: catalog.sgml

2006-09-01 Thread Alvaro Herrera
Tom Lane wrote:
 Zdenek Kotala [EMAIL PROTECTED] writes:
  I little bit enhanced overview catalog tables. I added two new columns. 
  First one is OID of catalog table and second one contains attributes 
  which determine if the table is bootstrap, with oid and global.
 
 Why is this a good idea?  It seems like mere clutter.

What's global?  A maybe-useful flag would be telling that a table is
shared.  Is that it?  Mind you, it's not useful to me because I know
which tables are shared, but I guess for someone not so familiar with
the catalogs it could have some use.

The OIDs may be useful to people inspecting pg_depend, for example; but
then, it's foolish not to be using regclass in that case.

Whether a table is bootstrap or not doesn't seem useful to me.

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

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


[PATCHES] Predicate Locking

2006-09-01 Thread David Fetter
Folks,

This patch clarifies the 'predicate locking' section in the docs.
Thanks to Harrison Fisk of MySQL AB for helping.

Cheers,
D
-- 
David Fetter [EMAIL PROTECTED] http://fetter.org/
phone: +1 415 235 3778AIM: dfetter666
  Skype: davidfetter

Remember to vote!
Index: doc/src/sgml/mvcc.sgml
===
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v
retrieving revision 2.57
diff -c -r2.57 mvcc.sgml
*** doc/src/sgml/mvcc.sgml  25 Aug 2006 04:06:45 -  2.57
--- doc/src/sgml/mvcc.sgml  1 Sep 2006 17:28:28 -
***
*** 471,477 
  result in problems.  (Certainly the example above is rather contrived
  and unlikely to represent real software.)  Accordingly,
  productnamePostgreSQL/productname does not implement predicate
! locking, and so far as we are aware no other production DBMS does either.
 /para
  
 para
--- 471,480 
  result in problems.  (Certainly the example above is rather contrived
  and unlikely to represent real software.)  Accordingly,
  productnamePostgreSQL/productname does not implement predicate
! locking.  No system based on next-key locking implements it
! either because next-key locking only helps when all your
! predicates are point or range searches against an available
! B-tree index.  DB2, however, does implement predicate locking.
 /para
  
 para

---(end of broadcast)---
TIP 1: 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


[PATCHES] Proposed patch for rules with RETURNING

2006-09-01 Thread Tom Lane
Attached is a draft patch that makes rules support RETURNING as per my
proposal of earlier today, ie, have the rewriter automatically adjust a
RETURNING clause present in an unconditional INSTEAD rule.  The core of
the patch is barely twenty lines (the code added to rewriteRuleAction)
--- the rest is error checking to reject invalid rules.

Comments, objections?

regards, tom lane


bin91urRGXXGs.bin
Description: rule-returning.patch.gz

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [PATCHES] [DOCS] Predicate Locking

2006-09-01 Thread Peter Eisentraut
David Fetter wrote:
 This patch clarifies the 'predicate locking' section in the docs.

What it does it raise the question what next-key locking is.

I don't think any of this matters for us.  We should just remove the 
part that claims that no other system implements predicate locking.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

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


Re: [PATCHES] Proposed patch for rules with RETURNING

2006-09-01 Thread Jonah H. Harris

On 9/1/06, Tom Lane [EMAIL PROTECTED] wrote:

Attached is a draft patch that makes rules support RETURNING ...


What format is that patch in?  Either something's wrong or Gmail just
went really wacko.

--
Jonah H. Harris, Software Architect | phone: 732.331.1300
EnterpriseDB Corporation| fax: 732.331.1301
33 Wood Ave S, 2nd Floor| [EMAIL PROTECTED]
Iselin, New Jersey 08830| http://www.enterprisedb.com/

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


Re: [PATCHES] Proposed patch for rules with RETURNING

2006-09-01 Thread Bruce Momjian
Jonah H. Harris wrote:
 On 9/1/06, Tom Lane [EMAIL PROTECTED] wrote:
  Attached is a draft patch that makes rules support RETURNING ...
 
 What format is that patch in?  Either something's wrong or Gmail just
 went really wacko.

I see the attachment fine.

-- 
  Bruce Momjian   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [PATCHES] Patch for PLPYTHONU - adding TD[relname]

2006-09-01 Thread Bruce Momjian

This will appear in 8.2, but with the name 'table_name':

revision 1.80
date: 2006/05/26 19:23:09;  author: adunstan;  state: Exp;  lines: +17 
-2

Add table_name and table_schema to plpython trigger data, plus docs and
regression test.

---

Sokolov Yura wrote:
 Excuse my English.
 Patch allows to get triggers table name in the trigger TD['relname'].
 Usefull when same trigger function applied to different tables.
 patch for plpython.c in Postgres 8.1 beta (diff was applied to)
 works also in Postgres 8.0.3 when placed in the same function (may be 
 different line numbers)
 
 --- plpython-old.c2005-07-10 08:56:55.0 +0400
 +++ plpython.c2005-10-04 12:03:36.0 +0400
 @@ -582,7 +582,8 @@ PLy_trigger_build_args(FunctionCallInfo
 *pltevent,
 *pltwhen,
 *pltlevel,
 -   *pltrelid;
 +   *pltrelid,
 +   *pltrelname;
  PyObject   *pltargs,
 *pytnew,
 *pytold;
 @@ -606,6 +607,12 @@ PLy_trigger_build_args(FunctionCallInfo
  Py_DECREF(pltrelid);
  pfree(stroid);
  
 +stroid = SPI_getrelname(tdata-tg_relation);
 +pltrelname = PyString_FromString(stroid);
 +PyDict_SetItemString(pltdata, relname, pltrelname);
 +Py_DECREF(pltrelname);
 +pfree(stroid);
 +
  if (TRIGGER_FIRED_BEFORE(tdata-tg_event))
  pltwhen = PyString_FromString(BEFORE);
  else if (TRIGGER_FIRED_AFTER(tdata-tg_event))
 
 
 
 ---(end of broadcast)---
 TIP 2: Don't 'kill -9' the postmaster

-- 
  Bruce Momjian   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [PATCHES] Contrib module to examine client certificate

2006-09-01 Thread Bruce Momjian

I assume this is something we want in /contrib, right?

---

Victor B. Wagner wrote:
 Following patch provides new contrib module pgsslinfo, which contains
 several server-side functions, which allow to examine information about 
 SSL client certificate, used to connect to the server.
 
 This information can be used for example, for logging user access. 
 
 Textual information from certificate distninguished name is converted
 into current database charset, which allow non-latin characters in the
 names to be readable. 
 
 Module was developed using latest stable version of OpenSSL (0.9.8b).
 Probably, it should work with previous stable version of OpenSSL
 (0.9.7something) which is still widely used, or even with outdated
 version 0.9.6, but I haven't tested it.
 
 Module requires access to PostgreSQL variable MyProcPort, which is not
 declared DLLIMPORT in the appropriate header file (miscadmin.h).
 So, this patch includes one-line patch to this header file, to allow
 module compile and work under win32.
 
 

[ Attachment, skipping... ]

 
 ---(end of broadcast)---
 TIP 3: Have you checked our extensive FAQ?
 
http://www.postgresql.org/docs/faq

-- 
  Bruce Momjian   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

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


Re: [PATCHES] Proposed patch for rules with RETURNING

2006-09-01 Thread Tom Lane
Jonah H. Harris [EMAIL PROTECTED] writes:
 On 9/1/06, Tom Lane [EMAIL PROTECTED] wrote:
 Attached is a draft patch that makes rules support RETURNING ...

 What format is that patch in?  Either something's wrong or Gmail just
 went really wacko.

It's just a gzip'd patch diff.

regards, tom lane

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


Re: [PATCHES] Contrib module to examine client certificate

2006-09-01 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes:
 I assume this is something we want in /contrib, right?

Peter posted an updated version, I believe.

regards, tom lane

---(end of broadcast)---
TIP 1: 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: [HACKERS] [PATCHES] Contrib module to examine client

2006-09-01 Thread Bruce Momjian
Tom Lane wrote:
 Bruce Momjian [EMAIL PROTECTED] writes:
  I assume this is something we want in /contrib, right?
 
 Peter posted an updated version, I believe.

Ah, it was lower in my mailbox.  Thanks.

-- 
  Bruce Momjian   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq