Re: [HACKERS] restore PD_PAGE_FULL on WAL update replay

2008-11-08 Thread Pavan Deolasee
On Fri, Nov 7, 2008 at 9:12 PM, Alvaro Herrera [EMAIL PROTECTED] wrote: This patch ensures that the PD_PAGE_FULL bit is restored after replaying a heap_update WAL record. I think this must have been overlooked on the HOT patch. Since PD_PAGE_FULL is just a hint, I think we might have

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1197)

2008-11-08 Thread KaiGai Kohei
Simon Riggs wrote: On Fri, 2008-11-07 at 15:12 -0500, Robert Haas wrote: Foreign Key deletions could be handled correctly if you treat them as updates. If we have the following example TableA security_context=y value=2 fk=1 TableB security_context=x value=1 TableA refers to TableB.

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1197)

2008-11-08 Thread KaiGai Kohei
Simon, Thanks for your comments. Some initial thoughts based upon reading the Wiki. I've not been involved in things up to now, so if this dredges up old discussions, well, these are my thoughts. I want SEPostgreSQL, but I'd like it to work without needing to be a compile time option so

[HACKERS] Short CVS question

2008-11-08 Thread Dirk Riehle
Hi, I have a short CVS question please: How do I go from a particular file revision like pgsql/cvs/pgsql/src/backend/parser/parse_relation.c.1.3 to the complete commit? I.e. I would like to navigate back from this particular file to the commit and see all the other files that were touched

Re: [HACKERS] pg_dump roles support

2008-11-08 Thread Benedek László
Hi, Thank you for your review. On 2008-11-07 21:20, Alvaro Herrera wrote: The patch contains the following things: - pg_dump and pg_dumpall accepts the --role=rolename parameter, and sends a SET ROLE command on their connections Minor comment -- I think you need to quote the role

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1197)

2008-11-08 Thread Simon Riggs
On Fri, 2008-11-07 at 16:52 -0500, Bruce Momjian wrote: Simon Riggs wrote: So if somebody with context x tries to delete value1 from TableB, they will be refused because of a row they cannot see. In this case the correct action is to update the tuple in TableB so it now has a

Re: [HACKERS] [PATCHES] Infrastructure changes for recovery (v8)

2008-11-08 Thread Simon Riggs
On Fri, 2008-11-07 at 15:44 -0800, Jeff Davis wrote: Is there a way to avoid wiping A and making a new base backup? rsync -- Simon Riggs www.2ndQuadrant.com PostgreSQL Training, Services and Support -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1197)

2008-11-08 Thread Simon Riggs
On Sat, 2008-11-08 at 14:21 +0900, KaiGai Kohei wrote: Some users will be able to take advantage of the facilities without implementing full MLS. Yet we want the full facilities for Government. Many people currently run multiple customers in different schemas, though this would let them

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1197)

2008-11-08 Thread Simon Riggs
On Sat, 2008-11-08 at 18:58 +0900, KaiGai Kohei wrote: This document gives us some of hints to be considered when we apply mandatory access control facilities on database systems. However, it is not a specification of SE-PostgreSQL. The series of documents assumes traditional

Re: [HACKERS] pg_stop_backup wait bug fix

2008-11-08 Thread Simon Riggs
On Fri, 2008-11-07 at 18:32 -0300, Alvaro Herrera wrote: Simon Riggs wrote: Minor bug fix for pg_stop_backup() to prevent it waiting longer than necessary in certain circumstances. As far as I can tell, this patch needs to be applied to HEAD, 8.3 and 8.2 (when xlog switch was

Re: [HACKERS] auto_explain contrib moudle

2008-11-08 Thread Martin Pihlak
Jeff Davis wrote: I still don't understand why this psql patch is desirable. Who sets their client_min_messages to LOG in psql? And if they do, why would they expect different behavior that they always got from the already-existing GUC log_min_duration_statement? I know a few ;) In my

Re: [HACKERS] Windowing Function Patch Review - Standard Conformance

2008-11-08 Thread David Rowley
Hitoshi Harada Wrote: although attached is the whole (split) patch. I'm having some trouble getting these patches to patch cleanly. I think it's because of this that I can't get postgres to compile after applying the patch. It errors out at tuptoaster.c some constants seem to be missing from

Re: [HACKERS] Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle

2008-11-08 Thread Ron Mayer
Tom Lane wrote: Ron Mayer [EMAIL PROTECTED] writes: Rather than forcing Postgres mode; couldn't it put a set intervalstyle = [whatever the current interval style is] in the dump file? This would work for loading into a PG = 8.4 server, and fail miserably for loading into pre-8.4 servers.

Re: [HACKERS] Windowing Function Patch Review - Standard Conformance

2008-11-08 Thread Hitoshi Harada
2008/11/9 David Rowley [EMAIL PROTECTED]: Hitoshi Harada Wrote: although attached is the whole (split) patch. I'm having some trouble getting these patches to patch cleanly. I think it's because of this that I can't get postgres to compile after applying the patch. It errors out at

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1197)

