[HACKERS] proposal: lob conversion functionality

2013-08-09 Thread Pavel Stehule
Hello I had to enhance my older project, where XML documents are parsed and created on server side - in PLpgSQL and PLPerl procedures. We would to use a LO API for client server communication, but we have to parse/serialize LO on server side. I found so there are no simple API for working with LO

Re: [HACKERS] Proposal: leave a hint when switching logging away from stderr

2013-08-09 Thread Noah Misch
On Fri, Aug 09, 2013 at 06:59:13PM -0400, Tom Lane wrote: > Noah Misch writes: > > On Thu, Aug 08, 2013 at 10:32:17PM -0400, Tom Lane wrote: > >> This patch arranges to emit a hint message when/if we switch away from > >> logging to the original postmaster stderr during startup. There are two > >

Re: [HACKERS] killing pg_dump leaves backend process

2013-08-09 Thread Tom Lane
Tatsuo Ishii writes: > I noticed pg_dump does not exit gracefully when killed. > start pg_dump > kill pg_dump by ctrl-c > ps x > 27246 ?Ds96:02 postgres: t-ishii dbt3 [local] COPY > 29920 ?S 0:00 sshd: ishii@pts/5 > 29921 pts/5Ss 0:00 -bash > 30172 ?Ss

Re: [HACKERS] mvcc catalo gsnapshots and TopTransactionContext

2013-08-09 Thread Andres Freund
On 2013-08-09 14:11:46 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2013-08-08 09:27:24 -0400, Robert Haas wrote: > >> How can it be safe to try to read catalogs if the transaction is aborted? > > > Well. It isn't. At least not in general. The specific case triggered > > here though are

[HACKERS] killing pg_dump leaves backend process

