Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-21 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, Apr 20, 2011 at 11:39:47AM -0700, Josh Berkus wrote:

[...]

 Review of design concepts and WIP patches has *always* been a problem
 for this project [...]

 We tell people to submit a design concept, but then such submissions are
 often ignored.  When they're not ignored, they often are subject to
 either extreme bikeshedding or a lot of negativity around things the
 author hasn't implemented yet ... even if the author warns that they're
 not implemented.

I'm not a committer. So take this data point for what it's worth. But I
have been following this list for quite a while, and I must say: I (very
respectfully!) disagree. Having  watched mailing lists for other
projects, the quality of the answers one gets here is outstanding. The
tone might be sometimes a bit tight (but never disrespectful or
flaming), but seriously: what do I get off a friendly answer if there is
no content?

The same goes to -GENERAL. I've always got answers to my (sometimes, in
hindsight quite stupid) questions which actually *helped* to solve my
problem.

It's OK to strive to improve the process, but I think you all are quite
good.

[...]

 So in the spirit of NOT reinventing the wheel: ReviewBoard.  Yes,
 really [...]
 [...]  But I think it's time to try something else, maybe
 several other things.

Maybe. But I *do* understand the unwillingness to change that. I've
contributed (tiny) patches to more that one project, and it's
frustrating to fight the bug-tracker-du-jour system. This one won't talk
to me unless my browser talks Javascript. That one... (you get the
idea). I strongly appreciate the free-flowing mailing list style here
(maybe it's just an age problem ;-)

Regards
- -- tomás
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFNr9IhBcgs9XrR2kYRAkw+AJoDFJcnpR06VpGNVAzsbx/eZpQcxACfUv//
vFsZsPiYlM78fxsjCLQvbHw=
=A+7H
-END PGP SIGNATURE-

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


Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-21 Thread Peter Eisentraut
On Wed, 2011-04-20 at 21:09 -0400, Robert Haas wrote:
 But
 even then I think we'd have this problem of people being unwilling to
 give up on jamming stuff into a release, regardless of the scheduling
 impact of doing so.  I actually think the problem of getting releases
 out on time is a *much* bigger problem for us than how long or short
 CommitFests are.

I think to really address that problem, you need to think about shorter
release cycles overall, like every 6 months.  Otherwise, the current 12
to 14 month horizon is just too long psychologically.


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


[HACKERS] fsync reliability

2011-04-21 Thread Simon Riggs
Daniel Farina points out to me that the Linux man page for fsync() says
Calling fsync() does not necessarily ensure that the entry in the directory
   containing the file has also reached disk.  For that an
explicit fsync() on a
   file descriptor for the directory is also needed.
http://www.kernel.org/doc/man-pages/online/pages/man2/fsync.2.html

That phrase does not exist here
http://pubs.opengroup.org/onlinepubs/007908799/xsh/fsync.html

This point appears to have been discussed before
http://postgresql.1045698.n5.nabble.com/ALTER-DATABASE-SET-TABLESPACE-vs-crash-safety-td1995703.html

Tom said
We don't try to fsync the
directory after a normal table create for instance

which is fine because we don't need to. In the event of a crash a
missing table would be recreated during crash recovery.

However, that begs the question of what happens with WAL. At present,
we do nothing to ensure that the entry in the directory containing
the file has also reached disk.

ISTM that we can easily do this, since we preallocate WAL files during
RemoveOldXlogFiles() and rarely extend the number of files.
So it seems easily possible to fsync the pg_xlog directory at the end
of RemoveOldXlogFiles(), which is mostly performed by the bgwriter
anyway.

It was also noted that we've always expected the filesystem to take
care of its own metadata
which isn't actually stated anywhere in the docs, AFAIK.

Perhaps this is an irrelevant problem these days, but would it hurt to fix?

Happy to do the patch if we agree.

-- 
 Simon Riggs   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, 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


[HACKERS] Re: database system identifier differs between the primary and standby

2011-04-21 Thread rajibdk
What does that database system identifier means? Is it related to DB 
transactions' or unique to a version?

Rajib Deka
SIEMENS Ltd.
Robert V Chandran Tower, First Floor, West Wing,
#149, Velechery Tambaram Main Road, Pallikaranai, Chennai-100, INDIA.
www.siemens.comhttp://www.siemens.com

Mob: +91-9176780669 | E-Mail: rajib.d...@siemens.com

From: Robert Haas [via PostgreSQL] 
[mailto:ml-node+4326869-1711138747-200...@n5.nabble.com]
Sent: Wednesday, April 20, 2011 7:20 PM
To: Deka, Rajib IN MAA SL
Subject: Re: database system identifier differs between the primary and standby

On Wed, Apr 20, 2011 at 9:28 AM, rajibdk [hidden 
email]/user/SendEmail.jtp?type=nodenode=4326869i=0by-user=t wrote:
 We are getting the following log while configuring hot standby,

 2011-04-20 17:34:40 ETC/GMT FATAL:  the database system is starting up
 2011-04-20 17:34:41 ETC/GMT FATAL:  database system identifier differs
 between the primary and standby
 2011-04-20 17:34:41 ETC/GMT DETAIL:  The primary's identifier is
 5592072752411433371, the standby's identifier is 5597615802844953578.

 PostgreSQL Version: 9.0.2

You need to initialize the slave using a hot backup taken on the master.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list ([hidden 
email]/user/SendEmail.jtp?type=nodenode=4326869i=1by-user=t)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


If you reply to this email, your message will be added to the discussion below:
http://postgresql.1045698.n5.nabble.com/database-system-identifier-differs-between-the-primary-and-standby-tp4317178p4326869.html
To unsubscribe from database system identifier differs between the primary and 
standby, click 
herehttp://postgresql.1045698.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4317178code=cmFqaWIuZGVrYUBzaWVtZW5zLmNvbXw0MzE3MTc4fC0zNTQ2NTE2Njg=.


Important notice: This e-mail and any attachment there to contains corporate 
proprietary information. If you have received it by mistake, please notify us 
immediately by reply e-mail and delete this e-mail and its attachments from 
your system.
Thank You.


--
View this message in context: 
http://postgresql.1045698.n5.nabble.com/database-system-identifier-differs-between-the-primary-and-standby-tp4317178p4330373.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.

Re: [HACKERS] Re: database system identifier differs between the primary and standby

2011-04-21 Thread Heikki Linnakangas

On 21.04.2011 12:31, rajibdk wrote:

What does that database system identifier means? Is it related to DB 
transactions' or unique to a version?


It's an identifier unique to each PostgreSQL database cluster. It's 
generated when you run initdb.


--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

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


Re: [HACKERS] Re: database system identifier differs between the primary and standby

2011-04-21 Thread Simon Riggs
On Thu, Apr 21, 2011 at 10:31 AM, rajibdk rajib.d...@siemens.com wrote:

 What does that database system identifier means? Is it related to DB
 transactions’ or unique to a version?

Regrettably, it means you didn't follow the documented procedure.

It isn't possible to do it any other way, so those questions are a distraction.

-- 
 Simon Riggs   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, 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


[HACKERS] hot backups: am I doing it wrong, or do we have a problem with pg_clog?

2011-04-21 Thread Daniel Farina
To start at the end of this story: DETAIL:  Could not read from file
pg_clog/007D at offset 65536: Success.

This is a message we received on a a standby that we were bringing
online as part of a test.  The clog file was present, but apparently
too small for Postgres (or at least I tihnk this is what the message
meant), so one could stub in another clog file and then continue
recovery successfully (modulus the voodoo of stubbing in clog files in
general).  I am unsure if this is due to an interesting race condition
in Postgres or a result of my somewhat-interesting hot-backup
protocol, which is slightly more involved than the norm.  I will
describe what it does here:

1) Call pg start backup
2) crawl the entire postgres cluster directory structure, except
pg_xlog, taking notes of the size of every file present
3) begin writing TAR files, but *only up to the size noted during the
original crawling of the cluster directory,* so if the file grows
between the original snapshot and subsequently actually calling read()
on the file those extra bytes will not be added to the TAR.
  3a) If a file is truncated partially, I add \0 bytes to pad the
tarfile member up to the size sampled in step 2, as I am streaming the
tar file and cannot go back in the stream and adjust the tarfile
member size
4) call pg stop backup

The reason I go to this trouble is because I use many completely
disjoint tar files to do parallel compression, decompression,
uploading, and downloading of the base backup of the database, and I
want to be able to control the size of these files up-front.  The
requirement of stubbing in \0 is because of a limitation of the tar
format when dealing with streaming archives and the requirement to
truncate the files to the size snapshotted in the step 2 is to enable
splitting up the files between volumes even in the presence of
possible concurrent growth while I'm performing the hot backup. (ex: a
handful of nearly-empty heap files can rapidly grow due to a
concurrent bulk load if I get unlucky, which I do not intend to allow
myself to be).

Any ideas?  Or does it sound like I'm making some bookkeeping errors
and should review my code again?  It does work most of the time.  I
have not gotten a sense how often this reproduces just yet.

-- 
fdr

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


[HACKERS] Defining input function for new datatype

2011-04-21 Thread Nick Raj
Hi,
I am defining a new data type called mpoint
i.e.
typedef struct mpoint
{
Point p;
Timestamp t;
} mpoint;

For defining input/output function

1 Datum mpoint_in(PG_FUNCTION_ARGS)
2 {
3
4mpoint *result;
5char *pnt=(char *)malloc (sizeof (20));
6char *ts=(char *)malloc (sizeof (20));
7result= (mpoint *) palloc(sizeof(mpoint));
8char *st = PG_GETARG_CSTRING(0);
9mpoint_decode(st,pnt,ts);
// st breaks down into pnt that corresponds to Point and ts corresponds to
Timestamp
10
11  result-p = point_in(PointerGetDatum(pnt));//
point_in (input function for point that assigns x, y into point)
12  result- t = timestamp_in(PointerGetDatum(ts)); // similar
for timestamp
13
14  PG_RETURN_MPOINT_P(result);
15   }

line no 11 warning: passing argument 1 of ‘point_in’ makes pointer from
integer without a cast
 ../../../include/utils/geo_decls.h:191: note: expected
‘FunctionCallInfo’ but argument is of type ‘unsigned int’
line no 11 error: incompatible types when assigning to type ‘Point’ from
type ‘Datum’
line no 12 warning: passing argument 1 of ‘timestamp_in’ makes pointer from
integer without a cast
 ../../../include/utils/timestamp.h:205: note: expected
‘FunctionCallInfo’ but argument is of type ‘unsigned int’

Can anybody figure out what kind of mistake i am doing?
Also, why it got related to 'FunctionCallInfo' ?

Thanks
Nick


Re: [HACKERS] Defining input function for new datatype

2011-04-21 Thread Pavel Stehule
Hello

2011/4/21 Nick Raj nickrajj...@gmail.com:
 Hi,
 I am defining a new data type called mpoint
 i.e.
 typedef struct mpoint
 {
     Point p;
     Timestamp t;
 } mpoint;

 For defining input/output function

 1 Datum mpoint_in(PG_FUNCTION_ARGS)
 2 {
 3
 4    mpoint *result;
 5    char *pnt=(char *)malloc (sizeof (20));
 6    char *ts=(char *)malloc (sizeof (20));
 7    result= (mpoint *) palloc(sizeof(mpoint));
 8    char *st = PG_GETARG_CSTRING(0);
 9    mpoint_decode(st,pnt,ts);
 // st breaks down into pnt that corresponds to Point and ts corresponds to
 Timestamp
 10
 11  result-p = point_in(PointerGetDatum(pnt));    //
 point_in (input function for point that assigns x, y into point)
 12  result- t = timestamp_in(PointerGetDatum(ts)); // similar
 for timestamp
 13
 14  PG_RETURN_MPOINT_P(result);
 15   }

 line no 11 warning: passing argument 1 of ‘point_in’ makes pointer from
 integer without a cast
  ../../../include/utils/geo_decls.h:191: note: expected
 ‘FunctionCallInfo’ but argument is of type ‘unsigned int’
 line no 11 error: incompatible types when assigning to type ‘Point’ from
 type ‘Datum’
 line no 12 warning: passing argument 1 of ‘timestamp_in’ makes pointer from
 integer without a cast
  ../../../include/utils/timestamp.h:205: note: expected
 ‘FunctionCallInfo’ but argument is of type ‘unsigned int’


you are missing a important header files.

 Can anybody figure out what kind of mistake i am doing?
 Also, why it got related to 'FunctionCallInfo' ?

see on definition of PG_FUNCTION_ARGS macro

Regards

Pavel Stehule


 Thanks
 Nick


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


Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-21 Thread Simon Riggs
On Wed, Apr 20, 2011 at 8:54 PM, Tom Lane t...@sss.pgh.pa.us wrote:
 Peter Eisentraut pete...@gmx.net writes:
 I would imagine one commit fest per month, but
 it's only a week long.

 BTW, just as a thought experiment: what about a one-day CF once a week?
 Patch Tuesdays, if you will.  Spend all day reviewing/committing,
 bounce back whatever is not ready, patch authors try again next week.

 Really large patches are not going to fit into that paradigm, probably,
 but an awful lot of stuff would --- and it might help encourage more
 incremental development of the big ones, too.

I'm responding to this post with mostly general comments, not directed
specifically at Tom.

Speeding up the process means that people with more time get a bigger
say and people with less time get a smaller input than before. I'm
already concerned that the gap between patch submission and patch
commit is so short it effectively means feedback is impossible.

The more frequently we do integration, the greater proportion of our
time is spent doing that.

My concern is there are a relatively low number of people working on
features that lots of people care about. Senior time should not be
wasted on endless integration.

We should be encouraging people to spend more time on more useful
features, not an endless stream of trivial patches, integration and
release processes. None of our users give a flying, err, squirrel,
about our small patch review process. Especially when its absolutely
brilliant already.

My model of contributing to this project has always been to spend time
with customers, understanding solutions and problems, then bringing
that back to the community. That has brought both the funding to allow
me to contribute and a stream of ideas with a clear focus. I encourage
others to do the same. I don't think we should be working on an
interrupt driven model, we should be planning our contributions and
making sure we make the biggest impact possible with real code, not
just twittering about it constantly. If we spend too much time with
each other we will be exactly like the larger commercial development
groups who never meet users only each other. Even the General list
isn't fully representative of the actual/potential user base.

-- 
 Simon Riggs   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, 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


Re: [HACKERS] fsync reliability

2011-04-21 Thread Alvaro Herrera
Excerpts from Simon Riggs's message of jue abr 21 05:26:06 -0300 2011:

 ISTM that we can easily do this, since we preallocate WAL files during
 RemoveOldXlogFiles() and rarely extend the number of files.
 So it seems easily possible to fsync the pg_xlog directory at the end
 of RemoveOldXlogFiles(), which is mostly performed by the bgwriter
 anyway.
 
 It was also noted that we've always expected the filesystem to take
 care of its own metadata
 which isn't actually stated anywhere in the docs, AFAIK.
 
 Perhaps this is an irrelevant problem these days, but would it hurt to fix?

I don't think it's irrelevant (yet).  Even Greg Smith's book suggests to
use ext2 for the WAL partition in extreme cases.

-- 
Álvaro Herrera alvhe...@commandprompt.com
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

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


Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-21 Thread Kevin Grittner
Peter Eisentraut pete...@gmx.net wrote:
 
 you need to think about shorter release cycles overall, like every
 6 months.
 
With the current time between feature freeze and release, that
wouldn't leave a lot of time for development.
 
-Kevin

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


Re: [HACKERS] hot backups: am I doing it wrong, or do we have a problem with pg_clog?