2008-11-08 Thread KaiGai Kohei
Simon Riggs wrote: On Sat, 2008-11-08 at 14:21 +0900, KaiGai Kohei wrote: Some users will be able to take advantage of the facilities without implementing full MLS. Yet we want the full facilities for Government. Many people currently run multiple customers in different schemas, though this

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1197)

2008-11-08 Thread KaiGai Kohei
Simon Riggs wrote: On Sat, 2008-11-08 at 18:58 +0900, KaiGai Kohei wrote: This document gives us some of hints to be considered when we apply mandatory access control facilities on database systems. However, it is not a specification of SE-PostgreSQL. The series of documents assumes

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1197)

2008-11-08 Thread KaiGai Kohei
Simon Riggs wrote: On Fri, 2008-11-07 at 16:52 -0500, Bruce Momjian wrote: Simon Riggs wrote: So if somebody with context x tries to delete value1 from TableB, they will be refused because of a row they cannot see. In this case the correct action is to update the tuple in TableB so it now has

Re: [HACKERS] Short CVS question

2008-11-08 Thread Robert Haas
In general, this is pretty hard to do in CVS - you basically have to look for other commits with the same time stamp and log message, and I don't think the tool provides any real support for that. In the case of pgsql, you might want to look at the commit message and then google the

Re: FWD: Re: [HACKERS] Updated backslash consistency patch

2008-11-08 Thread Greg Sabino Mullane
2. the help.c patch no longer applies 3. the help.c patch breaks alignment of the help output Attached is a patch to fix problems 2 and 3: help.c clean application and formatting of the output therein. I also put \z right after \dp and removed the duplicate wording, to make it fit better,

Re: [HACKERS] Short CVS question

2008-11-08 Thread Douglas McNaught
On Fri, Nov 7, 2008 at 8:24 PM, Dirk Riehle [EMAIL PROTECTED] wrote: Hi, I have a short CVS question please: How do I go from a particular file revision like pgsql/cvs/pgsql/src/backend/parser/parse_relation.c.1.3 to the complete commit? I.e. I would like to navigate back from this

Re: [HACKERS] auto_explain contrib moudle

2008-11-08 Thread Jeff Davis
On Sat, 2008-11-08 at 12:18 +0200, Martin Pihlak wrote: For me the primary use of auto-explain would be interactive troubleshooting. The troublesome statements usually involve several nested function calls and are tedious to trace manually. With auto-explain I fire up psql, load the module,

Re: [HACKERS] Windowing Function Patch Review - Standard Conformance

2008-11-08 Thread Tom Lane
David Rowley [EMAIL PROTECTED] writes: patching file src/include/catalog/pg_proc.h Hunk #4 FAILED at 106. 1 out of 4 hunks FAILED -- saving rejects to file src/include/catalog/pg_proc.h.rej I imagine you'll find that hunk #4 covers the entire DATA() body of the file :-(. It can't possibly

Re: [HACKERS] TABLE command

2008-11-08 Thread Robert Haas
Hi, I was assigned to code-review this patch by pgsql-rrreviewers. I don't have much to add to what's already been written, but here are my thoughts. 1. I agree with Tom Lane's earlier comments that table_ref is not the correct non-terminal. For example, this seems pretty strange: rhaas=#

Re: [HACKERS] Windowing Function Patch Review - Standard Conformance

2008-11-08 Thread Greg Stark
Instead of a patch it might be easier to submit the new columns as a perl script or sed command. We do something like that to make merging pg_proc easier. greg On 8 Nov 2008, at 01:36 PM, Tom Lane [EMAIL PROTECTED] wrote: David Rowley [EMAIL PROTECTED] writes: patching file

Re: [HACKERS] TABLE command

2008-11-08 Thread Tom Lane
Robert Haas [EMAIL PROTECTED] writes: Incidentally, I noticed while looking at this that \h with also fails, even though WITH can now be the first word of a valid SQL statement. I think we ought to patch psql to return the same help for WITH as it does for SELECT. Hmm. Given the current

Re: [HACKERS] Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle

2008-11-08 Thread Tom Lane
Ron Mayer [EMAIL PROTECTED] writes: So the options seem to be: (1) Don't output a SQL-standard interval literal for the value negative one days and negative one hours; perhaps by sticking an extra '+' sign in there? This is pretty much what the postgres style does... (2) Force