2013-08-09 Thread Tatsuo Ishii
I noticed pg_dump does not exit gracefully when killed. start pg_dump kill pg_dump by ctrl-c ps x 27246 ?Ds96:02 postgres: t-ishii dbt3 [local] COPY 29920 ?S 0:00 sshd: ishii@pts/5 29921 pts/5Ss 0:00 -bash 30172 ?Ss 0:00 postgres: t-ishii dbt3 [loc

Re: [HACKERS] confusing error message

2013-08-09 Thread Craig Ringer
On 08/10/2013 02:43 AM, Stephen Frost wrote: > * Craig Ringer (cr...@2ndquadrant.com) wrote: >> More seriously, with interpolated strings for relation names etc >> it can be hard to know which chunks to search for, and search >> engines aren't always good at having the whole message thrown at >> th

Re: [HACKERS] Proposal: leave a hint when switching logging away from stderr

2013-08-09 Thread Josh Berkus
On 08/09/2013 03:40 PM, Tom Lane wrote: > In principle I see the risk, but I don't think I've ever seen an actual > report of someone getting confused this way by an on-the-fly logging > parameter change. Whereas there are numerous examples in the archives > of people not realizing that "pg_ctl -l

Re: [HACKERS] Proposal: leave a hint when switching logging away from stderr

2013-08-09 Thread Tom Lane
Noah Misch writes: > On Thu, Aug 08, 2013 at 10:32:17PM -0400, Tom Lane wrote: >> This patch arranges to emit a hint message when/if we switch away from >> logging to the original postmaster stderr during startup. There are two >> cases to cover: we're still using LOG_DESTINATION_STDERR but redir

Re: [HACKERS] [PATCH] Statistics collection for CLUSTER command

2013-08-09 Thread Vik Fearing
On 08/09/2013 10:37 PM, Stefan Kaltenbrunner wrote: >>> On 08/08/2013 01:52 PM, Vik Fearing wrote: I would add this to the next commitfest but I seem to be unable to log in with my community account (I can log in to the wiki). Help appreciated. > hmm looks like your account may be affect

Re: [HACKERS] Proposal: leave a hint when switching logging away from stderr

2013-08-09 Thread Noah Misch
On Thu, Aug 08, 2013 at 10:32:17PM -0400, Tom Lane wrote: > The attached patch is motivated by > http://www.postgresql.org/message-id/cajyqwwryt9rmbzs-sh6ucr1otg4joxqkdf-fkoyp6pv12t0...@mail.gmail.com > This patch arranges to emit a hint message when/if we switch away from > logging to the origina

Re: [HACKERS] Proposal: leave a hint when switching logging away from stderr

2013-08-09 Thread Tom Lane
Josh Berkus writes: > Tom, >> I thought about trying to leave similar breadcrumbs if the logging >> parameters are changed while the postmaster is running, but it would add a >> fair amount of complication to the patch, and I'm not sure there's a lot >> of value in it. On-the-fly logging paramete

Re: [HACKERS] mvcc catalo gsnapshots and TopTransactionContext

2013-08-09 Thread Noah Misch
On Fri, Aug 09, 2013 at 02:11:46PM -0400, Tom Lane wrote: > Cache invalidation during abort should *not* lead to any attempt to > immediately revalidate the cache. No amount of excuses will make that > okay. I have not looked to see just what the path of control is in this > particular case, but

Re: [HACKERS] [PATCH] Statistics collection for CLUSTER command

2013-08-09 Thread Stefan Kaltenbrunner
On 08/09/2013 12:02 AM, Vik Fearing wrote: > On 08/08/2013 07:57 PM, Stefan Kaltenbrunner wrote: > >> On 08/08/2013 01:52 PM, Vik Fearing wrote: >>> I would add this to the next commitfest but I seem to be unable to log >>> in with my community account (I can log in to the wiki). Help appreciated

Re: [HACKERS] Proposal: leave a hint when switching logging away from stderr

2013-08-09 Thread Stephen Frost
Josh, Tom, * Josh Berkus (j...@agliodbs.com) wrote: > > Does this rise to the level of a usability bug that ought to be > > back-patched? As I said, we've seen this type of thinko multiple > > times before. > > Hmmm. On the one hand, I can't see the harm in it. On the other hand, > I'm relucta

Re: [HACKERS] pg_dump and schema names

2013-08-09 Thread Bruce Momjian
On Fri, Aug 9, 2013 at 02:15:31PM -0400, Bruce Momjian wrote: > On Fri, Aug 9, 2013 at 01:39:35PM -0400, Tom Lane wrote: > > Bruce Momjian writes: > > > On Fri, Aug 9, 2013 at 12:53:20PM -0400, Tom Lane wrote: > > >> This really requires more than no attention to the comments, especially > > >>

Re: [HACKERS] confusing error message

2013-08-09 Thread Stephen Frost
* Craig Ringer (cr...@2ndquadrant.com) wrote: > More seriously, with interpolated strings for relation names etc it can > be hard to know which chunks to search for, and search engines aren't > always good at having the whole message thrown at them. It's not perfect, but if the searches are gettin

Re: [HACKERS] pg_dump and schema names

2013-08-09 Thread Bruce Momjian
On Fri, Aug 9, 2013 at 01:39:35PM -0400, Tom Lane wrote: > Bruce Momjian writes: > > On Fri, Aug 9, 2013 at 12:53:20PM -0400, Tom Lane wrote: > >> This really requires more than no attention to the comments, especially > >> since you just removed the only apparent reason for _getObjectDescriptio

Re: [HACKERS] mvcc catalo gsnapshots and TopTransactionContext

2013-08-09 Thread Tom Lane
Andres Freund writes: > On 2013-08-08 09:27:24 -0400, Robert Haas wrote: >> How can it be safe to try to read catalogs if the transaction is aborted? > Well. It isn't. At least not in general. The specific case triggered > here though are cache invalidations being processed which can lead to > th

Re: [HACKERS] pg_dump and schema names

2013-08-09 Thread Tom Lane
Bruce Momjian writes: > On Fri, Aug 9, 2013 at 12:53:20PM -0400, Tom Lane wrote: >> This really requires more than no attention to the comments, especially >> since you just removed the only apparent reason for _getObjectDescription >> to make a distinction between objects whose name includes a s

Re: [HACKERS] Proposal: leave a hint when switching logging away from stderr

2013-08-09 Thread Josh Berkus
Tom, > I thought about trying to leave similar breadcrumbs if the logging > parameters are changed while the postmaster is running, but it would add a > fair amount of complication to the patch, and I'm not sure there's a lot > of value in it. On-the-fly logging parameter changes don't happen wit

Re: [HACKERS] Proposal for XML Schema Validation

2013-08-09 Thread Bisen Vikrantsingh Mohansingh MT2012036
Hi Craig Ringer, yeah, you are right indeed. I tried to answer your question in three section as below. (A) XML Schema update User may wish to update schema in future. So we will provide them one more function UPDATE_XML_SCHEMA("","","") Here we are assuming URL OF SCHEMA as a primary key. A

Re: [HACKERS] confusing error message

2013-08-09 Thread Alvaro Herrera
I seem to remember somebody proposed an errurl() macro so that we could add URLs to certain particularly confusing error reports. [searches the archives] Bah, that was me, and some other ideas were proposed: http://www.postgresql.org/message-id/48ca9d5f.6060...@esilo.com -- Álvaro Herrera

Re: [HACKERS] pg_dump and schema names

2013-08-09 Thread Bruce Momjian
On Fri, Aug 9, 2013 at 12:53:20PM -0400, Tom Lane wrote: > Bruce Momjian writes: > > On Fri, Aug 9, 2013 at 01:48:43AM -0400, Tom Lane wrote: > >> The practical difficulties involved can be seen by reading the comments > >> and code for _getObjectDescription(). > > > Yes, I looked at that.S

Re: [HACKERS] confusing error message

2013-08-09 Thread Craig Ringer
On 08/10/2013 12:09 AM, Stephen Frost wrote: > Perhaps we should add an area to our documentation which provides > more information about the specific error messages which PostgreSQL > returns? That's not a terribly exciting bit of documentation to > write, but perhaps it would be very useful for o

Re: [HACKERS] pg_dump and schema names

2013-08-09 Thread Tom Lane
Bruce Momjian writes: > On Fri, Aug 9, 2013 at 01:48:43AM -0400, Tom Lane wrote: >> The practical difficulties involved can be seen by reading the comments >> and code for _getObjectDescription(). > Yes, I looked at that.Seems _getObjectDescription() is only called > from _printTocEntry(), a

Re: [HACKERS] question about HTTP API

2013-08-09 Thread Tom Lane
Josh Berkus writes: > Agreed. Too bad you can't do this as an extension, it would allow you > to rev releases a lot faster than once a year. > Actually, maybe you should look at "what is the minimum patch required > to enable a webserver extension", with the idea that most of the > webserver cod

Re: [HACKERS] pg_dump and schema names

2013-08-09 Thread Bruce Momjian
On Fri, Aug 9, 2013 at 01:48:43AM -0400, Tom Lane wrote: > Bruce Momjian writes: > > pg_dump goes to great lengths not to hard-code the schema name into > > commands like CREATE TABLE, instead setting the search_path before > > creating the table; these commands: > > > CREATE SCHEMA xx; > >

Re: [HACKERS] Proposal: leave a hint when switching logging away from stderr

2013-08-09 Thread Tom Lane
Stephen Frost writes: > * Tom Lane (t...@sss.pgh.pa.us) wrote: >> Does this rise to the level of a usability bug that ought to be >> back-patched? As I said, we've seen this type of thinko multiple >> times before. > For this, I'd say to not back-patch it; we seem to have had enough fun > with c

Re: [HACKERS] question about HTTP API

2013-08-09 Thread Josh Berkus
> For my patch, I plan to use pre-forked bgworkers which have already > connected to the backend, so that populating the relcache and other process > startup costs don't impact on the HTTP response time. (This still means > queries are being planned and function code is being compiled for each >

Re: [HACKERS] Proposal: leave a hint when switching logging away from stderr

2013-08-09 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: > Thoughts? In particular, anyone want to bikeshed on the message wording? Looks like a good idea to me and the wording looks fine to me. > Does this rise to the level of a usability bug that ought to be > back-patched? As I said, we've seen this type of t

Re: [HACKERS] confusing error message

2013-08-09 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: > This is all sufficiently bizarre that I don't know if there's an > easy explanation. It occurs to me that users, when faced with complex error messages, are very likely to go to their favorite search engine with it and rarely does that lead them to any docu

Re: [HACKERS] mvcc catalo gsnapshots and TopTransactionContext

2013-08-09 Thread Noah Misch
On Tue, Aug 06, 2013 at 09:06:59AM +0200, Andres Freund wrote: > On 2013-08-05 13:09:31 -0400, Noah Misch wrote: > > When we call AtEOSubXact_Inval() or AtEOXact_Inval() with a relation still > > open, we can potentially get a relcache rebuild and therefore a syscache > > lookup as shown above. Co

Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: [HACKERS] Proposal for Allow postgresql.conf values to be changed via SQL [review])