2011-04-21 Thread Merlin Moncure
On Thu, Apr 21, 2011 at 6:15 AM, Daniel Farina dan...@heroku.com wrote:
 To start at the end of this story: DETAIL:  Could not read from file
 pg_clog/007D at offset 65536: Success.

 This is a message we received on a a standby that we were bringing
 online as part of a test.  The clog file was present, but apparently
 too small for Postgres (or at least I tihnk this is what the message
 meant), so one could stub in another clog file and then continue
 recovery successfully (modulus the voodoo of stubbing in clog files in
 general).  I am unsure if this is due to an interesting race condition
 in Postgres or a result of my somewhat-interesting hot-backup
 protocol, which is slightly more involved than the norm.  I will
 describe what it does here:

 1) Call pg start backup
 2) crawl the entire postgres cluster directory structure, except
 pg_xlog, taking notes of the size of every file present
 3) begin writing TAR files, but *only up to the size noted during the
 original crawling of the cluster directory,* so if the file grows
 between the original snapshot and subsequently actually calling read()
 on the file those extra bytes will not be added to the TAR.
  3a) If a file is truncated partially, I add \0 bytes to pad the
 tarfile member up to the size sampled in step 2, as I am streaming the
 tar file and cannot go back in the stream and adjust the tarfile
 member size
 4) call pg stop backup

 The reason I go to this trouble is because I use many completely
 disjoint tar files to do parallel compression, decompression,
 uploading, and downloading of the base backup of the database, and I
 want to be able to control the size of these files up-front.  The
 requirement of stubbing in \0 is because of a limitation of the tar
 format when dealing with streaming archives and the requirement to
 truncate the files to the size snapshotted in the step 2 is to enable
 splitting up the files between volumes even in the presence of
 possible concurrent growth while I'm performing the hot backup. (ex: a
 handful of nearly-empty heap files can rapidly grow due to a
 concurrent bulk load if I get unlucky, which I do not intend to allow
 myself to be).

 Any ideas?  Or does it sound like I'm making some bookkeeping errors
 and should review my code again?  It does work most of the time.  I
 have not gotten a sense how often this reproduces just yet.

Everyone here is going to assume the problem is in your (too?) fancy
tar/diff delta archiving approach because we can't see that code and
it just sounds suspicious.  A busted clog file is of course very
noteworthy but to eliminate your stuff you should try reproducing
using a more standard method of grabbing the base backup.

Have you considered using rsync instead?

merlin

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


Re: [HACKERS] smallserial / serial2

2011-04-21 Thread Tom Lane
Mike Pultz m...@mikepultz.com writes:
 I use tables all the time that have sequences on smallint's; 
 I'd like to simplify my create files by not having to create the sequence
 first, but I also don't want to give up those 2 bytes per column!

A sequence that can only go to 32K doesn't seem all that generally
useful ...

Are you certain that you're really saving anything?  More likely than
not, the saved 2 bytes are going to disappear into alignment padding
of a later column or of the whole tuple.  Even if it really does help
for your case, that's another reason to doubt that it's generally
useful.

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


Re: [HACKERS] hot backups: am I doing it wrong, or do we have a problem with pg_clog?

2011-04-21 Thread Andres Freund
Hi,

On Thursday, April 21, 2011 01:15:48 PM Daniel Farina wrote:
 Any ideas?  Or does it sound like I'm making some bookkeeping errors
 and should review my code again?  It does work most of the time.  I
 have not gotten a sense how often this reproduces just yet.
I would suggest taking both, your backup, and a simpler version for now. When 
the error occurs again you can compare...

Andres

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


Re: [HACKERS] [GENERAL] Defining input function for new datatype

2011-04-21 Thread Tom Lane
Nick Raj nickrajj...@gmail.com writes:
 1 Datum mpoint_in(PG_FUNCTION_ARGS)
 2 {
 3
 4mpoint *result;
 5char *pnt=(char *)malloc (sizeof (20));
 6char *ts=(char *)malloc (sizeof (20));

(1) You should *not* use malloc here.  There is seldom any reason to use
malloc directly at all in functions coded for Postgres.  Use palloc,
or expect memory leaks.

(2) sizeof(20) almost certainly doesn't mean what you want.  It's most
likely 4 ...

 11  result-p = point_in(PointerGetDatum(pnt));//
 point_in (input function for point that assigns x, y into point)

You need to use DirectFunctionCallN when trying to call a function that
obeys the PG_FUNCTION_ARGS convention, as point_in does.  And the result
is a Datum, which means you're going to need to apply a DatumGetWhatever
macro to get a bare Point or Timestamp from these functions.

Look around in the PG sources for examples.

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


Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-21 Thread Peter Eisentraut
On Thu, 2011-04-21 at 14:01 +0100, Simon Riggs wrote:
 We should be encouraging people to spend more time on more useful
 features, not an endless stream of trivial patches, integration and
 release processes.

Hence the proposal to cut that time down and make it count better.

Which direction were you thinking?



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


Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-21 Thread Peter Eisentraut
On Thu, 2011-04-21 at 08:42 -0500, Kevin Grittner wrote:
  you need to think about shorter release cycles overall, like every
  6 months.
  
 With the current time between feature freeze and release, that
 wouldn't leave a lot of time for development.

Presumably, one would aim to cut all the other things in half as well.


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


Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-21 Thread Robert Haas
On Thu, Apr 21, 2011 at 2:43 AM, Peter Eisentraut pete...@gmx.net wrote:
 On Wed, 2011-04-20 at 21:09 -0400, Robert Haas wrote:
 But
 even then I think we'd have this problem of people being unwilling to
 give up on jamming stuff into a release, regardless of the scheduling
 impact of doing so.  I actually think the problem of getting releases
 out on time is a *much* bigger problem for us than how long or short
 CommitFests are.

 I think to really address that problem, you need to think about shorter
 release cycles overall, like every 6 months.  Otherwise, the current 12
 to 14 month horizon is just too long psychologically.

I agree.  I am in favor of a shorter release cycle.  But I think that
a shorter release cycle won't work well if there is still four month
long integration period at the end of each series of CommitFests.  The
problem is a bit circular here: because release cycles are long,
people really, really want to slip as much as possible in at the end.
But being under time pressure to get things committed results in a
higher bug count, which means more things that have to be fixed after
feature freeze, which translates into a long release cycle.

I think that it's not too bad if the process of a release getting out
the door results in effectively missing one CommitFest.  For example,
if we imagine one-month CommitFests starting every two months, and we
had a CommitFest starting on January 15th, it wouldn't be too painful
if we skipped a hypothetical March 15th CommitFest to get the release
done, and then started up the process again on May 15th.  However, in
practice, what happens is we miss *two* CommitFests: the expectation
is that the next CommitFest will be on the order of July 15th, which
is just too long.  Similarly, if we did shorter CommitFests and
shorter releases - say, five one-week-a-month CommitFests in July,
August, September, October, and November, I'd want to kick a release
out in December and reopen for development in January, not get stuck
with the same six-month feature freeze we have now, or even a
four-month feature freeze.  But that isn't going to work if people do
the same sort of throwing everything into the kitchen sink at the last
minute that we have been doing for at least the last couple of
releases.

In fact, I don't believe that the current CF cycle really forces a
huge amount of waiting-for-feedback.  It's true that if you submit a
patch at a randomly chosen time, you will have to wait up to two
months for a CommitFest to start, and then you might not get a review
until late in the CommitFest, so it could take you up to three months
to get a review.  In practice, patches are not submitted at random
times - in fact, probably 50% of the patches come in during the last
week before the CF starts, and typically perhaps 50% of the patches
get a review in the first week, and maybe 80% within the first two
weeks.   Some patches also get an initial review between CommitFests,
which further improves the average.  Overall, I bet the average time
between patch submission and first review is 3 weeks.  You can
typically get 2 or 3 followup reviews during the same cycle with only
a few days latency for each.  Even though it would be nice to do
better, for an all-volunteer project, I think it's respectable.   I
can't say the same thing about our process from getting from feature
freeze to release.  It's really long, and it's nearly all fixing bugs
in code that was committed in the last CF, and the last CF produces
exponentially more bugs than the earlier ones, and it's often the case
that people don't fix their own bugs and someone else has to jump in
to pick up the slack.  Meanwhile, the regular flow of reviewing and
committing patches is completely disrupted; and once in a while
someone gets flamed for so much as bringing up a new feature that
they're interested in working on for the next release (which I think
is totally unwarranted; now is the PERFECT time to begin roughing out
plans for 9.2 work... but I digress).

So while I'm mildly interested in the idea of shifting the CF cycle
around to provide more timely review, I can't really get that excited
about it, especially if there's any risk that we are just shifting
more of the work from the CommitFest cycle to the
end-of-release-interminable-integration-period.  However, if there's
some way of avoiding the phenomenon where all hell breaks loose
because people jam four major new features into the tree in as many
weeks, sign me up.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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


Re: [HACKERS] Typed table DDL loose ends

2011-04-21 Thread Peter Eisentraut
On Wed, 2011-04-20 at 10:44 -0400, Noah Misch wrote:
 If we add that ownership check, we'll protect some operations on the
 type.  The
 cost is localized divergence from our principle that types have no
 usage
 restrictions.  I'm of the opinion that it's not worth introducing that
 policy
 exception to block just some of these avenues of attack.  I would not
 object to
 it, though. 

So that means we should leave it as is for now?  Fine with me.


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


Re: [HACKERS] Re: database system identifier differs between the primary and standby

2011-04-21 Thread Robert Haas
On Thu, Apr 21, 2011 at 6:38 AM, Simon Riggs si...@2ndquadrant.com wrote:
 On Thu, Apr 21, 2011 at 10:31 AM, rajibdk rajib.d...@siemens.com wrote:
 What does that database system identifier means? Is it related to DB
 transactions’ or unique to a version?

 Regrettably, it means you didn't follow the documented procedure.

 It isn't possible to do it any other way, so those questions are a 
 distraction.

I think they are perfectly good questions.  If someone is trying to
understand how our product works, we should encourage that.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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


Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-21 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes:
 On Thu, Apr 21, 2011 at 2:43 AM, Peter Eisentraut pete...@gmx.net wrote:
 I think to really address that problem, you need to think about shorter
 release cycles overall, like every 6 months.  Otherwise, the current 12
 to 14 month horizon is just too long psychologically.

 I agree.  I am in favor of a shorter release cycle.

I'm not.  I don't think there is any demand among *users* (as opposed to
developers) for more than one major PG release a year.  It's hard enough
to get people to migrate that often.

Another problem is that if you halve the release interval, you either
double the amount of work spent on maintaining back branches, or halve
the support lifetime of a branch.  Neither of those is attractive.

Now, it certainly would be nice to spend less time in beta mode as
opposed to development, and I think most of the points being made here
are really about how to cut that.  But reducing the release interval is
not going to reduce the total amount of time we spend in beta mode;
in fact I'd expect it to increase.  Halving the amount of development
time per release doesn't mean that you can cut beta time proportionally.
It just takes time to cut a release, and time for testers to try it.

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


Re: [HACKERS] hot backups: am I doing it wrong, or do we have a problem with pg_clog?

2011-04-21 Thread Robert Haas
On Thu, Apr 21, 2011 at 7:15 AM, Daniel Farina dan...@heroku.com wrote:
 To start at the end of this story: DETAIL:  Could not read from file
 pg_clog/007D at offset 65536: Success.

 This is a message we received on a a standby that we were bringing
 online as part of a test.  The clog file was present, but apparently
 too small for Postgres (or at least I tihnk this is what the message
 meant), so one could stub in another clog file and then continue
 recovery successfully (modulus the voodoo of stubbing in clog files in
 general).  I am unsure if this is due to an interesting race condition
 in Postgres or a result of my somewhat-interesting hot-backup
 protocol, which is slightly more involved than the norm.  I will
 describe what it does here:

 1) Call pg start backup
 2) crawl the entire postgres cluster directory structure, except
 pg_xlog, taking notes of the size of every file present
 3) begin writing TAR files, but *only up to the size noted during the
 original crawling of the cluster directory,* so if the file grows
 between the original snapshot and subsequently actually calling read()
 on the file those extra bytes will not be added to the TAR.
  3a) If a file is truncated partially, I add \0 bytes to pad the
 tarfile member up to the size sampled in step 2, as I am streaming the
 tar file and cannot go back in the stream and adjust the tarfile
 member size
 4) call pg stop backup

In theory I would expect any defects introduced by the, ahem,
exciting, procedure described in steps 3 and 3a to be corrected by
recovery automatically when you start the new cluster.  It shouldn't
matter exactly when you read the file, and recovery for unrelated
blocks ought to proceed totally independently, and an all-zeros block
should be treated the same way as one that isn't allocated yet, so it
seems like it ought to work.  But you may be stressing some paths in
the recovery code that don't get regular exercise, since the manner in
which you are taking the backup can produce backups that are different
from any backup that could be taken by the normal method, and those
paths might have bugs.  It's also possible, as others have said, that
you've botched it.  :-)

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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


[HACKERS] stored procedures

2011-04-21 Thread Peter Eisentraut
So the topic of real stored procedures came up again.  Meaning a
function-like object that executes outside of a regular transaction,
with the ability to start and stop SQL transactions itself.

I would like to collect some specs on this feature.  So does anyone have
links to documentation of existing implementations, or their own spec
writeup?  A lot of people appear to have a very clear idea of this
concept in their own head, so let's start collecting those.



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


Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-21 Thread Andrew Dunstan



On 04/21/2011 11:16 AM, Tom Lane wrote:

Robert Haasrobertmh...@gmail.com  writes:

On Thu, Apr 21, 2011 at 2:43 AM, Peter Eisentrautpete...@gmx.net  wrote:

I think to really address that problem, you need to think about shorter
release cycles overall, like every 6 months.  Otherwise, the current 12
to 14 month horizon is just too long psychologically.

I agree.  I am in favor of a shorter release cycle.

I'm not.  I don't think there is any demand among *users* (as opposed to
developers) for more than one major PG release a year.  It's hard enough
to get people to migrate that often.


I agree.


Another problem is that if you halve the release interval, you either
double the amount of work spent on maintaining back branches, or halve
the support lifetime of a branch.  Neither of those is attractive.


I *really* *really* agree.


cheers

andrew

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


Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-21 Thread Ross J. Reedstrom
On Thu, Apr 21, 2011 at 11:16:45AM -0400, Tom Lane wrote:
 Robert Haas robertmh...@gmail.com writes:
  On Thu, Apr 21, 2011 at 2:43 AM, Peter Eisentraut pete...@gmx.net wrote:
  I think to really address that problem, you need to think about shorter
  release cycles overall, like every 6 months. �Otherwise, the current 12
  to 14 month horizon is just too long psychologically.
 
  I agree.  I am in favor of a shorter release cycle.
 
 I'm not.  I don't think there is any demand among *users* (as opposed to
 developers) for more than one major PG release a year.  It's hard enough
 to get people to migrate that often.

In fact, I predict that the observed behavior would be for even more end
users to start skipping releases. Some already do - it's common not to
upgrade unless there's a feature you really need, but for those who do
stay on the 'current' upgrade path, you'll lose some who can't afford to
spend more than one integration-testing round a year.

Ross
-- 
Ross Reedstrom, Ph.D. reeds...@rice.edu
Systems Engineer  Admin, Research Scientistphone: 713-348-6166
Connexions  http://cnx.orgfax: 713-348-3665
Rice University MS-375, Houston, TX 77005
GPG Key fingerprint = F023 82C8 9B0E 2CC6 0D8E  F888 D3AE 810E 88F0 BEDE

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


Re: [HACKERS] getting to beta

2011-04-21 Thread Peter Eisentraut
On Tue, 2011-04-19 at 18:18 -0400, Robert Haas wrote:
 2. The typed tables stuff vs. pg_upgrade still needs work.  I would be
 just as happy if Tom or Peter wanted to fix this, mostly for fear of
 getting flak over the details of the fixes, but if not I will do it.

Noah Misch is hot on the trail of that one.

 - There is an outstanding bug-fix patch for PL/python tracebacks,

That has been addressed.



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


Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-21 Thread Robert Haas
On Thu, Apr 21, 2011 at 11:16 AM, Tom Lane t...@sss.pgh.pa.us wrote:
 Robert Haas robertmh...@gmail.com writes:
 On Thu, Apr 21, 2011 at 2:43 AM, Peter Eisentraut pete...@gmx.net wrote:
 I think to really address that problem, you need to think about shorter
 release cycles overall, like every 6 months.  Otherwise, the current 12
 to 14 month horizon is just too long psychologically.

 I agree.  I am in favor of a shorter release cycle.

 I'm not.  I don't think there is any demand among *users* (as opposed to
 developers) for more than one major PG release a year.  It's hard enough
 to get people to migrate that often.