Re: [HACKERS] auto_explain contrib moudle

2008-11-08 Thread Jeff Davis
On Fri, 2008-11-07 at 18:03 +0200, Martin Pihlak wrote: Another thing is a feature I am interested in -- ability to auto-explain statements execututed from within functions. I'm thinking of adding an extra boolean GUC -- explain.log_nested_statements (defaults to false). Quick test seems to

Re: [HACKERS] Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle

2008-11-08 Thread Tom Lane
BTW, I just noticed that CVS HEAD has a bug in reading negative SQL-spec literals: regression=# select interval '-2008-10'; interval -- -2008 years -10 mons (1 row) regression=# select interval '--10'; interval -- 10 mons (1 row) Surely

Re: [HACKERS] Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle

2008-11-08 Thread Ron Mayer
Tom Lane wrote: Ron Mayer [EMAIL PROTECTED] writes: (3) Put something into the dump file that will make the old server reject the file rather than successfully loading wrong data? (Some if intervalstyle==std and version8.3 abort loading the restore logic?) There isn't any

Re: [HACKERS] Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle

2008-11-08 Thread Tom Lane
Ron Mayer [EMAIL PROTECTED] writes: Tom Lane wrote: There isn't any way to do that, unless you have a time machine in your hip pocket. The trouble with putting set intervalstyle = something; into the dump script is that older servers will (by default) report an error on that line and keep

Re: [HACKERS] Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle

2008-11-08 Thread Ron Mayer
Tom Lane wrote: Ron Mayer [EMAIL PROTECTED] writes: Tom Lane wrote: The trouble is that older servers will (by default) report an error on that line and keep right on chugging. Not necessarily. Couldn't we put select * from (select substring(version() from '[0-9\.]+') as version) as a

Re: [HACKERS] Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle

2008-11-08 Thread Tom Lane
Ron Mayer [EMAIL PROTECTED] writes: select * from (select substring(version() from '[0-9\.]+') as version) as a join (select generate_series(0,1000)) as b on(version'8.4'); set intervalstyle = something; [ shrug... ] It's still just one easily missable bleat. Not here. On my

Re: [HACKERS] Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle

2008-11-08 Thread Ron Mayer
Tom Lane wrote: Oh, I see what you're trying to do. The answer is no. We're not going to totally destroy back-portability of dumps, especially not for a problem that won't even affect most people (negative intervals are hardly common). Similarly I wonder if pg_dump should add a fail if

Re: [HACKERS] Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle

2008-11-08 Thread Ron Mayer
Tom Lane wrote: BTW, I just noticed that CVS HEAD has a bug in reading negative SQL-spec literals: regression=# select interval '-2008-10'; regression=# select interval '--10'; Surely the latter must mean -10 months. This is orthogonal to the current patch ... Perhaps the below

Re: [HACKERS] Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle

2008-11-08 Thread Tom Lane
Another thought here ... I'm looking at the sign hack + if (IntervalStyle == INTSTYLE_SQL_STANDARD + field[0][0] == '-' i == 1 + field[i][0] != '-' field[i][0] != '+') + { + /*-- +

Re: [HACKERS] TABLE command