2013-08-09 Thread David Fetter
On Fri, Aug 09, 2013 at 03:08:45PM +0200, Dimitri Fontaine wrote: > Stephen Frost writes: > > A shared catalog which defined which *database* to run the trigger > > in, with a way to fire off a new backend worker in that database > > and tell it to run the trigger, might be interesting and would >

Re: [HACKERS] Proposal for XML Schema Validation

2013-08-09 Thread Tom Lane
Craig Ringer writes: > On 08/09/2013 05:55 PM, Kodamasimham Pridhvi (MT2012066) wrote: >> Only sole purpose of making use of keyword USE_SCHEMA is to mimic oracle >> (somewhere on >> oracle site i found this type of syntax) > Well, there's certainly precedent for that - see to_char, the various

Re: [HACKERS] mvcc catalo gsnapshots and TopTransactionContext

2013-08-09 Thread Andres Freund
On 2013-08-09 09:05:51 -0400, Robert Haas wrote: > On Thu, Aug 8, 2013 at 1:28 PM, Andres Freund wrote: > > Well. It isn't. At least not in general. The specific case triggered > > here though are cache invalidations being processed which can lead to > > the catalog being read (pretty crummy, but

Re: [HACKERS] Proposal for XML Schema Validation

2013-08-09 Thread Craig Ringer
On 08/09/2013 05:55 PM, Kodamasimham Pridhvi (MT2012066) wrote: > (B) Alter Table > >Only sole purpose of making use of keyword USE_SCHEMA is to mimic oracle > (somewhere on > oracle site i found this type of syntax) Well, there's certainly precedent for that - see to_char, the various diff