I agree there's probably little user demand, and back-branch
maintenance is an issue, but I think if it removed the temptation to
cram major new features into the tree at the last minute, it might be
worth it.  However, a possibly more likely outcome is that we'd still
have that temptation, just more frequently; and end up with even less
of the year open to new patches than is currently the case.

 Another problem is that if you halve the release interval, you either
 double the amount of work spent on maintaining back branches, or halve
 the support lifetime of a branch.  Neither of those is attractive.

 Now, it certainly would be nice to spend less time in beta mode as
 opposed to development, and I think most of the points being made here
 are really about how to cut that.  But reducing the release interval is
 not going to reduce the total amount of time we spend in beta mode;
 in fact I'd expect it to increase.  Halving the amount of development
 time per release doesn't mean that you can cut beta time proportionally.
 It just takes time to cut a release, and time for testers to try it.

I believe that the problem is much more related to the fact that we
commit things at the end of the cycle that aren't really done than it
is to the amount of time beta testers need to try things.  If we were
only waiting on testing, we could branch the tree and call the release
du jour beta for another N months, then release, meanwhile continuing
development.  In fact, you and I and three or four other people have
spent most of our visible PG time over the last 2 months fixing MANY
bugs, mostly in the six or so major features committed between
February 7th and March 6th.  (By way of comparison, notice how few
bugs that have been in the major patches from CF3 - because those
things were actually pretty much working *when they were committed*.)

Now, we're getting to the point where that might actually be a
reasonable way to go.  It wouldn't bother me a bit to branch the tree
just after beta1 and start a new cycle of CommitFests on May 15th, and
we could begin integrating some of the big stuff that didn't make it
into 9.1: key locks, range types, additional sync rep modes, snapshot
cloning, parallel pg_dump, etc.  It would be great to start working on
that stuff while it's still mildly fresh in people's minds, and at the
*beginning* of the release cycle.  We're probably doomed to another
fall release at this point anyway, so it's not clear to me that the
inevitable loss of focus that will ensue is really costing anything.
Had we gotten to beta1 on March 1st, I'd probably be in favor of going
all in to get the release out in June or maybe on July 1, but at this
point that seems unlikely to be realistic.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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


Re: [HACKERS] stored procedures

2011-04-21 Thread Pavel Stehule
Hi Peter

2011/4/21 Peter Eisentraut pete...@gmx.net:
 So the topic of real stored procedures came up again.  Meaning a
 function-like object that executes outside of a regular transaction,
 with the ability to start and stop SQL transactions itself.

 I would like to collect some specs on this feature.  So does anyone have
 links to documentation of existing implementations, or their own spec
 writeup?  A lot of people appear to have a very clear idea of this
 concept in their own head, so let's start collecting those.


I had a patch for transactional procedures, but this is lost :(

http://okbob.blogspot.com/2007/11/stacked-recordset-multirecordset.html

What I (We) expect:

Very important points:
1. possible explicit transaction controlling - not only subtransactions
2. correct or usual behave of OUT parameters (important for JDBC people)
*** attention: overloading is related to OUT parameters too ***

Not necessary but nice:
3. Support for multirecordset and RETURN_STATUS variable
(RETURN_STATUS is defined by ANSI)

Regards

Pavel




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


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


Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-21 Thread Robert Haas
On Thu, Apr 21, 2011 at 11:37 AM, Ross J. Reedstrom reeds...@rice.edu wrote:
 On Thu, Apr 21, 2011 at 11:16:45AM -0400, Tom Lane wrote:
 Robert Haas robertmh...@gmail.com writes:
  On Thu, Apr 21, 2011 at 2:43 AM, Peter Eisentraut pete...@gmx.net wrote:
  I think to really address that problem, you need to think about shorter
  release cycles overall, like every 6 months.  Otherwise, the current 12
  to 14 month horizon is just too long psychologically.

  I agree.  I am in favor of a shorter release cycle.

 I'm not.  I don't think there is any demand among *users* (as opposed to
 developers) for more than one major PG release a year.  It's hard enough
 to get people to migrate that often.

 In fact, I predict that the observed behavior would be for even more end
 users to start skipping releases. Some already do - it's common not to
 upgrade unless there's a feature you really need, but for those who do
 stay on the 'current' upgrade path, you'll lose some who can't afford to
 spend more than one integration-testing round a year.

Well, that aspect of the problem doesn't bother me, much.  I don't
really care whether people upgrade to each new release the moment it
comes out anyway.  It would require us to keep any
backward-compatibility hacks around for more releases, but we're
pretty good about that anyway.  8.3 broke the world, but the last few
releases have been pretty smooth for most people, I think.

Not to say that there aren't OTHER problems with the idea...

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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


Re: [HACKERS] getting to beta

2011-04-21 Thread Robert Haas
On Thu, Apr 21, 2011 at 11:38 AM, Peter Eisentraut pete...@gmx.net wrote:
 On Tue, 2011-04-19 at 18:18 -0400, Robert Haas wrote:
 2. The typed tables stuff vs. pg_upgrade still needs work.  I would be
 just as happy if Tom or Peter wanted to fix this, mostly for fear of
 getting flak over the details of the fixes, but if not I will do it.

 Noah Misch is hot on the trail of that one.

Yes, but inasmuch as he is not a committer, someone who is will need
to be involved.  I dealt with the prerequisite ALTER TABLE .. OF/NOT
OF patch last night, but the related pg_dump patch that actually fixes
the problem still needs to be looked at, and the earliest (and
probably only) time that I can potentially do that is Monday.  So it
would be great if you or someone else could pick it up.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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


Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-21 Thread Tom Lane
[ another thought on this topic ]

Robert Haas robertmh...@gmail.com writes:
 I think that it's not too bad if the process of a release getting out
 the door results in effectively missing one CommitFest. ...
 But that isn't going to work if people do
 the same sort of throwing everything into the kitchen sink at the last
 minute that we have been doing for at least the last couple of
 releases.

 In fact, I don't believe that the current CF cycle really forces a
 huge amount of waiting-for-feedback.  It's true that if you submit a
 patch at a randomly chosen time, you will have to wait up to two
 months for a CommitFest to start, and then you might not get a review
 until late in the CommitFest, so it could take you up to three months
 to get a review.  In practice, patches are not submitted at random
 times - in fact, probably 50% of the patches come in during the last
 week before the CF starts, and typically perhaps 50% of the patches
 get a review in the first week, and maybe 80% within the first two
 weeks.

But aren't those two sides of the same coin, ie, people's natural
tendency to work to a deadline?  If you approve of a lot of patches
showing up just in time for a commitfest, why don't you approve of
big patches showing up just in time for a release?  I mean, I've been
heard to complain about that too, but complaining hasn't changed
anyone's behavior and it's foolish to expect that it will in the
future.  (See insanity, definition of.)

We need to find a way to work with that behavior, not try to change it.
I don't know what exactly.

One idea that comes to mind is to give up on the linear development-mode-
then-beta-mode management model, ie, allow development of release N+1
to start while beta is still going on for release N.  The principal
objection to this in the past has been that the PG development community
is too small to do more than one thing at once, but maybe that's not
true anymore.  The thing I'd be most worried about is how we get enough
energy directed at the release-stabilization part of the work, when for
most developers the new-development part is much more interesting/fun.
But we have that problem in some form already --- it's not clear to me
how much of the community really engages in what happens during beta,
rather than quietly working on stuff for the next release.

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


Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-21 Thread Andres Freund
On Thursday, April 21, 2011 05:43:16 PM Robert Haas wrote:
 On Thu, Apr 21, 2011 at 11:37 AM, Ross J. Reedstrom reeds...@rice.edu 
wrote:
  On Thu, Apr 21, 2011 at 11:16:45AM -0400, Tom Lane wrote:
  Robert Haas robertmh...@gmail.com writes:
   I agree.  I am in favor of a shorter release cycle.
  I'm not.  I don't think there is any demand among *users* (as opposed to
  developers) for more than one major PG release a year.  It's hard enough
  to get people to migrate that often.
  In fact, I predict that the observed behavior would be for even more end
  users to start skipping releases. Some already do - it's common not to
  upgrade unless there's a feature you really need, but for those who do
  stay on the 'current' upgrade path, you'll lose some who can't afford to
  spend more than one integration-testing round a year.
 Well, that aspect of the problem doesn't bother me, much.  I don't
 really care whether people upgrade to each new release the moment it
 comes out anyway.
 Not to say that there aren't OTHER problems with the idea...
One could argue that its causing bad PR for postgres. I have seen several 
parties planning to migrate away or not migrate to postgres because of 
performance evaluations they made. With 7.4, 8.0 and 8.2. In 2010.

Andres


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


Re: [HACKERS] stored procedures

2011-04-21 Thread Robert Haas
On Thu, Apr 21, 2011 at 11:24 AM, Peter Eisentraut pete...@gmx.net wrote:
 So the topic of real stored procedures came up again.  Meaning a
 function-like object that executes outside of a regular transaction,
 with the ability to start and stop SQL transactions itself.

 I would like to collect some specs on this feature.  So does anyone have
 links to documentation of existing implementations, or their own spec
 writeup?  A lot of people appear to have a very clear idea of this
 concept in their own head, so let's start collecting those.

EDB has an implementation of this in Advanced Server.  A stored
procedure can issue a COMMIT, which commits the current transaction
and begins a new one.  This might or might not be what people are
imagining for this feature.  If we end up doing something else, one
thing to consider is the impact on third-party tools like PGPOOL,
which currently keep track of whether or not a transaction is in
progress by snooping on the stream of SQL commands.  If a procedure
can be started with no transaction in progress and return with one
open, or the other way around, that method will break horribly.
That's not necessarily a reason not to do it, but I suspect we would
want to add some kind of protocol-level information about the
transaction state instead so that such tools could continue to work.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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


Re: [HACKERS] fsync reliability

2011-04-21 Thread Tom Lane
Simon Riggs si...@2ndquadrant.com writes:
 Daniel Farina points out to me that the Linux man page for fsync() says
 Calling fsync() does not necessarily ensure that the entry in the directory
containing the file has also reached disk.  For that an
 explicit fsync() on a
file descriptor for the directory is also needed.
 http://www.kernel.org/doc/man-pages/online/pages/man2/fsync.2.html

 This point appears to have been discussed before

Yes ...

 Tom said
 We don't try to fsync the
 directory after a normal table create for instance
 which is fine because we don't need to. In the event of a crash a
 missing table would be recreated during crash recovery.

Nonsense.  Once a checkpoint occurs after the WAL record that says to
create the table, we won't replay that action.  Or are you proposing
to have checkpoints run around and fsync every directory in the data
tree?

The traditional standard is that the filesystem is supposed to take
care of its own metadata, and even Linux filesystems have pretty much
figured that out.  I don't really see a need for us to be nursemaiding
the filesystem.  At most there's a documentation issue here, ie, we
ought to be more explicit about which filesystems and which mount
options we recommend.

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


Re: [HACKERS] hot backups: am I doing it wrong, or do we have a problem with pg_clog?

2011-04-21 Thread Daniel Farina
On Thu, Apr 21, 2011 at 8:19 AM, Robert Haas robertmh...@gmail.com wrote:
 On Thu, Apr 21, 2011 at 7:15 AM, Daniel Farina dan...@heroku.com wrote:
 To start at the end of this story: DETAIL:  Could not read from file
 pg_clog/007D at offset 65536: Success.

 This is a message we received on a a standby that we were bringing
 online as part of a test.  The clog file was present, but apparently
 too small for Postgres (or at least I tihnk this is what the message
 meant), so one could stub in another clog file and then continue
 recovery successfully (modulus the voodoo of stubbing in clog files in
 general).  I am unsure if this is due to an interesting race condition
 in Postgres or a result of my somewhat-interesting hot-backup
 protocol, which is slightly more involved than the norm.  I will
 describe what it does here:

 1) Call pg start backup
 2) crawl the entire postgres cluster directory structure, except
 pg_xlog, taking notes of the size of every file present
 3) begin writing TAR files, but *only up to the size noted during the
 original crawling of the cluster directory,* so if the file grows
 between the original snapshot and subsequently actually calling read()
 on the file those extra bytes will not be added to the TAR.
  3a) If a file is truncated partially, I add \0 bytes to pad the
 tarfile member up to the size sampled in step 2, as I am streaming the
 tar file and cannot go back in the stream and adjust the tarfile
 member size
 4) call pg stop backup

 In theory I would expect any defects introduced by the, ahem,
 exciting, procedure described in steps 3 and 3a to be corrected by
 recovery automatically when you start the new cluster.

Neat.  This is mostly what I was looking to get out of this thread, I
will start looking for places where I have botched things.

