Re: [HACKERS] Allow WAL information to recover corrupted pg_controldata

2012-06-16 Thread Amit kapila
I guess my first question is: why do we need this? There are lots of things in the TODO list that someone wanted once upon a time, but they're not all actually important. Do you have reason to believe that this one is? It's been six years since that email, so it's worth asking

Re: [HACKERS] Resource Owner reassign Locks

2012-06-16 Thread Amit kapila
I don't think so. C doesn't ref count its pointers. You are right I have misunderstood. I don't think that lock tags have good human readable formats, and just a pointer dump probably wouldn't be much use when something that can never happen has happened. But I'll at least add a reference

Re: [HACKERS] libpq compression

2012-06-16 Thread Magnus Hagander
On Sat, Jun 16, 2012 at 12:55 PM, Tom Lane t...@sss.pgh.pa.us wrote: Magnus Hagander mag...@hagander.net writes: Yes, but there's also a lot of such awkward logic we need to add if we *do* go with the SSL library doing the compression: For example, we can no longer trust the SSL library to

Re: [HACKERS] libpq compression

2012-06-16 Thread Magnus Hagander
On Sat, Jun 16, 2012 at 12:40 PM, Tom Lane t...@sss.pgh.pa.us wrote: Marko Kreen mark...@gmail.com writes: On Sat, Jun 16, 2012 at 6:39 AM, Magnus Hagander mag...@hagander.net wrote: Fair enough if we decide that - but we should make that decision knowing that we're leaving the JDBC and .Net

[HACKERS] Combine non-recursive and recursive CTEs?

2012-06-16 Thread Magnus Hagander
I'm not sure if this is something I don't know how to do, or if it's something we simply can't do, or if it's something we could do but the syntax can't handle :-) Basically, I'd like to combine a recursive and a non-recursive CTE in the same query. If I do it non-recursive, I can do something

Re: [HACKERS] Allow WAL information to recover corrupted pg_controldata

2012-06-16 Thread Tom Lane
Amit kapila amit.kap...@huawei.com writes: AFAIR pg_controldata fit on a disk sector so it can not be half written. It can be corrupt due to some other reasons as well like torn disk sector. Torn disk sector? Please, this is nonsense. Disks cannot write half a sector and then stop. A

Re: [HACKERS] Combine non-recursive and recursive CTEs?

2012-06-16 Thread PostgreSQL - Hans-Jürgen Schönig
On Jun 16, 2012, at 8:27 AM, Magnus Hagander wrote: I'm not sure if this is something I don't know how to do, or if it's something we simply can't do, or if it's something we could do but the syntax can't handle :-) Basically, I'd like to combine a recursive and a non-recursive CTE in the

Re: [HACKERS] Combine non-recursive and recursive CTEs?

2012-06-16 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: Basically, I'd like to combine a recursive and a non-recursive CTE in the same query. Just mark them all as recursive. There's no harm in marking a CTE as recursive when it isn't really. Trying something like: WITH t1 (z,b) AS ( SELECT a,b

[HACKERS] Pg default's verbosity?

2012-06-16 Thread Fabien COELHO
Hello pgdev, (Second attempt) I've conducted a statistical study about PostgreSQL use in OSS. One of the result is that quite a few projects have errors in their SQL setup scripts which lead to some statements to be ignored, typically somme ADD CONSTRAINTS which do not change the database

[HACKERS] compare lower case and upper case when encoding is utf-8

2012-06-16 Thread Quan Zongliang
Hi hackers, I found that lower case is less than upper case when the db is created with utf8. I tried below locale en_US.utf8 'A''a' false locale ja_JP.utf8 'A''a' true locale zh_CN.utf8 'A''a' false Under Windows locale Chinese_China 'A''a'

Re: [HACKERS] Combine non-recursive and recursive CTEs?

2012-06-16 Thread Magnus Hagander
On Sat, Jun 16, 2012 at 2:52 PM, Tom Lane t...@sss.pgh.pa.us wrote: Magnus Hagander mag...@hagander.net writes: Basically, I'd like to combine a recursive and a non-recursive CTE in the same query. Just mark them all as recursive.  There's no harm in marking a CTE as recursive when it isn't