Re: [HACKERS] CREATE EVENT TRIGGER syntax

2013-08-09 Thread Robert Haas
On Mon, Aug 5, 2013 at 4:53 PM, Dimitri Fontaine wrote: > Bruce Momjian writes: >> So do we want to keep that "AND" in the 9.3beta and 9.4 documentation? > > The grammar as in gram.y still allows the AND form, and I think we're > used to maintain documentation that matches the code here. So I thi

Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: [HACKERS] Proposal for Allow postgresql.conf values to be changed via SQL [review])

2013-08-09 Thread Dimitri Fontaine
Stephen Frost writes: > A shared catalog which defined which *database* to run the trigger in, > with a way to fire off a new backend worker in that database and tell it > to run the trigger, might be interesting and would deal with the issue > that the trigger would behave differently depending o

Re: [HACKERS] mvcc catalo gsnapshots and TopTransactionContext

2013-08-09 Thread Robert Haas
On Thu, Aug 8, 2013 at 1:28 PM, Andres Freund wrote: > Well. It isn't. At least not in general. The specific case triggered > here though are cache invalidations being processed which can lead to > the catalog being read (pretty crummy, but not easy to get rid > of). That's actually safe since bef

Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: [HACKERS] Proposal for Allow postgresql.conf values to be changed via SQL [review])