Although some of the frontend interface and some of the mechanism is
embarrassingly rough for several reasons, the other thread posters can
have access to the code if they wish: the code responsible for these
shenangians can be found at https://github.com/heroku/wal-e (and
https://github.com/fdr/wal-e), in the tar_partition.py file.
(https://github.com/heroku/WAL-E/blob/master/wal_e/tar_partition.py)

But I realize that's really too much detail for most people to be
interested in, which is why I didn't post it in the first place.  I
think given your assessment I have enough to try to reproduce this
case synthetically (I think taking a very old pg_clog snapshot,
committing a few million xacts while not vacuuming, and then trying to
merge the old clog otherwise newer base backup may prove out the
mechanism I have in mind) or add some more robust logging so I can
catch my (or any, really) problem.

-- 
fdr

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


Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-21 Thread Robert Haas
On Thu, Apr 21, 2011 at 11:46 AM, Tom Lane t...@sss.pgh.pa.us wrote:
 But aren't those two sides of the same coin, ie, people's natural
 tendency to work to a deadline?  If you approve of a lot of patches
 showing up just in time for a commitfest, why don't you approve of
 big patches showing up just in time for a release?  I mean, I've been
 heard to complain about that too, but complaining hasn't changed
 anyone's behavior and it's foolish to expect that it will in the
 future.  (See insanity, definition of.)

Well, I guess I approve of the first behavior because it doesn't feel
like having a red-hot iron spike driven through my foot, and I
disapprove of the second one because it does.  That may not be
entirely consistent taken in the abstract, but it has some solid
practical roots.

 We need to find a way to work with that behavior, not try to change it.
 I don't know what exactly.

 One idea that comes to mind is to give up on the linear development-mode-
 then-beta-mode management model, ie, allow development of release N+1
 to start while beta is still going on for release N.  The principal
 objection to this in the past has been that the PG development community
 is too small to do more than one thing at once, but maybe that's not
 true anymore.  The thing I'd be most worried about is how we get enough
 energy directed at the release-stabilization part of the work, when for
 most developers the new-development part is much more interesting/fun.
 But we have that problem in some form already --- it's not clear to me
 how much of the community really engages in what happens during beta,
 rather than quietly working on stuff for the next release.

I totally agree.  In fact, I think that trying to close off that
activity is one of the most self-destructive things we could possibly
do.  It makes missing the release far more painful if you're thinking
about not only a 12-month slip on GA but also a 6-month slip on any
meaningful further review.  Encouraging people to hold off major
proposals for the next release while we are focusing on beta also
tends to slow them down, which then exacerbates the pile-up at the end
of the release cycle.  I would like to blow the doors on that wide
open and encourage people to start submitting design proposals for 9.2
NOW.  NOW, NOW, NOW!  Not in July!  And *really* not next January!
And frankly, the sooner we can realistically start working on
integrating the code that has *already* been written for 9.2, the
better.  The patches are going to land on us at some point, and
dealing with them earlier will allow those people to move on to other
things (which is good), reduce the pile-up at the end of the cycle
(even better), or possibly both.

I'm willing to make a serious commitment to being involved in the
release stabilization work and to give it some degree of priority over
new patches, if that's what it takes to make the process work
smoothly.  We are fundamentally resource-constrained, and no process
is going to change that unless the process change, of itself, causes
more people to contribute more time.  But even if the first CommitFest
involves a slightly higher bounce rate due to lack of
reviewer/committer bandwidth, it's still better than not having one.
There have been maybe half a dozen people who have been principally
responsible for the stabilization that we have done since CF4, and the
community is much larger than that.  Everyone else is either doing
nothing (which is bad), or working without on-list discussion (which
is also bad).  Even for the people who are deeply committed to release
stabilization would probably be happier and more motivated to continue
contributing if they weren't being limited to ONLY that.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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


Re: [HACKERS] Re: database system identifier differs between the primary and standby

2011-04-21 Thread Cédric Villemain
2011/4/21 Robert Haas robertmh...@gmail.com:
 On Thu, Apr 21, 2011 at 6:38 AM, Simon Riggs si...@2ndquadrant.com wrote:
 On Thu, Apr 21, 2011 at 10:31 AM, rajibdk rajib.d...@siemens.com wrote:
 What does that database system identifier means? Is it related to DB
 transactions’ or unique to a version?

 Regrettably, it means you didn't follow the documented procedure.

 It isn't possible to do it any other way, so those questions are a 
 distraction.

 I think they are perfectly good questions.  If someone is trying to
 understand how our product works, we should encourage that.

Agree those are perfectly good question to ask on -general.  (but on
hackers it looks excessive)
Rajib: this is relative to initdb, it produces one key to be able to
check later if postgresql is restoring the good files.
(
from sources :
/*
 * Unique system identifier --- to ensure we match up xlog files with the
 * installation that produced them.
 */
)

Robert, Please don't add confusion to your signature : PostgreSQL is a
community project not an enterprise product.


 --
 Robert Haas
 EnterpriseDB: http://www.enterprisedb.com
 The Enterprise PostgreSQL Company

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




-- 
Cédric Villemain               2ndQuadrant
http://2ndQuadrant.fr/     PostgreSQL : Expertise, Formation et Support

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


Re: [HACKERS] getting to beta

2011-04-21 Thread Kevin Grittner
Robert Haas robertmh...@gmail.com wrote:
 
 1. All of the SSI patches have been dealt with.
 
I'll add the non-serializable UPDATE performance issue.  Dan has
been benchmarking to try to find a worst case; I don't want to speak
for him too much, but as he was headed off to lecture a class he
sent me results so far, and with beta so close I figure I should
pass along a rough outline.  The worst case he has been able to
construct so far was running 32 active processes on a 16 processor
machine in an update-mostly mix against a database on tmpfs (so no
disk writes) on a dataset which fits inside shared_memory.  This was
able to generate enough contention on an exclusive LW lock to cause
a 0.7% slowdown.
 
Speaking for myself, I believe we'll be able to provide a very small
patch to eliminate this.  Probably today or tomorrow.  While in a
less extreme runtime environment it would probably be hard to pick
out a performance impact in the normal noise, I expect the fix to be
small and safe enough to be worth doing.
 
I do feel that it would be good to apply the one-line fix Heikki
posted, which is orthogonal and needed in any event.  That would
give a little time for others to easily test it before beta.
 
-Kevin

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


Re: [HACKERS] stored procedures

2011-04-21 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes:
 EDB has an implementation of this in Advanced Server.  A stored
 procedure can issue a COMMIT, which commits the current transaction
 and begins a new one.  This might or might not be what people are
 imagining for this feature.  If we end up doing something else, one
 thing to consider is the impact on third-party tools like PGPOOL,
 which currently keep track of whether or not a transaction is in
 progress by snooping on the stream of SQL commands.  If a procedure
 can be started with no transaction in progress and return with one
 open, or the other way around, that method will break horribly.
 That's not necessarily a reason not to do it, but I suspect we would
 want to add some kind of protocol-level information about the
 transaction state instead so that such tools could continue to work.

Huh?  There's been a transaction state indicator in the protocol since
7.4 (see ReadyForQuery).  It's not our problem if PGPOOL is still using
methods that were appropriate ten years ago.

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


Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-21 Thread Robert Haas
On Thu, Apr 21, 2011 at 11:48 AM, Andres Freund and...@anarazel.de wrote:
 On Thursday, April 21, 2011 05:43:16 PM Robert Haas wrote:
 On Thu, Apr 21, 2011 at 11:37 AM, Ross J. Reedstrom reeds...@rice.edu
 wrote:
  On Thu, Apr 21, 2011 at 11:16:45AM -0400, Tom Lane wrote:
  Robert Haas robertmh...@gmail.com writes:
   I agree.  I am in favor of a shorter release cycle.
  I'm not.  I don't think there is any demand among *users* (as opposed to
  developers) for more than one major PG release a year.  It's hard enough
  to get people to migrate that often.
  In fact, I predict that the observed behavior would be for even more end
  users to start skipping releases. Some already do - it's common not to
  upgrade unless there's a feature you really need, but for those who do
  stay on the 'current' upgrade path, you'll lose some who can't afford to
  spend more than one integration-testing round a year.
 Well, that aspect of the problem doesn't bother me, much.  I don't
 really care whether people upgrade to each new release the moment it
 comes out anyway.
 Not to say that there aren't OTHER problems with the idea...
 One could argue that its causing bad PR for postgres. I have seen several
 parties planning to migrate away or not migrate to postgres because of
 performance evaluations they made. With 7.4, 8.0 and 8.2. In 2010.

That's certainly true.  It's clearly insane to benchmark with anything
other than the latest major release - on any product - if you want to
have any pretense of fairness.  However, for users who have
applications that work and perform acceptably, I don't think it
benefits us to be too aggressive in trying to get them onto a later
major release.  If we wanted to do that, we could maintain
back-branches for two years instead of five, but I don't think that
would be doing anyone any favors.

In fact, I've been wondering if we shouldn't consider extending the
support window for 8.2 past the currently-planned December 2011.
There seem to be quite a lot of people running that release precisely
because the casting changes in 8.3 were so painful, and I think the
incremental effort on our part to extend support for another year
would be reasonably small.  I guess the brunt of the work would
actually fall on the packagers.  It looks like we've done 5 point
releases of 8.2.x in the last year, so presumably if we did decide to
extend the EOL date by a year or so that's about how much incremental
effort would be needed.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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


Re: [HACKERS] getting to beta

2011-04-21 Thread Robert Haas
On Thu, Apr 21, 2011 at 12:32 PM, Kevin Grittner
kevin.gritt...@wicourts.gov wrote:
 Robert Haas robertmh...@gmail.com wrote:

 1. All of the SSI patches have been dealt with.

 I'll add the non-serializable UPDATE performance issue.  Dan has
 been benchmarking to try to find a worst case; I don't want to speak
 for him too much, but as he was headed off to lecture a class he
 sent me results so far, and with beta so close I figure I should
 pass along a rough outline.  The worst case he has been able to
 construct so far was running 32 active processes on a 16 processor
 machine in an update-mostly mix against a database on tmpfs (so no
 disk writes) on a dataset which fits inside shared_memory.  This was
 able to generate enough contention on an exclusive LW lock to cause
 a 0.7% slowdown.

 Speaking for myself, I believe we'll be able to provide a very small
 patch to eliminate this.  Probably today or tomorrow.  While in a
 less extreme runtime environment it would probably be hard to pick
 out a performance impact in the normal noise, I expect the fix to be
 small and safe enough to be worth doing.

 I do feel that it would be good to apply the one-line fix Heikki
 posted, which is orthogonal and needed in any event.  That would
 give a little time for others to easily test it before beta.

Please add that patch to the open items list if it is not there already.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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


Re: [HACKERS] stored procedures

2011-04-21 Thread Robert Haas
On Thu, Apr 21, 2011 at 12:38 PM, Tom Lane t...@sss.pgh.pa.us wrote:
 Robert Haas robertmh...@gmail.com writes:
 EDB has an implementation of this in Advanced Server.  A stored
 procedure can issue a COMMIT, which commits the current transaction
 and begins a new one.  This might or might not be what people are
 imagining for this feature.  If we end up doing something else, one
 thing to consider is the impact on third-party tools like PGPOOL,
 which currently keep track of whether or not a transaction is in
 progress by snooping on the stream of SQL commands.  If a procedure
 can be started with no transaction in progress and return with one
 open, or the other way around, that method will break horribly.
 That's not necessarily a reason not to do it, but I suspect we would
 want to add some kind of protocol-level information about the
 transaction state instead so that such tools could continue to work.

 Huh?  There's been a transaction state indicator in the protocol since
 7.4 (see ReadyForQuery).  It's not our problem if PGPOOL is still using
 methods that were appropriate ten years ago.

Hmm.  Well, maybe we need some PGPOOL folks to weigh in.  Possibly
it's just a case of it ain't broke, so we haven't fixed it.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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


Re: [HACKERS] fsync reliability

2011-04-21 Thread Robert Haas
On Thu, Apr 21, 2011 at 11:55 AM, Tom Lane t...@sss.pgh.pa.us wrote:
 The traditional standard is that the filesystem is supposed to take
 care of its own metadata, and even Linux filesystems have pretty much
 figured that out.  I don't really see a need for us to be nursemaiding
 the filesystem.  At most there's a documentation issue here, ie, we
 ought to be more explicit about which filesystems and which mount
 options we recommend.

I think it would be illuminating to shine upon this conversation the
light of some actual facts, as to whether or not this can be
demonstrated to be broken on systems people actually use, and to what
extent it can be mitigated by the sorts of configuration choices you
mention.  Neither Simon's comments nor yours give me any clear feeling
as to how likely this is to cause problems for real users, nor how
easily those problems can be mitigated.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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


Re: [HACKERS] fsync reliability

2011-04-21 Thread Simon Riggs
On Thu, Apr 21, 2011 at 4:55 PM, Tom Lane t...@sss.pgh.pa.us wrote:

 The traditional standard is that the filesystem is supposed to take
 care of its own metadata, and even Linux filesystems have pretty much
 figured that out.  I don't really see a need for us to be nursemaiding
 the filesystem.  At most there's a documentation issue here, ie,

I'm surprised by your response. If we've not documented something that
turns out to be essential to reliability of production databases, then
our users have a problem.

If our users have a data loss problem, my understanding was that we fixed it.

As it turns out, I've never personally advised anyone to use a
non-journalled filesystem, so my hands are clean in this. But it is
something we can fix, if we chose.

 we
 ought to be more explicit about which filesystems and which mount
 options we recommend.

Please be explicit then. What should the docs have said? I will update them.

-- 
 Simon Riggs   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, 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


Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-21 Thread Christopher Browne
On Thu, Apr 21, 2011 at 11:48 AM, Andres Freund and...@anarazel.de wrote:
 One could argue that its causing bad PR for postgres. I have seen several
 parties planning to migrate away or not migrate to postgres because of
 performance evaluations they made. With 7.4, 8.0 and 8.2. In 2010.

Well evaluating based on things past that can't be changed in the
absence of time machines doesn't offer us much guidance, as there
isn't anything that can be done in the present to fix such.
-- 
When confronted by a difficult problem, solve it by reducing it to the
question, How would the Lone Ranger handle this?

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


Re: [HACKERS] fsync reliability

2011-04-21 Thread Simon Riggs
On Thu, Apr 21, 2011 at 5:45 PM, Robert Haas robertmh...@gmail.com wrote:
 On Thu, Apr 21, 2011 at 11:55 AM, Tom Lane t...@sss.pgh.pa.us wrote:
 The traditional standard is that the filesystem is supposed to take
 care of its own metadata, and even Linux filesystems have pretty much
 figured that out.  I don't really see a need for us to be nursemaiding
 the filesystem.  At most there's a documentation issue here, ie, we
 ought to be more explicit about which filesystems and which mount
 options we recommend.

 I think it would be illuminating to shine upon this conversation the
 light of some actual facts, as to whether or not this can be
 demonstrated to be broken on systems people actually use, and to what
 extent it can be mitigated by the sorts of configuration choices you
 mention.  Neither Simon's comments nor yours give me any clear feeling
 as to how likely this is to cause problems for real users, nor how
 easily those problems can be mitigated.

If you have some actual facts yourself, add them. Or listen for people that do.

-- 
 Simon Riggs   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, 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


EOL for 8.2 (was Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers)

2011-04-21 Thread Tom Lane
[ man, this thread has totally outlived its title, could we change that?
  I'll start with this subtopic ]

Robert Haas robertmh...@gmail.com writes:
 In fact, I've been wondering if we shouldn't consider extending the
 support window for 8.2 past the currently-planned December 2011.
 There seem to be quite a lot of people running that release precisely
 because the casting changes in 8.3 were so painful, and I think the
 incremental effort on our part to extend support for another year
 would be reasonably small.  I guess the brunt of the work would
 actually fall on the packagers.  It looks like we've done 5 point
 releases of 8.2.x in the last year, so presumably if we did decide to
 extend the EOL date by a year or so that's about how much incremental
 effort would be needed.

I agree that the incremental effort would not be so large, but what
makes you think that the situation will change given another year?
My expectation is that'd just mean people will do nothing about
migrating for a year longer.

More generally: it took a lot of argument to establish the current EOL
policy, and bending it the first time anyone feels any actual pain
will pretty much destroy the whole concept.

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


Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-21 Thread Andres Freund
On Thursday, April 21, 2011 06:39:44 PM Robert Haas wrote:
 On Thu, Apr 21, 2011 at 11:48 AM, Andres Freund and...@anarazel.de wrote:
  On Thursday, April 21, 2011 05:43:16 PM Robert Haas wrote:
  On Thu, Apr 21, 2011 at 11:37 AM, Ross J. Reedstrom reeds...@rice.edu
  
  wrote:
   On Thu, Apr 21, 2011 at 11:16:45AM -0400, Tom Lane wrote:
   Robert Haas robertmh...@gmail.com writes:
I agree.  I am in favor of a shorter release cycle.
   
   I'm not.  I don't think there is any demand among *users* (as opposed
   to developers) for more than one major PG release a year.  It's hard
   enough to get people to migrate that often.
   
   In fact, I predict that the observed behavior would be for even more
   end users to start skipping releases. Some already do - it's common
   not to upgrade unless there's a feature you really need, but for
   those who do stay on the 'current' upgrade path, you'll lose some who
   can't afford to spend more than one integration-testing round a year.
  
  Well, that aspect of the problem doesn't bother me, much.  I don't
  really care whether people upgrade to each new release the moment it
  comes out anyway.
  Not to say that there aren't OTHER problems with the idea...
  
  One could argue that its causing bad PR for postgres. I have seen several
  parties planning to migrate away or not migrate to postgres because of
  performance evaluations they made. With 7.4, 8.0 and 8.2. In 2010.
 
 That's certainly true.  It's clearly insane to benchmark with anything
 other than the latest major release - on any product - if you want to
 have any pretense of fairness.
The usual argument against that is that $version is the only available on 
$platform in version $version...

And I doubt that a higher number of new pg versions will lead to more 
supported releases in distributions...

Andres

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


Re: EOL for 8.2 (was Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers)

2011-04-21 Thread Dave Page
On Thu, Apr 21, 2011 at 5:59 PM, Tom Lane t...@sss.pgh.pa.us wrote:
 [ man, this thread has totally outlived its title, could we change that?
  I'll start with this subtopic ]

 Robert Haas robertmh...@gmail.com writes:
 In fact, I've been wondering if we shouldn't consider extending the
 support window for 8.2 past the currently-planned December 2011.
 There seem to be quite a lot of people running that release precisely
 because the casting changes in 8.3 were so painful, and I think the
 incremental effort on our part to extend support for another year
 would be reasonably small.  I guess the brunt of the work would
 actually fall on the packagers.  It looks like we've done 5 point
 releases of 8.2.x in the last year, so presumably if we did decide to
 extend the EOL date by a year or so that's about how much incremental
 effort would be needed.

 I agree that the incremental effort would not be so large, but what
 makes you think that the situation will change given another year?
 My expectation is that'd just mean people will do nothing about
 migrating for a year longer.

 More generally: it took a lot of argument to establish the current EOL
 policy, and bending it the first time anyone feels any actual pain
 will pretty much destroy the whole concept.

It would also make at least one packager very unhappy as the 8.2
Windows build is by far the hardest and most time consuming to do and
I happen to know he's been counting the days until it goes.

More generally, keeping it for longer means we might end up supporting
6 major releases at once. That may not be so much work on a day to day
basis, but it adds up to a lot at release times, which was one of the
reasons why we agreed on the 5 year support window.

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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


[HACKERS] my signature

2011-04-21 Thread Robert Haas
On Thu, Apr 21, 2011 at 12:26 PM, Cédric Villemain
cedric.villemain.deb...@gmail.com wrote:
 Robert, Please don't add confusion to your signature : PostgreSQL is a
 community project not an enterprise product.
 --
 Cédric Villemain               2ndQuadrant
 http://2ndQuadrant.fr/     PostgreSQL : Expertise, Formation et Support

Uh, whoa.  That came out of nowhere for me.  I have been using this
signature for about a year, and nobody's said anything about it
before.  The Enterprise PostgreSQL Company is our corporate slogan,
and at least three of us have it in our signature for that reason,
much as (or so I gather) PostgreSQL: Support, Training, and Services
is 2ndQuadrant's tagline (with some variations depending on the
primary language of the person posting), and The PostgreSQL Company -
Command Prompt, Inc. is CommandPrompt's tag line.  Any of those
slogans - and *especially* CommandPrompt's - could be taken to imply
that one of those companies is the primary driving force behind
PostgreSQL, but in fact - as we are all aware - no one company
dominates the market for PostgreSQL products and services, or controls
its development.

Someone from another community could be forgiven for thinking that any
of those taglines intend to imply that the associated company occupies
the same position with respect to PostgreSQL that 10gen has with
respect to MongoDB, but I don't see that any one of them is
exponentially more egregious than any of the others.

Heck, even the name PostgreSQL Experts, Inc. could be taken to imply
that the rest of us are all chumps.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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


Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-21 Thread Christopher Browne
On Thu, Apr 21, 2011 at 11:05 AM, Robert Haas robertmh...@gmail.com wrote:
 I agree.  I am in favor of a shorter release cycle.  But I think that
 a shorter release cycle won't work well if there is still four month
 long integration period at the end of each series of CommitFests.  The
 problem is a bit circular here: because release cycles are long,
 people really, really want to slip as much as possible in at the end.
 But being under time pressure to get things committed results in a
 higher bug count, which means more things that have to be fixed after
 feature freeze, which translates into a long release cycle.

If we somehow were able to come up with a 6 week release cycle, we'd
still have the problem that there are features that take more than 6
weeks to integrate into a release.  (HOT and SyncRep, I'm looking at
you!) Any such larger features would blow this up, quite forcibly.

I don't think our release cycle is vastly too long; it takes enough
time to plan upgrades for systems that my colleagues at Afilias aren't
keen on using every PG release in production that comes out as it
stands now.

Peter Eisentraut points out that with the way things are, now,  ...
you are left with all of about 20 days per year for discussion,
collaborative planning and coding.  Which is obviously silly, which is
why the process breaks down.

I think the CommitFests have been a *super* tool for addressing such
problems as:
- patches getting lost
- getting review effort put onto the easier patches

But they aren't the only thing we conceptually need to have.  For
tougher features, they're not great.  And they're completely useless
at addressing discussions surrounding things we know we want done, but
don't have a strategy for yet.  Those things aren't patches, there's
nothing yet to commit.

My sense is that something else is needed as a process to help with
those nebulous large changes.  I'm not sure quite what it looks
like.  Maybe there's some tooling that would be helpful, but we really
need some experimentation to figure out what the process should look
like.
-- 
When confronted by a difficult problem, solve it by reducing it to the
question, How would the Lone Ranger handle this?

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


Re: EOL for 8.2 (was Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers)

2011-04-21 Thread Josh Berkus
All,

 In fact, I've been wondering if we shouldn't consider extending the
 support window for 8.2 past the currently-planned December 2011.
 There seem to be quite a lot of people running that release precisely
 because the casting changes in 8.3 were so painful, and I think the
 incremental effort on our part to extend support for another year
 would be reasonably small.  I guess the brunt of the work would
 actually fall on the packagers.  It looks like we've done 5 point
 releases of 8.2.x in the last year, so presumably if we did decide to
 extend the EOL date by a year or so that's about how much incremental
 effort would be needed.

Better that someone should just focus on whipping Robert's (or was it
Greg's?) replace-the-missing-casts package into shape as an extension.

I'm sure some kind of corporate sponsorship would be available for this
if someone wanted to work on it.  Enough companies are facing this as
upgrade pain to want to fix it.  If someone wants to work on it, let me
know; I'll start a fundraising campaign.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

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


Re: EOL for 8.2 (was Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers)

2011-04-21 Thread Kenneth Marshall
On Thu, Apr 21, 2011 at 06:04:09PM +0100, Dave Page wrote:
 On Thu, Apr 21, 2011 at 5:59 PM, Tom Lane t...@sss.pgh.pa.us wrote:
  [ man, this thread has totally outlived its title, could we change that?
  ?I'll start with this subtopic ]
 
  Robert Haas robertmh...@gmail.com writes:
  In fact, I've been wondering if we shouldn't consider extending the
  support window for 8.2 past the currently-planned December 2011.
  There seem to be quite a lot of people running that release precisely
  because the casting changes in 8.3 were so painful, and I think the
  incremental effort on our part to extend support for another year
  would be reasonably small. ?I guess the brunt of the work would
  actually fall on the packagers. ?It looks like we've done 5 point
  releases of 8.2.x in the last year, so presumably if we did decide to
  extend the EOL date by a year or so that's about how much incremental
  effort would be needed.
 
  I agree that the incremental effort would not be so large, but what
  makes you think that the situation will change given another year?
  My expectation is that'd just mean people will do nothing about
  migrating for a year longer.
 
  More generally: it took a lot of argument to establish the current EOL
  policy, and bending it the first time anyone feels any actual pain
  will pretty much destroy the whole concept.
 
 It would also make at least one packager very unhappy as the 8.2
 Windows build is by far the hardest and most time consuming to do and
 I happen to know he's been counting the days until it goes.
 
 More generally, keeping it for longer means we might end up supporting
 6 major releases at once. That may not be so much work on a day to day
 basis, but it adds up to a lot at release times, which was one of the
 reasons why we agreed on the 5 year support window.
 
 -- 
 Dave Page
 Blog: http://pgsnake.blogspot.com
 Twitter: @pgsnake
 
 EnterpriseDB UK: http://www.enterprisedb.com
 The Enterprise PostgreSQL Company
 

+1 for cutting the cord on 8.2. People using it still will need
to use the last release available, upgrade, or consult to have
a back-port/build made. 

Regards,
Ken

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


Re: EOL for 8.2 (was Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers)

2011-04-21 Thread Robert Haas
On Thu, Apr 21, 2011 at 12:59 PM, Tom Lane t...@sss.pgh.pa.us wrote:
 [ man, this thread has totally outlived its title, could we change that?
  I'll start with this subtopic ]

 Robert Haas robertmh...@gmail.com writes:
 In fact, I've been wondering if we shouldn't consider extending the
 support window for 8.2 past the currently-planned December 2011.
 There seem to be quite a lot of people running that release precisely
 because the casting changes in 8.3 were so painful, and I think the
 incremental effort on our part to extend support for another year
 would be reasonably small.  I guess the brunt of the work would
 actually fall on the packagers.  It looks like we've done 5 point
 releases of 8.2.x in the last year, so presumably if we did decide to
 extend the EOL date by a year or so that's about how much incremental
 effort would be needed.

 I agree that the incremental effort would not be so large, but what
 makes you think that the situation will change given another year?
 My expectation is that'd just mean people will do nothing about
 migrating for a year longer.

 More generally: it took a lot of argument to establish the current EOL
 policy, and bending it the first time anyone feels any actual pain
 will pretty much destroy the whole concept.

I don't think that's quite a fair description of the proposal.  I
don't think that having a general policy about EOL should preclude us
from making exceptions when there is some particularly compelling
reason to do so, and it's particularly difficult to upgrade to
release X+1 seems to me to be something that might merit a bit of
consideration in that area.  It is hard to imagine that 8.3, 8.4, 9.0,
or 9.1 could justify special treatment on similar grounds, nor did
7.4, 8.0, or 8.1, which we recently retired under this policy.

However, I can see that I'm way, way in the minority on this one, so
never mind!  It was just a thought...

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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


Re: [HACKERS] fsync reliability

2011-04-21 Thread Robert Haas
On Thu, Apr 21, 2011 at 12:53 PM, Simon Riggs si...@2ndquadrant.com wrote:
 On Thu, Apr 21, 2011 at 5:45 PM, Robert Haas robertmh...@gmail.com wrote:
 On Thu, Apr 21, 2011 at 11:55 AM, Tom Lane t...@sss.pgh.pa.us wrote:
 The traditional standard is that the filesystem is supposed to take
 care of its own metadata, and even Linux filesystems have pretty much
 figured that out.  I don't really see a need for us to be nursemaiding
 the filesystem.  At most there's a documentation issue here, ie, we
 ought to be more explicit about which filesystems and which mount
 options we recommend.

 I think it would be illuminating to shine upon this conversation the
 light of some actual facts, as to whether or not this can be
 demonstrated to be broken on systems people actually use, and to what
 extent it can be mitigated by the sorts of configuration choices you
 mention.  Neither Simon's comments nor yours give me any clear feeling
 as to how likely this is to cause problems for real users, nor how
 easily those problems can be mitigated.

 If you have some actual facts yourself, add them. Or listen for people that 
 do.

Since I don't have any actual facts, listening for people who do is
precisely what I am doing.  Since the proposed change was your
suggestion, perhaps you would like to provide some.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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


Re: [HACKERS] my signature

2011-04-21 Thread David E. Wheeler
On Apr 21, 2011, at 10:06 AM, Robert Haas wrote:

 Heck, even the name PostgreSQL Experts, Inc. could be taken to imply
 that the rest of us are all chumps.

Send me your résumé, we’ll talk.

Best,

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


Re: [HACKERS] stored procedures

2011-04-21 Thread Josh Berkus
Peter,

 I would like to collect some specs on this feature.  So does anyone have
 links to documentation of existing implementations, or their own spec
 writeup?  A lot of people appear to have a very clear idea of this
 concept in their own head, so let's start collecting those.

Delta between SPs and Functions for PostgreSQL:

* SPs are executed using CALL or EXECUTE, and not SELECT.

* SPs do not return a value
** optional: SPs *may* have OUT parameters.

* SPs have internal transactions including begin/commit
** optional: SPs can run non-transaction statements,
   like CREATE INDEX CONCURRENTLY and VACUUM
** corollary: SPs may not be called as part of a larger query
** question: if an SP is called by another SP, what is its
   transaction context?

* optional: SPs can return multisets (ala SQL Server).
** question: how would multisets be handled on the client end?

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

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


Re: [HACKERS] stored procedures

2011-04-21 Thread Pavel Stehule
Hello

2011/4/21 Josh Berkus j...@agliodbs.com:
 Peter,

 I would like to collect some specs on this feature.  So does anyone have
 links to documentation of existing implementations, or their own spec
 writeup?  A lot of people appear to have a very clear idea of this
 concept in their own head, so let's start collecting those.

 Delta between SPs and Functions for PostgreSQL:

 * SPs are executed using CALL or EXECUTE, and not SELECT.

 * SPs do not return a value
 ** optional: SPs *may* have OUT parameters.

SP can returns value - result status or RETURNED_SQLSTATE. Result
status is hidden OUT parameter


 * SPs have internal transactions including begin/commit
 ** optional: SPs can run non-transaction statements,
   like CREATE INDEX CONCURRENTLY and VACUUM
 ** corollary: SPs may not be called as part of a larger query
 ** question: if an SP is called by another SP, what is its
   transaction context?

 * optional: SPs can return multisets (ala SQL Server).
 ** question: how would multisets be handled on the client end?


you should to use some next function for iteration between resultsets

http://dev.mysql.com/doc/refman/5.0/en/mysql-next-result.html

similar function exists in MSSQL API too

Regards

Pavel Stehule

 --
 Josh Berkus
 PostgreSQL Experts Inc.
 http://pgexperts.com

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


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


Re: EOL for 8.2 (was Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers)

2011-04-21 Thread Tom Lane
Dave Page dp...@pgadmin.org writes:
 On Thu, Apr 21, 2011 at 5:59 PM, Tom Lane t...@sss.pgh.pa.us wrote:
 I agree that the incremental effort would not be so large, but what
 makes you think that the situation will change given another year?

 It would also make at least one packager very unhappy as the 8.2
 Windows build is by far the hardest and most time consuming to do and
 I happen to know he's been counting the days until it goes.

Well, if we did extend support for 8.2, we could specifically exclude
Windows.  But I'm still unclear on what would really be accomplished
by extending support for it.  Sooner or later we have to get people
to migrate up from it, and I see no reason to think that supporting
it for just a year more will change anything.

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


Re: EOL for 8.2 (was Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers)

2011-04-21 Thread Tom Lane
Josh Berkus j...@agliodbs.com writes:
 Better that someone should just focus on whipping Robert's (or was it
 Greg's?) replace-the-missing-casts package into shape as an extension.

I think Peter originated that, actually.  My recollection is that there
didn't seem to be any way to extend it to a complete solution, and
besides which it's really a crutch to avoid fixing bugs in your
application.  Still, if someone does want to expend more work on it
I wouldn't object.

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


Re: [HACKERS] stored procedures

2011-04-21 Thread Kevin Grittner
I'm pretty close to agreement with Josh, I think.

Josh Berkus j...@agliodbs.com wrote:
 
 Delta between SPs and Functions for PostgreSQL:
 
 * SPs are executed using CALL or EXECUTE, and not SELECT.
 
Agreed, although some products will search for a matching procedure
name if the start of a statement doesn't match any reserved word. 
That can be handy -- you run them more or less like commands.
 
 * SPs do not return a value
 
I've used some products where these were available, although in some
cases only setting what in PostgreSQL would be the equivalent of an
integer session GUC.
 
 ** optional: SPs *may* have OUT parameters.
 
Support for those would be important to handle some common uses of
SPs.
 
 * SPs have internal transactions including begin/commit
 
Yeah.  Entering or leaving an SP should not start or end a
transaction.  BEGIN, COMMIT, ROLLBACK, and SAVEPOINT should all be
available and should not disrupt statement flow.
 
 ** optional: SPs can run non-transaction statements,
like CREATE INDEX CONCURRENTLY and VACUUM
 
That seems important.
 
 ** corollary: SPs may not be called as part of a larger query
 
OK.
 
 ** question: if an SP is called by another SP, what is its
transaction context?
 
Entering or leaving an SP should not start or end a transaction.
 
 * optional: SPs can return multisets (ala SQL Server).
 
I think that's important.
 
 ** question: how would multisets be handled on the client end?
 
In previous discussions there seemed to be a feeling that unless we
were going to go to a new major version of the protocol, the return
from an SP would be an array of result sets.  We would probably want
to reserve the first one for OUT parameters (and if we decide to
support it, the return value).  Tools like psql would need to
display each in its turn, similar to what we do for some backslash
commands.
 
-Kevin

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


Re: [HACKERS] Back branch update releases this week; beta postponed

2011-04-21 Thread Bernd Helmle



--On 12. April 2011 10:58:25 -0400 Tom Lane t...@sss.pgh.pa.us wrote:


Hmm, I would like to see the patch for
http://archives.postgresql.org/pgsql-bugs/2011-03/msg00261.php
going in for 8.4.8.


Simon, was there a reason you only back-patched that to 9.0?


So it seems we have shipped 8.4.8 without a fix for this ?

--
Thanks

Bernd

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


Re: [HACKERS] stored procedures

2011-04-21 Thread Tom Lane
Kevin Grittner kevin.gritt...@wicourts.gov writes:
 Josh Berkus j...@agliodbs.com wrote:
 ** question: if an SP is called by another SP, what is its
 transaction context?
 
 Entering or leaving an SP should not start or end a transaction.

That all sounds mighty hand-wavy and at serious risk of tripping over
implementation details.  Some things to think about:

1. Are you expecting the procedure definition to be fetched from a
system catalog?  You're going to need to be inside a transaction
to do that.

2. Are you expecting the procedure to take any input parameters?
You're going to need to be inside a transaction to evaluate the
inputs, unless perhaps you restrict the feature to an extremely
lobotomized subset of possible arguments (no user-defined types,
no expressions, just for starters).

3. What sort of primitive operations do you expect the SP to be
able to execute outside a transaction?  The plpgsql model where
all the primitive operations are really SQL ain't gonna work.

I think that we could finesse #1 and #2, along these lines:
The CALL command is ordinary SQL but not allowed inside a transaction
block, much like some existing commands like VACUUM.  So we start a
transaction to parse and execute it.  The CALL looks up the procedure
definition and evaluates any input arguments.  It then copies this info to
some outside-the-transaction memory context, terminates its transaction,
and calls the procedure.  On return it starts a new transaction, in
which it can call the output functions that are going to have to be
executed in order to pass anything back to the client.  (This implies
that OUT argument values are collected up during SP execution and not
actually passed back to the client till later.  People who were hoping
to stream vast amounts of data to the client will not be happy.  But
I see no way around that unless you want to try to execute output
functions outside a transaction, which strikes me as a quagmire.)

I'm less sure what to do about #3.  The most attractive approach would
probably be to make people use a non-SQL script interpreter --- perl,
python, or whatever floats your boat --- which would likely mean that
we have not just one SP implementation language but N of them.  But
we've solved that problem before.

Calling another SP ... particularly one with a different implementation
language ... could be a bit tricky too.  The above proposal assumes that
SPs are always entered outside a transaction, but do we want to make
that same restriction for the call-another-SP case?  And if not, how's
it going to work?  Again, you'll have to be inside a transaction at
least long enough to get the SP's definition out of the catalogs.

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


Re: [HACKERS] my signature

2011-04-21 Thread Andrew Dunstan



On 04/21/2011 01:06 PM, Robert Haas wrote:


Heck, even the name PostgreSQL Experts, Inc. could be taken to imply
that the rest of us are all chumps.



Not really. We don't claim to have all of them (yet). EDB on the other 
hand uses the definite article in its slogan, as does CommandPrompt.


Seriously, though, this is really a non-issue. Let's move on.

cheers

andrew

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


Re: [HACKERS] my signature

2011-04-21 Thread Merlin Moncure
On Thu, Apr 21, 2011 at 12:06 PM, Robert Haas robertmh...@gmail.com wrote:
 On Thu, Apr 21, 2011 at 12:26 PM, Cédric Villemain
 cedric.villemain.deb...@gmail.com wrote:
 Robert, Please don't add confusion to your signature : PostgreSQL is a
 community project not an enterprise product.
 --
 Cédric Villemain               2ndQuadrant
 http://2ndQuadrant.fr/     PostgreSQL : Expertise, Formation et Support

 Uh, whoa.  That came out of nowhere for me.  I have been using this
 signature for about a year, and nobody's said anything about it
 before.  The Enterprise PostgreSQL Company is our corporate slogan,
 and at least three of us have it in our signature for that reason,
 much as (or so I gather) PostgreSQL: Support, Training, and Services
 is 2ndQuadrant's tagline (with some variations depending on the
 primary language of the person posting), and The PostgreSQL Company -
 Command Prompt, Inc. is CommandPrompt's tag line.  Any of those
 slogans - and *especially* CommandPrompt's - could be taken to imply
 that one of those companies is the primary driving force behind
 PostgreSQL, but in fact - as we are all aware - no one company
 dominates the market for PostgreSQL products and services, or controls
 its development.

 Someone from another community could be forgiven for thinking that any
 of those taglines intend to imply that the associated company occupies
 the same position with respect to PostgreSQL that 10gen has with
 respect to MongoDB, but I don't see that any one of them is
 exponentially more egregious than any of the others.

 Heck, even the name PostgreSQL Experts, Inc. could be taken to imply
 that the rest of us are all chumps.

Actually, I found it unprofessional as well.

Merlin Moncure
Resident PostgreSQL Badass

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


Re: [HACKERS] my signature

2011-04-21 Thread Bruce Momjian
Merlin Moncure wrote:
 On Thu, Apr 21, 2011 at 12:06 PM, Robert Haas robertmh...@gmail.com wrote:
  On Thu, Apr 21, 2011 at 12:26 PM, C?dric Villemain
  cedric.villemain.deb...@gmail.com wrote:
  Robert, Please don't add confusion to your signature : PostgreSQL is a
  community project not an enterprise product.
  --
  C?dric Villemain? ? ? ? ? ? ?? 2ndQuadrant
  http://2ndQuadrant.fr/? ?? PostgreSQL : Expertise, Formation et Support
 
  Uh, whoa. ?That came out of nowhere for me. ?I have been using this
  signature for about a year, and nobody's said anything about it
  before. ?The Enterprise PostgreSQL Company is our corporate slogan,
  and at least three of us have it in our signature for that reason,
  much as (or so I gather) PostgreSQL: Support, Training, and Services
  is 2ndQuadrant's tagline (with some variations depending on the
  primary language of the person posting), and The PostgreSQL Company -
  Command Prompt, Inc. is CommandPrompt's tag line. ?Any of those
  slogans - and *especially* CommandPrompt's - could be taken to imply
  that one of those companies is the primary driving force behind
  PostgreSQL, but in fact - as we are all aware - no one company
  dominates the market for PostgreSQL products and services, or controls
  its development.
 
  Someone from another community could be forgiven for thinking that any
  of those taglines intend to imply that the associated company occupies
  the same position with respect to PostgreSQL that 10gen has with
  respect to MongoDB, but I don't see that any one of them is
  exponentially more egregious than any of the others.
 
  Heck, even the name PostgreSQL Experts, Inc. could be taken to imply
  that the rest of us are all chumps.
 
 Actually, I found it unprofessional as well.
 
 Merlin Moncure
 Resident PostgreSQL Badass

Postgres Enterprise Badass Expert Services Company  ;-)

-- 
  Bruce Momjian  br...@momjian.ushttp://momjian.us
  EnterpriseDB http://enterprisedb.com

  + It's impossible for everything to be true. +

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


Re: [HACKERS] my signature

2011-04-21 Thread Bruce Momjian
Bruce Momjian wrote:
 Merlin Moncure wrote:
  On Thu, Apr 21, 2011 at 12:06 PM, Robert Haas robertmh...@gmail.com wrote:
   On Thu, Apr 21, 2011 at 12:26 PM, C?dric Villemain
   cedric.villemain.deb...@gmail.com wrote:
   Robert, Please don't add confusion to your signature : PostgreSQL is a
   community project not an enterprise product.
   --
   C?dric Villemain? ? ? ? ? ? ?? 2ndQuadrant
   http://2ndQuadrant.fr/? ?? PostgreSQL : Expertise, Formation et Support
  
   Uh, whoa. ?That came out of nowhere for me. ?I have been using this
   signature for about a year, and nobody's said anything about it
   before. ?The Enterprise PostgreSQL Company is our corporate slogan,
   and at least three of us have it in our signature for that reason,
   much as (or so I gather) PostgreSQL: Support, Training, and Services
   is 2ndQuadrant's tagline (with some variations depending on the
   primary language of the person posting), and The PostgreSQL Company -
   Command Prompt, Inc. is CommandPrompt's tag line. ?Any of those
   slogans - and *especially* CommandPrompt's - could be taken to imply
   that one of those companies is the primary driving force behind
   PostgreSQL, but in fact - as we are all aware - no one company
   dominates the market for PostgreSQL products and services, or controls
   its development.
  
   Someone from another community could be forgiven for thinking that any
   of those taglines intend to imply that the associated company occupies
   the same position with respect to PostgreSQL that 10gen has with
   respect to MongoDB, but I don't see that any one of them is
   exponentially more egregious than any of the others.
  
   Heck, even the name PostgreSQL Experts, Inc. could be taken to imply
   that the rest of us are all chumps.
  
  Actually, I found it unprofessional as well.
  
  Merlin Moncure
  Resident PostgreSQL Badass
 
 Postgres Enterprise Badass Expert Services Company  ;-)