Re: [HACKERS] [RFC][PATCH] Logical Replication/BDR prototype and architecture

2012-06-16 Thread Andres Freund
Hi Robert, On Friday, June 15, 2012 10:03:38 PM Robert Haas wrote: On Thu, Jun 14, 2012 at 4:13 PM, Andres Freund and...@2ndquadrant.com wrote: I don't plan to throw in loads of conflict resolution smarts. The aim is to get to the place where all the infrastructure is there so that a MM

[HACKERS] REVIEW: Optimize referential integrity checks (todo item)

2012-06-16 Thread Dean Rasheed
On 12 February 2012 02:06, Vik Reykja vikrey...@gmail.com wrote: I decided to take a crack at the todo item created from the following post: http://archives.postgresql.org/pgsql-performance/2005-10/msg00458.php The attached patch makes the desired changes in both code and function naming.

[HACKERS] Re: [COMMITTERS] pgsql: Run pgindent on 9.2 source tree in preparation for first 9.3

2012-06-16 Thread Bruce Momjian
On Sat, Jun 16, 2012 at 01:10:31AM -0400, Noah Misch wrote: On Fri, Jun 15, 2012 at 10:45:16PM -0400, Bruce Momjian wrote: I have updated the pgindent README to use these Perl indent instructions: find . -name \*.pl -o -name \*.pm | xargs perltidy \

Re: [HACKERS] [patch] libpq one-row-at-a-time API

2012-06-16 Thread Marko Kreen
Demos: https://github.com/markokr/libpq-rowproc-demos/blob/master/demo-onerow-sync.c https://github.com/markokr/libpq-rowproc-demos/blob/master/demo-onerow-async.c Few clarifications below. On Fri, Jun 15, 2012 at 9:21 PM, Marko Kreen mark...@gmail.com wrote: Now, looking at the problem with

Re: [HACKERS] [patch] libpq one-row-at-a-time API

2012-06-16 Thread Tom Lane
Marko Kreen mark...@gmail.com writes: Now, looking at the problem with some perspective, the solution is obvious: when in single-row mode, the PQgetResult() must return proper PGresult for that single row. And everything else follows that. * PQgetRowData(): can be called instead

Re: [HACKERS] libpq compression

2012-06-16 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: On Sat, Jun 16, 2012 at 12:55 PM, Tom Lane t...@sss.pgh.pa.us wrote: It's not obvious to me that we actually *need* anything except the ability to recognize that a null-encrypted SSL connection probably shouldn't be treated as matching a hostssl

Re: [HACKERS] Pg default's verbosity?

2012-06-16 Thread Tom Lane
Fabien COELHO coe...@cri.ensmp.fr writes: [ errors in SQL scripts fed to psql are easily missed ] So I would suggest the following todos: 1 - change the default verbosity to warning. The argument for defaulting to NOTICE is the same as it's always been: that those messages are really intended

Re: [HACKERS] Backup docs

2012-06-16 Thread Dimitri Fontaine
Magnus Hagander mag...@hagander.net writes: This is copied from the old documentation. It used to say It is not necessary to be concerned about the amount of time elapsed between pg_start_backup and the start of the actual backup, nor between the end of the backup and pg_stop_backup. And the

Re: [HACKERS] libpq compression

2012-06-16 Thread k...@rice.edu
On Sat, Jun 16, 2012 at 11:15:30AM -0400, Tom Lane wrote: Magnus Hagander mag...@hagander.net writes: On Sat, Jun 16, 2012 at 12:55 PM, Tom Lane t...@sss.pgh.pa.us wrote: It's not obvious to me that we actually *need* anything except the ability to recognize that a null-encrypted SSL

Re: [HACKERS] [patch] libpq one-row-at-a-time API