2013-08-09 Thread Stephen Frost
* Robert Haas (robertmh...@gmail.com) wrote: > On Sun, Aug 4, 2013 at 4:26 PM, Dimitri Fontaine > wrote: > > What I'm yet unsure about is that there's a consensus that the use cases > > are worthy of a new shared catalog in the system. Also I didn't look how > > hard it is to actually provide for

Re: [HACKERS] Proposal for XML Schema Validation

2013-08-09 Thread Bisen Vikrantsingh Mohansingh MT2012036
Hi , In support to proposal, I'm extending by providing use case scenario. Consider a table student(id int, profile xml) where you are storing student id and their profile in xml format. Let xml format for profile be as follow. profile.xml=== xyz abc

Re: [HACKERS] Proposal for XML Schema Validation

2013-08-09 Thread Kodamasimham Pridhvi (MT2012066)
Hi Craig Ringer, (Sorry for reposting it as it got posted in different thread previously) yeah, you are right indeed. I tried to answer your question in three section as below. (A) XML Schema update User may wish to update schema in future. So we will provide them one more function UPDATE_XM

FW: [HACKERS] Proposal for XML Schema Validation

2013-08-09 Thread Kodamasimham Pridhvi (MT2012066)
Hi Craig Ringer, (Sorry for reposting it as it got posted in different thread previously) yeah, you are right indeed. I tried to answer your question in three section as below. (A) XML Schema update User may wish to update schema in future. So we will provide them one more function UPDATE_XM

Re: [HACKERS] Proposal for XML Schema Validation

2013-08-09 Thread Bisen Vikrantsingh Mohansingh MT2012036
Hi Craig Ringer, yeah, you are right indeed. I tried to answer your question in three section as below. (A) XML Schema update User may wish to update schema in future. So we will provide them one more function UPDATE_XML_SCHEMA("","","") Here we are assuming URL OF SCHEMA as a primary key. A

Re: [HACKERS] question about HTTP API

2013-08-09 Thread Andrew Tipton
On 9 Aug 2013 17:03, "Greg Stark" wrote: > I looked at the wiki and thought it had a lot of good ideas but also a lot of good questions. do you have any idea how to tackle the session problem? > [...] > A decent HTTP RPC layer will need to have some way of creating a session and issuing multiple r

Re: [HACKERS] question about HTTP API

2013-08-09 Thread Greg Stark
On Fri, Aug 9, 2013 at 9:21 AM, Andrew Tipton wrote: > I recently threw together a quick-and-dirty prototype of this idea. It > was an external tool which used the libmicrohttpd library to accept > incoming requests, convert them to a SQL query (which called a stored > procedure), and return the

Re: [HACKERS] question about HTTP API

2013-08-09 Thread Andrew Tipton
On Fri, Aug 9, 2013 at 3:44 AM, Josh Berkus wrote: > Well, there's HTSQL: http://htsql.org/ > > Other than that, no. I was thinking of creating a general tool as a > custom background worker, which would take stored procedure calls and > pass them through to PostgreSQL, returning results as JSON

Re: [HACKERS] question about HTTP API

2013-08-09 Thread Andrew Tipton
On Fri, Aug 9, 2013 at 2:44 AM, Szymon Guz wrote: > > Do we have any attempts of implementation the HTTP server described at > http://wiki.postgresql.org/wiki/HTTP_API? > > It seems like there are design ideas only. Are there any ideas about > implementation like using some existing http servers

Re: [HACKERS] [PATCH] Statistics collection for CLUSTER command

2013-08-09 Thread Fabien COELHO
Thank you, but it seems you've duplicated the title from the other patch (and thanks for adding that one, too!). Indeed, possibly a wrong copy paste. Fixed. -- Fabien. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.post

Re: [HACKERS] [PATCH] Statistics collection for CLUSTER command

2013-08-09 Thread Vik Fearing
On 08/08/2013 02:26 PM, Fabien COELHO wrote: > >> As part of routine maintenance monitoring, it is interesting for us to >> have statistics on the CLUSTER command (timestamp of last run, and >> number of runs since stat reset) like we have for (auto)ANALYZE and >> (auto)VACUUM. Patch against today