Oops, I forgot the the:

The Postgres Enterprise Badass Expert Services Company

-- 
  Bruce Momjian  br...@momjian.ushttp://momjian.us
  EnterpriseDB http://enterprisedb.com

  + It's impossible for everything to be true. +

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


Re: [HACKERS] stored procedures

2011-04-21 Thread Merlin Moncure
On Thu, Apr 21, 2011 at 1:13 PM, Tom Lane t...@sss.pgh.pa.us wrote:
 3. What sort of primitive operations do you expect the SP to be
 able to execute outside a transaction?  The plpgsql model where
 all the primitive operations are really SQL ain't gonna work.
 I'm less sure what to do about #3.  The most attractive approach would
 probably be to make people use a non-SQL script interpreter --- perl,
 python, or whatever floats your boat --- which would likely mean that
 we have not just one SP implementation language but N of them.  But
 we've solved that problem before.

Does this mean you do or don't expect plpgsql to be able to run as
procedure?  Should SPI based routines generally be able to run as a
procedure (I hope so)?  If so, what API enhancements would be needed?
(I was thinking, SPI_is_proc, or something like that).  I'd like to
see plpgsql work as much as possible as it does now, except obviously
you can't have exception handlers.

What about cancelling? Cancel the current running query, or the whole
procedure (I'm assuming the latter?  How would that work?

 Calling another SP ... particularly one with a different implementation
 language ... could be a bit tricky too.  The above proposal assumes that
 SPs are always entered outside a transaction, but do we want to make
 that same restriction for the call-another-SP case?  And if not, how's
 it going to work?  Again, you'll have to be inside a transaction at
 least long enough to get the SP's definition out of the catalogs.

This restriction (no transaction only CALL) is ok I think.  You can
always code up a function otherwise.

merlin

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


Re: [HACKERS] stored procedures

2011-04-21 Thread Pavel Stehule
2011/4/21 Tom Lane t...@sss.pgh.pa.us:
 Kevin Grittner kevin.gritt...@wicourts.gov writes:
 Josh Berkus j...@agliodbs.com wrote:
 ** question: if an SP is called by another SP, what is its
 transaction context?

 Entering or leaving an SP should not start or end a transaction.


 That all sounds mighty hand-wavy and at serious risk of tripping over
 implementation details.  Some things to think about:

It doesn't mean so SQL are inside SP non transactional. Stored
Procedure is just client module moved on server. You can call SQL
statements from psql without outer implicit or explicit transaction
too.

It mean - a CALL statement should not start a outer transaction when
it isn't requested, but all inner SQL statements runs in own
transactions.

The questions about mutable or immutable parameters are important -
but it doesn't mean so SP without outer transactions are impossible.

Regards

Pavel


 1. Are you expecting the procedure definition to be fetched from a
 system catalog?  You're going to need to be inside a transaction
 to do that.

 2. Are you expecting the procedure to take any input parameters?
 You're going to need to be inside a transaction to evaluate the
 inputs, unless perhaps you restrict the feature to an extremely
 lobotomized subset of possible arguments (no user-defined types,
 no expressions, just for starters).

 3. What sort of primitive operations do you expect the SP to be
 able to execute outside a transaction?  The plpgsql model where
 all the primitive operations are really SQL ain't gonna work.

 I think that we could finesse #1 and #2, along these lines:
 The CALL command is ordinary SQL but not allowed inside a transaction
 block, much like some existing commands like VACUUM.  So we start a
 transaction to parse and execute it.  The CALL looks up the procedure
 definition and evaluates any input arguments.  It then copies this info to
 some outside-the-transaction memory context, terminates its transaction,
 and calls the procedure.  On return it starts a new transaction, in
 which it can call the output functions that are going to have to be
 executed in order to pass anything back to the client.  (This implies
 that OUT argument values are collected up during SP execution and not
 actually passed back to the client till later.  People who were hoping
 to stream vast amounts of data to the client will not be happy.  But
 I see no way around that unless you want to try to execute output
 functions outside a transaction, which strikes me as a quagmire.)

 I'm less sure what to do about #3.  The most attractive approach would
 probably be to make people use a non-SQL script interpreter --- perl,
 python, or whatever floats your boat --- which would likely mean that
 we have not just one SP implementation language but N of them.  But
 we've solved that problem before.

 Calling another SP ... particularly one with a different implementation
 language ... could be a bit tricky too.  The above proposal assumes that
 SPs are always entered outside a transaction, but do we want to make
 that same restriction for the call-another-SP case?  And if not, how's
 it going to work?  Again, you'll have to be inside a transaction at
 least long enough to get the SP's definition out of the catalogs.

                        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


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


[HACKERS] best way to test new index?

2011-04-21 Thread Yves Weißig
Hello pgsql-hackers,

what is the best way to test a new developed index structure?

Greets, Yves

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


Re: [HACKERS] best way to test new index?

2011-04-21 Thread Kevin Grittner
Yves Weißigweis...@rbg.informatik.tu-darmstadt.de wrote:
 
 what is the best way to test a new developed index structure?
 
Are you talking about a new AM (like btree, hash, GiST, or GIN)?
 
-Kevin

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


Re: [HACKERS] best way to test new index?

2011-04-21 Thread Yves Weißig
Yes I do!

Am 21.04.2011 20:56, schrieb Kevin Grittner:
 Yves Weißigweis...@rbg.informatik.tu-darmstadt.de wrote:
  
 what is the best way to test a new developed index structure?
  
 Are you talking about a new AM (like btree, hash, GiST, or GIN)?
  
 -Kevin
 

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


Re: [HACKERS] my signature

2011-04-21 Thread Cédric Villemain
Le 21 avril 2011 20:17, Andrew Dunstan and...@dunslane.net a écrit :


 On 04/21/2011 01:06 PM, Robert Haas wrote:

 Heck, even the name PostgreSQL Experts, Inc. could be taken to imply
 that the rest of us are all chumps.


 Not really. We don't claim to have all of them (yet). EDB on the other hand
 uses the definite article in its slogan, as does CommandPrompt.

 Seriously, though, this is really a non-issue. Let's move on.

Yes, please.
Robert, it wasn't well phrased and I apologize for the bad choice of my words.


 cheers

 andrew




-- 
Cédric Villemain               2ndQuadrant
http://2ndQuadrant.fr/     PostgreSQL : Expertise, Formation et Support

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


Re: [HACKERS] stored procedures

2011-04-21 Thread Robert Haas
On Thu, Apr 21, 2011 at 2:13 PM, Tom Lane t...@sss.pgh.pa.us wrote:
 Kevin Grittner kevin.gritt...@wicourts.gov writes:
 Josh Berkus j...@agliodbs.com wrote:
 ** question: if an SP is called by another SP, what is its
 transaction context?

 Entering or leaving an SP should not start or end a transaction.

 That all sounds mighty hand-wavy and at serious risk of tripping over
 implementation details.  Some things to think about:

 1. Are you expecting the procedure definition to be fetched from a
 system catalog?  You're going to need to be inside a transaction
 to do that.

 2. Are you expecting the procedure to take any input parameters?
 You're going to need to be inside a transaction to evaluate the
 inputs, unless perhaps you restrict the feature to an extremely
 lobotomized subset of possible arguments (no user-defined types,
 no expressions, just for starters).

 3. What sort of primitive operations do you expect the SP to be
 able to execute outside a transaction?  The plpgsql model where
 all the primitive operations are really SQL ain't gonna work.

I think we could handle a lot of these details cleanly if we had
autonomous transactions as a system primitive.  When you enter a
stored procedure at the outermost level, you begin a transaction,
which will remain open until the outermost stored procedure exits.
Any transactions that the stored procedure begins, commits, or rolls
back are in fact autonomous subtransactions under the hood.  Possibly
conditions like IF (1/0) THEN ... END IF that throw run time errors
get evaluated in the outer transaction context, so any errors stops
execution at that point - and we also avoid beginning and ending a
gabazillion transactions.

Possibly I am still waving my hands.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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


Re: [HACKERS] my signature

2011-04-21 Thread Robert Haas
On Thu, Apr 21, 2011 at 3:07 PM, Cédric Villemain
cedric.villemain.deb...@gmail.com wrote:
 Yes, please.
 Robert, it wasn't well phrased and I apologize for the bad choice of my words.

No problem.  Please be assured that I have no desire to make it appear
that EnterpriseDB is the only PostgreSQL company out there.  I've been
using PostgreSQL for far longer than I have been with EnterpriseDB,
far longer than EnterpriseDB has existed, and given that we don't live
in an era of lifetime employment and still have many years of work
ahead of me, it's likely that I will work for lots of other companies
before I retire where I will probably also use (and hopefully continue
to hack on) PostgreSQL.  Of course, for so long as I am working here,
I will be putting my efforts toward making the company as successful
as I can, which I think is what we all do for whoever is paying us at
the moment.  I really like working in an open community that spans
multiple companies, because no company I have ever worked for has had
nearly as many smart people as the PostgreSQL community does, and no
software project that I have ever worked on has been as enjoyable for
me as PostgreSQL is.  I guess it's natural that there will be some
tension since we are all competitors in some sense, but hopefully
friendly ones.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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


Re: [HACKERS] stored procedures

2011-04-21 Thread Merlin Moncure
On Thu, Apr 21, 2011 at 2:37 PM, Robert Haas robertmh...@gmail.com wrote:
 On Thu, Apr 21, 2011 at 2:13 PM, Tom Lane t...@sss.pgh.pa.us wrote:
 Kevin Grittner kevin.gritt...@wicourts.gov writes:
 Josh Berkus j...@agliodbs.com wrote:
 ** question: if an SP is called by another SP, what is its
 transaction context?

 Entering or leaving an SP should not start or end a transaction.

 That all sounds mighty hand-wavy and at serious risk of tripping over
 implementation details.  Some things to think about:

 1. Are you expecting the procedure definition to be fetched from a
 system catalog?  You're going to need to be inside a transaction
 to do that.

 2. Are you expecting the procedure to take any input parameters?
 You're going to need to be inside a transaction to evaluate the
 inputs, unless perhaps you restrict the feature to an extremely
 lobotomized subset of possible arguments (no user-defined types,
 no expressions, just for starters).

 3. What sort of primitive operations do you expect the SP to be
 able to execute outside a transaction?  The plpgsql model where
 all the primitive operations are really SQL ain't gonna work.

 I think we could handle a lot of these details cleanly if we had
 autonomous transactions as a system primitive.  When you enter a
 stored procedure at the outermost level, you begin a transaction,
 which will remain open until the outermost stored procedure exits.

If you do it that (base it on AT) way, then you can't:
1) call any utility command (vacuum, etc)
2) run for an arbitrary amount of time
3) discard any locks (except advisory)
4) deal with serialization isolation/mvcc snapshot issues that plague functions.