2012-06-16 Thread Marko Kreen
On Sat, Jun 16, 2012 at 6:09 PM, Tom Lane t...@sss.pgh.pa.us wrote: I guess this raises the question of whether we ought to revert the row-callback patch entirely and support only this approach.  IMO it is (barely) not too late to do that for 9.2, if we want to. If we don't want to, then this

Re: [HACKERS] REVIEW: Optimize referential integrity checks (todo item)

2012-06-16 Thread Tom Lane
Dean Rasheed dean.a.rash...@gmail.com writes: BTW, I had no problems applying both the original patch and Chetan Suttraway's version. The only difference between the patches seems to be that the original is in context format, and Chetan Suttraway's is in unified format. Which format do

Re: [HACKERS] REVIEW: Optimize referential integrity checks (todo item)

2012-06-16 Thread Dean Rasheed
On 16 June 2012 18:04, Tom Lane t...@sss.pgh.pa.us wrote: Dean Rasheed dean.a.rash...@gmail.com writes: BTW, I had no problems applying both the original patch and Chetan Suttraway's version. The only difference between the patches seems to be that the original is in context format, and Chetan

[HACKERS] Start of 2012-06 CommitFest

2012-06-16 Thread Kevin Grittner
There hasn't been any discussion of who will manage this CF that I've heard. Since nature abhors a vacuum, I took some preliminary steps to get it started, and will take the role if nobody objects. If you want to review a particular patch, go ahead and claim it in the CF application:

[HACKERS] SQL standard changed behavior of ON UPDATE SET NULL/SET DEFAULT?

2012-06-16 Thread Tom Lane
While looking at Vik Reykja's pending patch to improve the FK triggers by skipping processing when a NULL column didn't change, I started to wonder whether that really had no user-visible semantic effect. In particular, in ON UPDATE SET NULL/SET DEFAULT cases, it seemed like this could change the

Re: [HACKERS] Pg default's verbosity?

2012-06-16 Thread Fabien COELHO
Hello Tom, thanks for your answer. So I would suggest the following todos: 1 - change the default verbosity to warning. The argument for defaulting to NOTICE is the same as it's always been: that those messages are really intended for novices, and a pretty good definition of a novice is

Re: [HACKERS] Streaming-only Remastering

