Re: [HACKERS] another ecpg crash

2008-05-10 Thread Euler Taveira de Oliveira
Alvaro Herrera wrote: Huh, isn't the test backwards? In which way? I use a simple one but whatever test that uses 'exec sql include foo' and foo.h doesn't exist, it will crash. -- Euler Taveira de Oliveira http://www.timbira.com/ -- Sent via pgsql-hackers mailing list (pgsql-hackers@po

Re: [HACKERS] another ecpg crash

2008-05-10 Thread Alvaro Herrera
Euler Taveira de Oliveira wrote: > Hi, > > I found another bug when using 'exec sql include filename'. If you use a > filename that doesn't exist, ecpg crashes while trying to close a null > pointer. The above test case shows it. A possible fix is attached. Huh, isn't the test backwards? > --

[HACKERS] another ecpg crash

2008-05-10 Thread Euler Taveira de Oliveira
Hi, I found another bug when using 'exec sql include filename'. If you use a filename that doesn't exist, ecpg crashes while trying to close a null pointer. The above test case shows it. A possible fix is attached. #include /* foo.h doesn't exist */ exec sql include foo; int main(void) {

Re: [HACKERS] bloated heapam.h

2008-05-10 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Apparently the reason for pg_dump.c to need htup.h is getAttrName which > needs system columns' attribute numbers. Of course, the first thing > that comes to mind is that we should fix pg_dump to not require that > header in the first place. Perhaps we

Re: [HACKERS] bloated heapam.h

2008-05-10 Thread Alvaro Herrera
Tom Lane wrote: > +1 for moving fastgetattr, heap_getattr, and the heaptuple.c functions > to htup.h. I don't see any big gain from relocating the other stuff; > it seems to largely all use about the same set of typedefs. Ultimately that was my conclusion too. I tried moving the heaptuple.c fun

Re: [HACKERS] ecpg localization

2008-05-10 Thread Euler Taveira de Oliveira
Euler Taveira de Oliveira wrote: This is a second try. I forgot to say that this patch doesn't include nls support to ecpg files automagically. If you guys think that it's is a Good Thing to do, we need to hack the preproc.y to hardcode the locale stuff; if you decide that it isn't necessar

Re: [HACKERS] Setting a pre-existing index as a primary key

2008-05-10 Thread Andrew Sullivan
On Sat, May 10, 2008 at 11:55:29AM -0400, Tom Lane wrote: > IMHO a utility command should do one easily-explained thing. The fewer > options the better. Sticking to that principle makes for a better-maintained system. I agree. If we want to point out, "You might rename your index afterwards to

Re: [HACKERS] Setting a pre-existing index as a primary key

2008-05-10 Thread Tom Lane
"Jonah H. Harris" <[EMAIL PROTECTED]> writes: > ALTER TABLE blah ADD ... PRIMARY KEY (...) USING PREBUILT INDEX index_hame > If the user doesn't specify CONSTRAINT constraint_name, it will > default to current implicit behavior of col_pkey. IOW, the default behavior is to rename the index? Doesn

Re: [HACKERS] Setting a pre-existing index as a primary key

2008-05-10 Thread Andrew Dunstan
Jonah H. Harris wrote: Yes, I just think PREBUILT conveys the meaning of the command more appropriately. I could care less though. (Please don't top-answer) I don't think we should add new keywords unnecessarily. cheers andrew On Sat, May 10, 2008 at 5:35 PM, Gregory Stark <[EMAIL P

Re: [HACKERS] Setting a pre-existing index as a primary key

2008-05-10 Thread Jonah H. Harris
Yes, I just think PREBUILT conveys the meaning of the command more appropriately. I could care less though. On Sat, May 10, 2008 at 5:35 PM, Gregory Stark <[EMAIL PROTECTED]> wrote: > "Jonah H. Harris" <[EMAIL PROTECTED]> writes: > >> So, would anyone be averse to something like the following: >>

Re: [HACKERS] Setting a pre-existing index as a primary key

2008-05-10 Thread Gregory Stark
"Jonah H. Harris" <[EMAIL PROTECTED]> writes: > So, would anyone be averse to something like the following: > > ALTER TABLE blah ADD ... PRIMARY KEY (...) USING PREBUILT INDEX index_hame > > If the user doesn't specify CONSTRAINT constraint_name, it will > default to current implicit behavior of c

Re: [HACKERS] ecpg localization

2008-05-10 Thread Euler Taveira de Oliveira
Peter Eisentraut wrote: I suggest you keep working on this, and we will reconsider a more complete patch at a later date. This is a second try. Fix some issues pointed by Peter. It's a little fatter 'cause I worked on almost all of the strings. I attempted to mimic the postgresql style but I

Re: [HACKERS] Setting a pre-existing index as a primary key

2008-05-10 Thread Jonah H. Harris
So, would anyone be averse to something like the following: ALTER TABLE blah ADD ... PRIMARY KEY (...) USING PREBUILT INDEX index_hame If the user doesn't specify CONSTRAINT constraint_name, it will default to current implicit behavior of col_pkey. -Jonah On Sat, May 10, 2008 at 1:08 PM, Joshu

Re: [HACKERS] bloated heapam.h

2008-05-10 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > The one that makes a bit more sense is a new syncscan.h. And there are > a lot of things in heapam.h that actually correspond to tuple > manipulation (heap_form_tuple and so on), so perhaps a new header file > would be appropriate, but there's already h

Re: [HACKERS] bloated heapam.h

2008-05-10 Thread Alvaro Herrera
Zdenek Kotala wrote: > Alvaro Herrera napsal(a): > >> Others are more conflictive. For example syncscan.c is keeping the >> prototypes for its own functions on heapam.h. Also pruneheap.c and >> rewriteheap.c. As a result, not only themselves need to include >> heapam.h (without any other need fo

Re: [HACKERS] Posting to hackers and patches lists

2008-05-10 Thread David Fetter
On Sat, May 10, 2008 at 10:55:57AM +0100, Gregory Stark wrote: > "Zdenek Kotala" <[EMAIL PROTECTED]> writes: > > Gregory Stark napsal(a): > >> "Josh Berkus" <[EMAIL PROTECTED]> writes: > >> > >>> How about hacking together a simple patch tracker instead, as > >>> Bruce suggested? I've never found

[HACKERS] Rethinking dependency traversal during DROP

2008-05-10 Thread Tom Lane
I promise I won't expend any real effort on this until after the commitfest is over, but ... While working on the recently committed constraints patch, I got annoyed by the way in which DROP CASCADE frequently emitted "noise" messages. For instance: regression=# create table p1 (f1 int); CREATE T

Re: [HACKERS] Setting a pre-existing index as a primary key

2008-05-10 Thread Joshua D. Drake
Tom Lane wrote: Apparently your definition of "easy" depends entirely on keystrokes and not at all on memory/cognitive burden. I was trying to remove one opportunity for human error, which is tied to memory and cognitive burden. It is very easy to fat finger something. Is it a critical error

Re: [HACKERS] constraint exclusion analysis caching

2008-05-10 Thread Andrew Dunstan
Stephen Frost wrote: (BTW, why does your MUA set Mail-Followup-To: (and do it badly, what's more) ?) I'm amazed at the number of people who ask me this.. Guess it's just different for different communities. Basically, I like to keep my mail in the different folders it belongs in, s

Re: [HACKERS] Setting a pre-existing index as a primary key

2008-05-10 Thread Tom Lane
"Joshua D. Drake" <[EMAIL PROTECTED]> writes: > As a counter point, I don't see any reason to make the DBA's life > harder. Sure it is just one step but it is a human step, prone to error > and taking more time than it should. Why not just make it easy? I don't see that decorating infrequently-

Re: [HACKERS] Setting a pre-existing index as a primary key

2008-05-10 Thread Andrew Dunstan
Joshua D. Drake wrote: Tom Lane wrote: Well it should be optional but it would be nice if we had the option to have it renamed per the default... meaning the same output if I were to do this: If you want that, you can rename the index (either before or afterwards). I don't see any reason

Re: [HACKERS] Setting a pre-existing index as a primary key

2008-05-10 Thread Joshua D. Drake
Tom Lane wrote: Well it should be optional but it would be nice if we had the option to have it renamed per the default... meaning the same output if I were to do this: If you want that, you can rename the index (either before or afterwards). I don't see any reason to clutter the make-constra

Re: [HACKERS] Setting a pre-existing index as a primary key

2008-05-10 Thread Tom Lane
"Joshua D. Drake" <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Why, and exactly what would you define as "appropriate naming style"? >> The user has always been free to pick whatever constraint name he >> wants. > Well it should be optional but it would be nice if we had the option to > have

Re: [HACKERS] bloated heapam.h

2008-05-10 Thread Zdenek Kotala
Alvaro Herrera napsal(a): Others are more conflictive. For example syncscan.c is keeping the prototypes for its own functions on heapam.h. Also pruneheap.c and rewriteheap.c. As a result, not only themselves need to include heapam.h (without any other need for it), but they force some other f

Re: [HACKERS] Posting to hackers and patches lists

2008-05-10 Thread Zdenek Kotala
Gregory Stark napsal(a): "Zdenek Kotala" <[EMAIL PROTECTED]> writes: Gregory Stark napsal(a): "Josh Berkus" <[EMAIL PROTECTED]> writes: How about hacking together a simple patch tracker instead, as Bruce suggested? I've never found e-mail to be a particularly good way to track patches. T

Re: [HACKERS] "Claimed" status on Commitfest pages

2008-05-10 Thread Simon Riggs
On Sat, 2008-05-10 at 15:57 +1000, Brendan Jurd wrote: > On Sat, May 10, 2008 at 2:49 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > > I see that Brendan has proposed the following definition on > > CommitFest:Help: > I wouldn't say I did anything so formal as proposing a definition =) > > Someone men

Re: [HACKERS] constraint exclusion analysis caching

2008-05-10 Thread Gregory Stark
"Stephen Frost" <[EMAIL PROTECTED]> writes: > I'd rather get responses to my emails through the list than directly to me. > Additionally, I don't really need to get two copies of every email sent to > me on a mailing list. Then doesn't setting it to: Andrew Dunstan <[EMAIL PROTECTED]>,PostgreS

Re: [HACKERS] Posting to hackers and patches lists

2008-05-10 Thread Gregory Stark
"Zdenek Kotala" <[EMAIL PROTECTED]> writes: > Gregory Stark napsal(a): >> "Josh Berkus" <[EMAIL PROTECTED]> writes: >> >>> How about hacking together a simple patch tracker instead, as Bruce >>> suggested? I've never found e-mail to be a particularly good way to track >>> patches. >> >> The thi

Re: [HACKERS] ecpg crash

2008-05-10 Thread Michael Meskes
On Sat, May 10, 2008 at 12:14:57AM -0300, Euler Taveira de Oliveira wrote: > While i'm working on a ecpg patch I found a bug in ecpg code. The simple > program above could reproduce it. But basically it crashes (segfault) > because it's trying to use a inexistent connection when we're preparing

Re: [HACKERS] Posting to hackers and patches lists

2008-05-10 Thread Zdenek Kotala
Gregory Stark napsal(a): "Josh Berkus" <[EMAIL PROTECTED]> writes: How about hacking together a simple patch tracker instead, as Bruce suggested? I've never found e-mail to be a particularly good way to track patches. The thing is that we don't just want to "track" patches. We want to talk