Points 2  (especially) 4 for me are painful.

#4 explained:
If you are trying to tuck all the gory mvcc details into server side
functions, there is no real effective way to prevent serialization
errors because the snapshot is already made when you enter the
function.  Even if you LOCK something on function line#1, it's already
too late.  No transaction procedures don't have this problem and allow
encapsulating all that nastiness in the server.

merlin

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


Re: [HACKERS] best way to test new index?

2011-04-21 Thread Kevin Grittner
Yves Weißigweis...@rbg.informatik.tu-darmstadt.de wrote:
 Am 21.04.2011 20:56, schrieb Kevin Grittner:
 Yves Weißigweis...@rbg.informatik.tu-darmstadt.de wrote:
  
 what is the best way to test a new developed index structure?
  
 Are you talking about a new AM (like btree, hash, GiST, or GIN)?
 
 Yes I do!
 
The tests are going to depend somewhat on what the index is intended
to do.
 
That said, I would start by making sure that basic things like
CREATE INDEX and DROP INDEX work.  Then I would test that INSERT,
UPDATE, and DELETE do the right things with the index.  Then I would
make sure that vacuum did the right thing.  Then I would make sure
that the optimizer was doing a reasonable job of knowing when it was
usable and what it cost, so that it would be chosen when
appropriate.  Once everything seemed to be behaving I would
benchmark it against the reasonable alternatives.
 