2008-11-08 Thread Robert Haas
Hmm. Given the current infrastructure for \h, the only way to do that would be to make a separate ref page for WITH, which feels like the wrong thing. And the objection I have to TABLE is not the code but the apparent need to give it its own ref page (as we already did for VALUES, and I

[HACKERS] [PATCH] Recreate Missing WAL Directories (from TODO)

2008-11-08 Thread Jonah H. Harris
When performing a PITR copy of a data cluster, the pg_xlog directory is generally omitted. As such, when starting the copy up for replay/recovery, the WAL directories need to be recreated. This patch checks to see whether XLOGDIR and XLOGDIR/archive_status exist on XLOGStartup and if not,

Re: [HACKERS] Block-level CRC checks

2008-11-08 Thread Paul Schlie
Alvaro Herrera wrote: Alvaro Herrera wrote: Alvaro Herrera wrote: Hmm, oh I see another problem here -- the bit is not restored when replayed heap_update's WAL record. I'm now wondering what other bits are set without much care about correctly restoring them during replay. I'm now

Re: [HACKERS] Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle

2008-11-08 Thread Ron Mayer
Tom Lane wrote: Another thought here ... I'm looking at the sign hack + if (IntervalStyle == INTSTYLE_SQL_STANDARD and not liking it very much. Yes, it does the intended thing for strict SQL-spec input, but it seems to produce a bunch of weird corner cases for non-spec

Re: [HACKERS] Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle

2008-11-08 Thread Tom Lane
Ron Mayer [EMAIL PROTECTED] writes: Tom Lane wrote: BTW, I just noticed that CVS HEAD has a bug in reading negative SQL-spec literals: Perhaps the below patch fixes that? Actually I think it should be if (*field[i] == '-') as in the comparable case for fractional seconds

Re: [HACKERS] Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle

2008-11-08 Thread Tom Lane
Ron Mayer [EMAIL PROTECTED] writes: Yes, at first glance I think that approach is better; but we'd need to make sure not to apply the rule too enthusiastically on traditional postgres intervals; Well, of course we'd only apply it in SQL_STANDARD mode. The idea here is that intervalstyle helps

Re: [HACKERS] Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle

2008-11-08 Thread Tom Lane
I wrote: ... Consider -1 1:00:00 flips the sign - 1 1:00:00 doesn't flip the sign -1 day 1:00:00 doesn't flip the sign -2008-10 1:00:00flips the sign -2008-10 1 doesn't flip the sign -2008 years

Re: [HACKERS] [PATCH] Recreate Missing WAL Directories (from TODO)

2008-11-08 Thread Tom Lane
Jonah H. Harris [EMAIL PROTECTED] writes: When performing a PITR copy of a data cluster, the pg_xlog directory is generally omitted. As such, when starting the copy up for replay/recovery, the WAL directories need to be recreated. This patch checks to see whether XLOGDIR and

Re: [HACKERS] [PATCH] Recreate Missing WAL Directories (from TODO)

2008-11-08 Thread Jonah H. Harris
On Sat, Nov 8, 2008 at 4:08 PM, Tom Lane [EMAIL PROTECTED] wrote: This has been suggested before but I'm unconvinced that it's a good idea. It's reasonably common for pg_xlog to be a symlink. If you neglect to re-establish the symlink then what would happen is that xlog gets recreated on the

[HACKERS] WIP: Page space reservation (pgupgrade)

2008-11-08 Thread Zdenek Kotala
Attached patch allows to setup storage parameter for space reservation. I use reloptions capability for it. You can use it: CREATE TABLE test(id int) with (reservedspace=10); The idea is to reduce freespace value about reservedspace on places where PageGet(Heap)FreeSpace is called. I need

Re: [HACKERS] WIP: Page space reservation (pgupgrade)

2008-11-08 Thread Tom Lane
Zdenek Kotala [EMAIL PROTECTED] writes: Attached patch allows to setup storage parameter for space reservation. What is the point of this? We don't need it for 8.3-8.4, we aren't going to back-patch such a thing into 8.2 or before (certainly not before, since reloptions didn't exist before

Re: [HACKERS] Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle

2008-11-08 Thread Chuck McDevitt
Doesn't ANSI standard interval syntax have the minus sign before the quotes? Select interval -'2008-10'; ??? -Original Message- From: [EMAIL PROTECTED] [mailto:pgsql-hackers- [EMAIL PROTECTED] On Behalf Of Tom Lane Sent: Saturday, November 08, 2008 11:39 AM To: Ron Mayer Cc:

Re: [HACKERS] Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle

2008-11-08 Thread Tom Lane
Chuck McDevitt [EMAIL PROTECTED] writes: Doesn't ANSI standard interval syntax have the minus sign before the quotes? Select interval -'2008-10'; They allow it either there or inside the quotes. We can't support outside-the-quotes unless we make INTERVAL a fully reserved word (and even then

Re: [HACKERS] Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle

2008-11-08 Thread Tom Lane
Ron Mayer [EMAIL PROTECTED] writes: Brendan Jurd wrote: The changes to the documentation all look good. I did notice one final typo that I think was introduced in the latest version. doc/src/sgml/datatype.sgml:2270 has Nonstandardrd instead of Nonstandard. Just checked in a fix to that

Re: [HACKERS] Optimizing COPY

2008-11-08 Thread Robert Haas
Heikki, I was assigned as a round-robin reviewer for this patch, but it looks to me like it is still WIP, so I'm not sure how much effort it's worth putting in at this point. Do you plan to finish this for 8.4, and if so, should I wait for the next version before reviewing further? Thanks,

Re: [HACKERS] WIP: Page space reservation (pgupgrade)

2008-11-08 Thread Jonah H. Harris
On Sat, Nov 8, 2008 at 8:08 PM, Tom Lane [EMAIL PROTECTED] wrote: Zdenek Kotala [EMAIL PROTECTED] writes: Attached patch allows to setup storage parameter for space reservation. What is the point of this? That's my question. Why is this needed at all? -- Jonah H. Harris, Senior DBA