2012-06-16 Thread Daniel Farina
On Fri, Jun 15, 2012 at 3:53 PM, Simon Riggs si...@2ndquadrant.com wrote: On 10 June 2012 19:47, Joshua Berkus j...@agliodbs.com wrote: So currently we have a major limitation in binary replication, where it is not possible to remaster your system (that is, designate the most caught-up

Re: [HACKERS] [RFC][PATCH] Logical Replication/BDR prototype and architecture

2012-06-16 Thread Steve Singer
On 12-06-15 04:03 PM, Robert Haas wrote: On Thu, Jun 14, 2012 at 4:13 PM, Andres Freundand...@2ndquadrant.com wrote: I don't plan to throw in loads of conflict resolution smarts. The aim is to get to the place where all the infrastructure is there so that a MM solution can be built by

Re: [HACKERS] SQL standard changed behavior of ON UPDATE SET NULL/SET DEFAULT?

2012-06-16 Thread Tom Lane
I wrote: Have the SQL committee simply failed to notice that in whacking this text around they changed the meaning? Which behavior is actually implemented by other RDBMSes? If anyone is up for actually trying this, here is a script to test the behavior in question: create table pp (f1 int,

Re: [HACKERS] SQL standard changed behavior of ON UPDATE SET NULL/SET DEFAULT?

2012-06-16 Thread Dean Rasheed
On 16 June 2012 21:18, Tom Lane t...@sss.pgh.pa.us wrote: Anybody have DB2, or something else that might be thought to be pretty close to spec-compliant? I have an Oracle DB, but they're not exactly known for spec compliance. In fact they dodge this entire issue by not supporting ON UPDATE

[HACKERS] s/UNSPECIFIED/SIMPLE/ in foreign key code?

2012-06-16 Thread Tom Lane
Our foreign-key-related code uses MATCH_UNSPECIFIED to denote the default foreign key match behavior. This corresponds to the wording used in the SQL92 spec, for instance If match type is not specified or if FULL is specified, But I always found it rather confusing; it sounds like we don't

Re: [HACKERS] sortsupport for text

2012-06-16 Thread Peter Geoghegan
On 18 March 2012 15:08, Tom Lane t...@sss.pgh.pa.us wrote: However, it occurred to me that we could pretty easily jury-rig something that would give us an idea about the actual benefit available here.  To wit: make a C function that wraps strxfrm, basically strxfrm(text) returns bytea.  Then

Re: [HACKERS] measuring spinning

2012-06-16 Thread Jeff Janes
On Thu, Jun 14, 2012 at 2:39 PM, Robert Haas robertmh...@gmail.com wrote: On Wed, Jan 11, 2012 at 8:48 PM, Robert Haas robertmh...@gmail.com wrote: I've had cause, a few times this development cycle, to want to measure the amount of spinning on each lwlock in the system.  To that end, I've

Re: [HACKERS] SQL standard changed behavior of ON UPDATE SET NULL/SET DEFAULT?

2012-06-16 Thread Dickson S. Guedes
2012/6/16 Tom Lane t...@sss.pgh.pa.us: I wrote: Have the SQL committee simply failed to notice that in whacking this text around they changed the meaning?  Which behavior is actually implemented by other RDBMSes? If anyone is up for actually trying this, here is a script to test the

[HACKERS] Broken system timekeeping breaks the stats collector

2012-06-16 Thread Tom Lane
I've had a vague feeling for awhile now that the occasional buildfarm failures we see in the stats regression test (where it appears that the stats collector fails to respond to requests for no good reason) might be related to operating-system timekeeping glitches. Today there is finally

Re: [HACKERS] transforms

2012-06-16 Thread Jeff Janes
On Thu, Jun 14, 2012 at 3:42 PM, Peter Eisentraut pete...@gmx.net wrote: Here is my first patch for the transforms feature.  This is a mechanism to adapt data types to procedural languages.  The previous proposal was here: http://archives.postgresql.org/pgsql-hackers/2012-05/msg00728.php When

Re: [HACKERS] transforms

2012-06-16 Thread Jeff Janes
On Sat, Jun 16, 2012 at 7:15 PM, Jeff Janes jeff.ja...@gmail.com wrote: On Thu, Jun 14, 2012 at 3:42 PM, Peter Eisentraut pete...@gmx.net wrote: Here is my first patch for the transforms feature.  This is a mechanism to adapt data types to procedural languages.  The previous proposal was here:

Re: [HACKERS] Broken system timekeeping breaks the stats collector

2012-06-16 Thread Dickson S. Guedes
2012/6/16 Tom Lane t...@sss.pgh.pa.us: [... cut ...] (1) In backend_read_statsfile, make an initial attempt to read the stats file and then read GetCurrentTimestamp after that.  If the local clock reading is less than the stats file's timestamp, we know that some sort of clock skew or glitch

Re: [HACKERS] Broken system timekeeping breaks the stats collector

2012-06-16 Thread Tom Lane
Dickson S. Guedes lis...@guedesoft.net writes: What happens when Daylight saving time ends? Or it doesn't matter in this scenario? Irrelevant, we're working in UTC-based timestamps. regards, tom lane -- Sent via pgsql-hackers mailing list

Re: [HACKERS] Pg default's verbosity?

2012-06-16 Thread nik9000
I've always used -1-f - file.sql. It is confusing that -1 doesn't warn you when it wont work though. Sent from my iPhone On Jun 16, 2012, at 3:42 AM, Fabien COELHO coe...@cri.ensmp.fr wrote: Hello pgdev, (Second attempt) I've conducted a statistical study about PostgreSQL use in

Re: [HACKERS] Allow WAL information to recover corrupted pg_controldata

2012-06-16 Thread Amit kapila
Torn disk sector? Please, this is nonsense. Disks cannot write half a sector and then stop. What I was intended to say is corruption due to hardware or some other problem, not because when Postgres is updating pg_control file. For example http://cquirke.mvps.org/9x/baddata.htm.