-Kevin

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


[HACKERS] Patch for pg_upgrade to turn off autovacuum

2011-04-21 Thread Bruce Momjian
Bruce Momjian wrote:
 Robert Haas wrote:
  On Thu, Mar 31, 2011 at 12:11 PM, Bruce Momjian br...@momjian.us wrote:
   Robert Haas wrote:
   On Thu, Mar 31, 2011 at 11:32 AM, Heikki Linnakangas
   heikki.linnakan...@enterprisedb.com wrote:
?I think the maintenance
overhead of an invisible variable is too much.
   
A simple GUC or command-line switch isn't much code.
  
   I like the idea of a command-line switch.
  
   If you want to do that you should gereralize it as --binary-upgrade in
   case we have other needs for it.
  
  Yeah.  Or we could do a binary_upgrade GUC which has the effect of
  forcibly suppressing autovacuum, and maybe other things later.  I
  think that's a lot less hazardous than fiddling with the autovacuum
  GUC.
 
 I like the idea of a command-line flag because it forces everything to
 be affected, and cannot be turned on and off in sessions --- if you are
 doing a binary upgrade, locked-down is good. :-)

The attached patch adds a new postmaster/postgres binary upgrade mode
(-b) which disables autovacuum, allows only super-user connections, and
prevents pg_upgrade_support oid assignment when not in upgrade mode. 
It also modifies pg_upgrade to use this new mode rather than play with
trying to stop autovacuum.

This does fix a very rare bug that could happen if
autovacuum_freeze_max_age were set to maximum by the user.

I think this should be applied to PG 9.1.

-- 
  Bruce Momjian  br...@momjian.ushttp://momjian.us
  EnterpriseDB http://enterprisedb.com

  + It's impossible for everything to be true. +
diff --git a/contrib/pg_upgrade/server.c b/contrib/pg_upgrade/server.c
new file mode 100644
index 2a0f50e..df2f2db
*** a/contrib/pg_upgrade/server.c
--- b/contrib/pg_upgrade/server.c
*** start_postmaster(ClusterInfo *cluster, b
*** 173,178 
--- 173,183 
  	const char *datadir;
  	unsigned short port;
  	bool		exit_hook_registered = false;
+ #ifndef WIN32
+ 	char		*output_filename = log_opts.filename;
+ #else
+ 	char		*output_filename = DEVNULL;
+ #endif
  
  	bindir = cluster-bindir;
  	datadir = cluster-pgdata;
*** start_postmaster(ClusterInfo *cluster, b
*** 193,216 
  	 * same file because we get the error: The process cannot access the file
  	 * because it is being used by another process. so we have to send all
  	 * other output to 'nul'.
! 	 *
! 	 * Using autovacuum=off disables cleanup vacuum and analyze, but freeze
! 	 * vacuums can still happen, so we set autovacuum_freeze_max_age to its
! 	 * maximum.  We assume all datfrozenxid and relfrozen values are less than
! 	 * a gap of 20 from the current xid counter, so autovacuum will
! 	 * not touch them.
  	 */
  	snprintf(cmd, sizeof(cmd),
  			 SYSTEMQUOTE \%s/pg_ctl\ -l \%s\ -D \%s\ 
! 			 -o \-p %d -c autovacuum=off 
! 			 -c autovacuum_freeze_max_age=20\ 
! 			 start  \%s\ 21 SYSTEMQUOTE,
! 			 bindir,
! #ifndef WIN32
! 			 log_opts.filename, datadir, port, log_opts.filename);
! #else
! 			 DEVNULL, datadir, port, DEVNULL);
! #endif
  	exec_prog(true, %s, cmd);
  
  	/* wait for the server to start properly */
--- 198,212 
  	 * same file because we get the error: The process cannot access the file
  	 * because it is being used by another process. so we have to send all
  	 * other output to 'nul'.
! 	 * Use binary upgrade mode on the server (-b), if supported.
  	 */
  	snprintf(cmd, sizeof(cmd),
  			 SYSTEMQUOTE \%s/pg_ctl\ -l \%s\ -D \%s\ 
! 			 -o \-p %d %s\ start  \%s\ 21 SYSTEMQUOTE,
! 			 bindir, output_filename, datadir, port,
! 			 (GET_MAJOR_VERSION(cluster-major_version) = 901) ? -b : ,
! 			 log_opts.filename);
! 
  	exec_prog(true, %s, cmd);
  
  	/* wait for the server to start properly */
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
new file mode 100644
index 8c5670f..870ddba
*** a/src/backend/catalog/heap.c
--- b/src/backend/catalog/heap.c
*** heap_create_with_catalog(const char *rel
*** 1051,1057 
  		 * Use binary-upgrade override for pg_class.oid/relfilenode, if
  		 * supplied.
  		 */
! 		if (OidIsValid(binary_upgrade_next_heap_pg_class_oid) 
  			(relkind == RELKIND_RELATION || relkind == RELKIND_SEQUENCE ||
  			 relkind == RELKIND_VIEW || relkind == RELKIND_COMPOSITE_TYPE ||
  			 relkind == RELKIND_FOREIGN_TABLE))
--- 1051,1058 
  		 * Use binary-upgrade override for pg_class.oid/relfilenode, if
  		 * supplied.
  		 */
! 		if (IsBinaryUpgrade 
! 			OidIsValid(binary_upgrade_next_heap_pg_class_oid) 
  			(relkind == RELKIND_RELATION || relkind == RELKIND_SEQUENCE ||
  			 relkind == RELKIND_VIEW || relkind == RELKIND_COMPOSITE_TYPE ||
  			 relkind == RELKIND_FOREIGN_TABLE))
*** heap_create_with_catalog(const char *rel
*** 1059,1065 
  			relid = binary_upgrade_next_heap_pg_class_oid;
  			binary_upgrade_next_heap_pg_class_oid = InvalidOid;
  		}
! 		else if (OidIsValid(binary_upgrade_next_toast_pg_class_oid) 
   relkind == 

Re: [HACKERS] stored procedures

2011-04-21 Thread Christopher Browne
On Thu, Apr 21, 2011 at 3:51 PM, Merlin Moncure mmonc...@gmail.com wrote:
 On Thu, Apr 21, 2011 at 2:37 PM, Robert Haas robertmh...@gmail.com wrote:
 On Thu, Apr 21, 2011 at 2:13 PM, Tom Lane t...@sss.pgh.pa.us wrote:
 Kevin Grittner kevin.gritt...@wicourts.gov writes:
 Josh Berkus j...@agliodbs.com wrote:
 ** question: if an SP is called by another SP, what is its
 transaction context?

 Entering or leaving an SP should not start or end a transaction.

 That all sounds mighty hand-wavy and at serious risk of tripping over
 implementation details.  Some things to think about:

 1. Are you expecting the procedure definition to be fetched from a
 system catalog?  You're going to need to be inside a transaction
 to do that.

 2. Are you expecting the procedure to take any input parameters?
 You're going to need to be inside a transaction to evaluate the
 inputs, unless perhaps you restrict the feature to an extremely
 lobotomized subset of possible arguments (no user-defined types,
 no expressions, just for starters).

 3. What sort of primitive operations do you expect the SP to be
 able to execute outside a transaction?  The plpgsql model where
 all the primitive operations are really SQL ain't gonna work.

 I think we could handle a lot of these details cleanly if we had
 autonomous transactions as a system primitive.  When you enter a
 stored procedure at the outermost level, you begin a transaction,
 which will remain open until the outermost stored procedure exits.

 If you do it that (base it on AT) way, then you can't:
 1) call any utility command (vacuum, etc)
 2) run for an arbitrary amount of time
 3) discard any locks (except advisory)
 4) deal with serialization isolation/mvcc snapshot issues that plague 
 functions.

 Points 2  (especially) 4 for me are painful.

 #4 explained:
 If you are trying to tuck all the gory mvcc details into server side
 functions, there is no real effective way to prevent serialization
 errors because the snapshot is already made when you enter the
 function.  Even if you LOCK something on function line#1, it's already
 too late.  No transaction procedures don't have this problem and allow
 encapsulating all that nastiness in the server.

Yes, those sound like a potent set of restrictions that gut what the
facility ought to be able to be useful for.

If what you want is something that runs inside a pre-existing
transaction, that rules out doing VACUUM or, really, *anything* that
generates transactions, without jumping through hoops to try to change
their behaviour.

My preference would be to expect that stored procedures are sure to
generate at least one transaction, and potentially as many more as
they choose to generate.

One of the most recent things I implemented was a process that does
bulk updates to customer balances.  We don't want the balance tuples
locked, so the process needs to COMMIT after each update.

At present, that means I'm doing a round trip from client to server each time.

If I had these autonomous transaction procedures, I could perhaps do
the whole thing in a stored procedure, which would:
a) Pull the list of transactions it's supposed to process;
b) Loop on them:
   - BEGIN; Do the processing for a transaction, COMMIT.

That's not terribly different from a vacuum utility that:
a) Pulls a list of tables it's supposed to vacuum;
b) Loop on them:
VACUUM the table

Autovac ought to make that sort of thing limitedly useful; you'd
usually rather just use autovac.

Mind you, we might discover that implementing autovac mostly in the
stored procedure language is easier and better than having it mostly
in C.  And this might further make it easy to add hooks to allow
site-specific logic to affect autovacuum policy.

(Note that Slony-I version 1.0, 1.1, and possibly 1.2 had the 'cleanup
thread' which notably vacuums tables mostly written in C.  2.0 shifted
the bulk of the logic into pl/pgsql, which made it much simpler to
read and verify, and made some of the components usable by
administrators.)

I'd expect SP to NOT be nestable, or at least, not in a sense that
allows rolling back activity of a child that thought it COMMITed
work.

It seems to me that we've already got perfectly good stored functions
that are strictly inside an existing transactional context - if you
want logic that's doing that, then use a SF, that's already perfectly
good for that, and you should use that.  If you want a stored
procedure that runs its own transaction(s), do so; don't expect every
kind of transactional logic out of SPs.
-- 
When confronted by a difficult problem, solve it by reducing it to the
question, How would the Lone Ranger handle this?

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


Re: EOL for 8.2 (was Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers)

2011-04-21 Thread Jaime Casanova
On Thu, Apr 21, 2011 at 12:35 PM, Tom Lane t...@sss.pgh.pa.us wrote:

 But I'm still unclear on what would really be accomplished
 by extending support for it.  Sooner or later we have to get people
 to migrate up from it, and I see no reason to think that supporting
 it for just a year more will change anything.


And people is more likely to migrate if they see some kind of hard
line, specially when migrate means a lot of work.
Actually, someone i know is targeting to migrate before the EOL, just
because the EOL exists.

-- 
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte y capacitación de PostgreSQL

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


Re: [HACKERS] EOL for 8.2 (was Re: Formatting Curmudgeons WAS: MMAP Buffers)

2011-04-21 Thread Greg Stark
On Thu, Apr 21, 2011 at 6:18 PM, Robert Haas robertmh...@gmail.com wrote:
 However, I can see that I'm way, way in the minority on this one, so
 never mind!  It was just a thought...


Fwiw I would have agreed with you on the basic question. Just because
we've said that users can count on N years of support doesn't mean
there's anything binding us to *not* support things for N+x years. The
argument that we should cut refuse to back-patch security fixes and
bug fixes that we could handle without much effort to versions that
users are using just because we think we know better than them and
know they should upgrade is a bad path imho.

However your theory was all predicated on the idea that supporting 8.2
was not much incremental effort and Dave said that's not true so this
is all moot. Doing it Windows-excluded seems not worth the effort ---
unless... what version of Postgres was shipped in the last supported
releases of major distributions? I think it was 8.1 in Ubuntu Hardy
and 8.4 in Ubuntu Lucid so that's irrelevant. What about Redhat and
Debian?

-- 
greg

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


Re: [HACKERS] EOL for 8.2 (was Re: Formatting Curmudgeons WAS: MMAP Buffers)

2011-04-21 Thread Tom Lane
Greg Stark gsst...@mit.edu writes:
 Fwiw I would have agreed with you on the basic question. Just because
 we've said that users can count on N years of support doesn't mean
 there's anything binding us to *not* support things for N+x years.

Certainly.  The question is what's the point --- and perhaps even more
to the point, if we extend 8.2 support, when are we going to stop
extending it?

 However your theory was all predicated on the idea that supporting 8.2
 was not much incremental effort and Dave said that's not true so this
 is all moot. Doing it Windows-excluded seems not worth the effort ---
 unless... what version of Postgres was shipped in the last supported
 releases of major distributions? I think it was 8.1 in Ubuntu Hardy
 and 8.4 in Ubuntu Lucid so that's irrelevant. What about Redhat and
 Debian?

So far as Red Hat is concerned, neither 8.2 nor 8.3 are of any interest
whatsoever.  I'm still on the hook for 7.4 and 8.1 to some extent, but
only very severe security issues are likely to be considered for those.

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


Re: [HACKERS] EOL for 8.2 (was Re: Formatting Curmudgeons WAS: MMAP Buffers)

2011-04-21 Thread Andrew Dunstan



On 04/21/2011 05:17 PM, Greg Stark wrote:

what version of Postgres was shipped in the last supported
releases of major distributions? I think it was 8.1 in Ubuntu Hardy
and 8.4 in Ubuntu Lucid so that's irrelevant. What about Redhat and
Debian?



IIRC RedHat has a ten year EOL policy, so what they have shipped in old 
releases should not really bind us. In any case, our EOL policy only 
affects what formal releases we make. We can commit fixes to branches 
past their EOL date, and IIRC Tom did this not long ago.


cheers

andrew


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


Re: [HACKERS] stored procedures

2011-04-21 Thread Darren Duncan

Peter Eisentraut wrote:

So the topic of real stored procedures came up again.  Meaning a
function-like object that executes outside of a regular transaction,
with the ability to start and stop SQL transactions itself.

I would like to collect some specs on this feature.  So does anyone have
links to documentation of existing implementations, or their own spec
writeup?  A lot of people appear to have a very clear idea of this
concept in their own head, so let's start collecting those.


I've thought a lot about this too.

The general case of a stored procedure should be all powerful, and be able to 
directly invoke any code written in SQL or other languages that a DBMS client 
can directly invoke on the DBMS, as if it were a client, but that the procedure 
is stored and executed entirely in the DBMS.  But the stored procedure also has 
its own lexical variables and supports conditionals and iteration and recursion.


A stored procedure is invoked as a statement and doesn't have a return value; 
in contrast, a function has a return value and is invoked within a value 
expression of a statement.  A stored procedure can see and update the database, 
and can have IN/INOUT/OUT parameters.  A stored procedure can have side-effects 
out of band, such as user I/O, if Pg supports that.


The general stored procedure should be orthogonal to other concerns, in 
particular to transactions and savepoints; executing one should not should not 
implicitly start or commit or rollback a transaction or savepoint.  However, it 
should be possible to explicitly declare that procedure is a transaction, so 
that starts and ends are neatly paired regardless of how the procedure exits, 
that is a transaction lifetime is attached to its lexical scope, but this would 
be optional.


A stored procedure should be able to do data manipulation, data definition, 
explicit transaction control (except perhaps when defined to be a transaction), 
privilege control, message passing, and so on.


As for semantics, lets say that when a stored procedure is invoked, its 
definition will be pulled from the system catalog in a snapshot and be compiled, 
then run normally no matter what it does, even if the definition of the 
procedure itself is changed during its execution; in the latter case, it just 
means that once the execution finishes, subsequent calls to it would then call 
the updated version or fail.  So just compiling the procedure may need a catalog 
lock or whatever, but when it starts executing a transaction isn't required.


Any stored procedure in general should be able to invoke stored procedures, to 
any level of nesting, just like in any normal programming language.  There might 
be restrictions on what individual procedures can do depending on how they're 
declared; for example, if one is declared to have a scope-bound transaction, 
then it or ones it invokes can't have explicit transaction control statements. 
But such restrictions are an orthogonal or case-dependent matter.


(When we have a distinct stored procedure, I also believe that a stored function 
should be more restricted, such as only having IN parameters and not being able 
to see the database but by way of parameters, and that it should be 
deterministic.  But that ship has sailed and I'm not going to argue for any 
changes to functions.)


-- Darren Duncan

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


Re: EOL for 8.2 (was Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers)

2011-04-21 Thread Peter Eisentraut
On tor, 2011-04-21 at 13:39 -0400, Tom Lane wrote:
 Josh Berkus j...@agliodbs.com writes:
  Better that someone should just focus on whipping Robert's (or was it
  Greg's?) replace-the-missing-casts package into shape as an extension.
 
 I think Peter originated that, actually.  My recollection is that there
 didn't seem to be any way to extend it to a complete solution, and
 besides which it's really a crutch to avoid fixing bugs in your
 application.  Still, if someone does want to expend more work on it
 I wouldn't object.

http://petereisentraut.blogspot.com/2008/03/readding-implicit-casts-in-postgresql.html

There are some problems if you just add *all* the casts back without
thinking.  In particular, the || appears to be causing problems.

But other than those few specific cases, that tool kit fixes all known
problems.  So anyone who is willing to spend more than zero minutes on
planning and executing a major version upgrade shouldn't really have any
problems with this aspect.



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


Re: [HACKERS] Patch for pg_upgrade to turn off autovacuum

2011-04-21 Thread Bruce Momjian
Bruce Momjian wrote:
 Bruce Momjian wrote:
  Robert Haas wrote:
   On Thu, Mar 31, 2011 at 12:11 PM, Bruce Momjian br...@momjian.us wrote:
Robert Haas wrote:
On Thu, Mar 31, 2011 at 11:32 AM, Heikki Linnakangas
heikki.linnakan...@enterprisedb.com wrote:
 ?I think the maintenance
 overhead of an invisible variable is too much.

 A simple GUC or command-line switch isn't much code.
   
I like the idea of a command-line switch.
   
If you want to do that you should gereralize it as --binary-upgrade in
case we have other needs for it.
   
   Yeah.  Or we could do a binary_upgrade GUC which has the effect of
   forcibly suppressing autovacuum, and maybe other things later.  I
   think that's a lot less hazardous than fiddling with the autovacuum
   GUC.
  
  I like the idea of a command-line flag because it forces everything to
  be affected, and cannot be turned on and off in sessions --- if you are
  doing a binary upgrade, locked-down is good. :-)
 
 The attached patch adds a new postmaster/postgres binary upgrade mode
 (-b) which disables autovacuum, allows only super-user connections, and
 prevents pg_upgrade_support oid assignment when not in upgrade mode. 
 It also modifies pg_upgrade to use this new mode rather than play with
 trying to stop autovacuum.
 
 This does fix a very rare bug that could happen if
 autovacuum_freeze_max_age were set to maximum by the user.
 
 I think this should be applied to PG 9.1.

One big problem with this patch is that it will not allow people to use
pg_upgrade when upgrading from 9.1 alpha to beta.  What I could do is to
use the mode only on the new cluster for 9.1.

-- 
  Bruce Momjian  br...@momjian.ushttp://momjian.us
  EnterpriseDB http://enterprisedb.com

  + It's impossible for everything to be true. +

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


Re: [HACKERS] EOL for 8.2 (was Re: Formatting Curmudgeons WAS: MMAP Buffers)

2011-04-21 Thread Peter Eisentraut
On tor, 2011-04-21 at 22:17 +0100, Greg Stark wrote:
 However your theory was all predicated on the idea that supporting 8.2
 was not much incremental effort and Dave said that's not true so this
 is all moot. Doing it Windows-excluded seems not worth the effort ---
 unless... what version of Postgres was shipped in the last supported
 releases of major distributions? I think it was 8.1 in Ubuntu Hardy
 and 8.4 in Ubuntu Lucid so that's irrelevant. What about Redhat and
 Debian?

Debian: 8.3 in oldstable (1 year left), 8.4 in stable, probably 9.1 in
next


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


Re: [HACKERS] Patch for pg_upgrade to turn off autovacuum

2011-04-21 Thread Tom Lane
Bruce Momjian br...@momjian.us writes:
 The attached patch adds a new postmaster/postgres binary upgrade mode
 (-b) which disables autovacuum, allows only super-user connections, and
 prevents pg_upgrade_support oid assignment when not in upgrade mode. 
 It also modifies pg_upgrade to use this new mode rather than play with
 trying to stop autovacuum.

 One big problem with this patch is that it will not allow people to use
 pg_upgrade when upgrading from 9.1 alpha to beta.

Huh?  Why would that be?  Seems like you've done something in the wrong
place if that's an issue.

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


Re: [HACKERS] stored procedures

2011-04-21 Thread Tom Lane
Merlin Moncure mmonc...@gmail.com writes:
 On Thu, Apr 21, 2011 at 1:13 PM, Tom Lane t...@sss.pgh.pa.us wrote:
 3. What sort of primitive operations do you expect the SP to be
 able to execute outside a transaction?  The plpgsql model where
 all the primitive operations are really SQL ain't gonna work.

 Does this mean you do or don't expect plpgsql to be able to run as
 procedure?  Should SPI based routines generally be able to run as a
 procedure (I hope so)?  If so, what API enhancements would be needed?
 (I was thinking, SPI_is_proc, or something like that).  I'd like to
 see plpgsql work as much as possible as it does now, except obviously
 you can't have exception handlers.

You can't have arithmetic, comparisons, or much of anything outside a
transaction with plpgsql.  That model just plain doesn't work for this
purpose, I think.  You really want a control language that's independent
of the SQL engine, and for better or worse plpgsql is built inside that
engine.

 What about cancelling? Cancel the current running query, or the whole
 procedure (I'm assuming the latter?  How would that work?

Good question.  If you're imagining that the SP could decide to cancel a
database request partway through, it seems even further afield from what
could reasonably be done in a single-threaded backend.

Maybe we should think about the SP controlling a second backend (or even
multiple backends?) that's executing the transactional operations.
dblink on steroids, as it were.

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


Re: [HACKERS] Patch for pg_upgrade to turn off autovacuum

2011-04-21 Thread Bruce Momjian
Tom Lane wrote:
 Bruce Momjian br...@momjian.us writes:
  The attached patch adds a new postmaster/postgres binary upgrade mode
  (-b) which disables autovacuum, allows only super-user connections, and
  prevents pg_upgrade_support oid assignment when not in upgrade mode. 
  It also modifies pg_upgrade to use this new mode rather than play with
  trying to stop autovacuum.
 
  One big problem with this patch is that it will not allow people to use
  pg_upgrade when upgrading from 9.1 alpha to beta.
 
 Huh?  Why would that be?  Seems like you've done something in the wrong
 place if that's an issue.

Yeah, it is complicated.  I don't really care if autovacuum runs on the
old cluster (we only move the files while the server is down).  We only
want autovacuum not to mess with the relfrozenxids we set on the new
cluster while the table file is empty.

The other issue is that the old alpha binary will not know about the -b
flag and hence will not start.

This all came up when we were looking for the relfrozenxid bug, which we
found as TOAST which has been fixed.  This is a very small problem so
maybe we just skip the fix for 9.1.

-- 
  Bruce Momjian  br...@momjian.ushttp://momjian.us
  EnterpriseDB http://enterprisedb.com

  + It's impossible for everything to be true. +

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


Re: [HACKERS] Patch for pg_upgrade to turn off autovacuum

2011-04-21 Thread Tom Lane
Bruce Momjian br...@momjian.us writes:
 Tom Lane wrote:
 Huh?  Why would that be?  Seems like you've done something in the wrong
 place if that's an issue.

 Yeah, it is complicated.  I don't really care if autovacuum runs on the
 old cluster (we only move the files while the server is down).  We only
 want autovacuum not to mess with the relfrozenxids we set on the new
 cluster while the table file is empty.

 The other issue is that the old alpha binary will not know about the -b
 flag and hence will not start.

Well, once again, why are you trying to do that?  It's not the source
postmaster that needs this flag.

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


Re: [HACKERS] Patch for pg_upgrade to turn off autovacuum

2011-04-21 Thread Bruce Momjian
Tom Lane wrote:
 Bruce Momjian br...@momjian.us writes:
  Tom Lane wrote:
  Huh?  Why would that be?  Seems like you've done something in the wrong
  place if that's an issue.
 
  Yeah, it is complicated.  I don't really care if autovacuum runs on the
  old cluster (we only move the files while the server is down).  We only
  want autovacuum not to mess with the relfrozenxids we set on the new
  cluster while the table file is empty.
 
  The other issue is that the old alpha binary will not know about the -b
  flag and hence will not start.
 
 Well, once again, why are you trying to do that?  It's not the source
 postmaster that needs this flag.

Well, consider that this also locks out non-super users so I figured it
would be good to run the old and new in the same binary upgrade mode. 
Again, we can do just the new cluster for 9.1.   I can also control the
behavior based on the catalog version number, which seems the most
logical.

-- 
  Bruce Momjian  br...@momjian.ushttp://momjian.us
  EnterpriseDB http://enterprisedb.com

  + It's impossible for everything to be true. +

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


Re: [HACKERS] Patch for pg_upgrade to turn off autovacuum

2011-04-21 Thread Jeff Davis
On Thu, 2011-04-21 at 18:22 -0400, Bruce Momjian wrote:
 I can also control the
 behavior based on the catalog version number, which seems the most
 logical.

It seems like we want a simple use -b if available; else don't. Is
that right?

If so, switching based on the version seems reasonable. However, can you
get the information directly from the bianry, rather than trying to
infer it from the catalog version?

Regards,
Jeff Davis


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


Re: [HACKERS] stored procedures

2011-04-21 Thread Tatsuo Ishii
 Robert Haas robertmh...@gmail.com writes:
 EDB has an implementation of this in Advanced Server.  A stored
 procedure can issue a COMMIT, which commits the current transaction
 and begins a new one.  This might or might not be what people are
 imagining for this feature.  If we end up doing something else, one
 thing to consider is the impact on third-party tools like PGPOOL,
 which currently keep track of whether or not a transaction is in
 progress by snooping on the stream of SQL commands.  If a procedure
 can be started with no transaction in progress and return with one
 open, or the other way around, that method will break horribly.
 That's not necessarily a reason not to do it, but I suspect we would
 want to add some kind of protocol-level information about the
 transaction state instead so that such tools could continue to work.
 
 Huh?  There's been a transaction state indicator in the protocol since
 7.4 (see ReadyForQuery).  It's not our problem if PGPOOL is still using
 methods that were appropriate ten years ago.

Pgpool has been using the info since 2004 (7.4 was born in 2003).
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp

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


Re: [HACKERS] stored procedures

2011-04-21 Thread Josh Berkus
On 4/21/11 3:07 PM, Tom Lane wrote:
 Maybe we should think about the SP controlling a second backend (or even
 multiple backends?) that's executing the transactional operations.
 dblink on steroids, as it were.

This is how people are doing this now (using dblink I mean).

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

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


Re: [HACKERS] best way to test new index?

2011-04-21 Thread Josh Berkus
On 4/21/11 1:28 PM, Kevin Grittner wrote:
 That said, I would start by making sure that basic things like
 CREATE INDEX and DROP INDEX work.  Then I would test that INSERT,
 UPDATE, and DELETE do the right things with the index.  Then I would
 make sure that vacuum did the right thing.  Then I would make sure
 that the optimizer was doing a reasonable job of knowing when it was
 usable and what it cost, so that it would be chosen when
 appropriate.  Once everything seemed to be behaving I would
 benchmark it against the reasonable alternatives.

... And then finally, kill -9 the database server while updating the
index to test crash-safeness.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

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


Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-21 Thread Greg Smith

On 04/21/2011 12:39 PM, Robert Haas wrote:

In fact, I've been wondering if we shouldn't consider extending the
support window for 8.2 past the currently-planned December 2011.
There seem to be quite a lot of people running that release precisely
because the casting changes in 8.3 were so painful, and I think the
incremental effort on our part to extend support for another year
would be reasonably small.


The pending EOL for 8.2 is the only thing that keeps me sane when 
speaking with people who refuse to upgrade, yet complain that their 8.2 
install is slow.  This last month, that seems to be more than usual why 
does autovacuum suck so much? complaints that would all go away with an 
8.3 upgrade.  Extending the EOL is not doing any of these users a 
favor.  Every day that goes by when someone is on a version of 
PostgreSQL that won't ever allow in-place upgrade is just making worse 
the eventual dump and reload they face worse.  The time spent porting to 
8.3 is a one-time thing; the suffering you get trying to have a 2011 
sized database on 2006's 8.2 just keeps adding up the longer you 
postpone it.


--
Greg Smith   2ndQuadrant USg...@2ndquadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us



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


Re: [HACKERS] gincostestimate

2011-04-21 Thread Tom Lane
Jeff Janes jeff.ja...@gmail.com writes:
 The problem is that numEntries in src/backend/utils/adt/selfuncs.c is
 zero and eventually causes a division by zero and a cost estimate of
 nan.
 ...
 I don't know what the solution is.  Simply setting numEntries to 1 if
 ginStats.nEntries zero solves this particular problem, but I don't
 know what other consequences it might have.

Yeah, I think clamping numEntries to a minimum value of 1 is a
reasonable thing to do.  Will fix.

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


Re: [HACKERS] stored procedures

2011-04-21 Thread Tom Lane
Josh Berkus j...@agliodbs.com writes:
 On 4/21/11 3:07 PM, Tom Lane wrote:
 Maybe we should think about the SP controlling a second backend (or even
 multiple backends?) that's executing the transactional operations.
 dblink on steroids, as it were.

 This is how people are doing this now (using dblink I mean).

Right, and it works.  But it's notationally painful, management of the
connection information poses security issues, etc etc.  Perhaps those
sorts of things could be addressed, 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


  1   2   >