[HACKERS] FW: indirect dereferencing a field in a record using plpgsql

2003-09-08 Thread Conrad Vermeulen
Hi, I had a problem where I needed to indirectly dereference a field from a record. To illustrate: CREATE FUNCTION test2() returns bool as ' DECLARE myrec record; fld text; BEGIN select ''hello'' as a, ''world'' as b into myrec; fld = ''a''; -- the fieldname

[HACKERS] dump cache summary

2003-09-08 Thread Mark Kirkwood
As part of attempting to gain an understanding of how Postgres works, I wanted to see if I could display a summary of what relations were using pages in the cache. Having done that, I was all set to trash the code when I wondered if it might be useful in its own right... Here is a sample of

Re: [HACKERS] mcxt.c

2003-09-08 Thread Gaetano Mendola
Tom Lane [EMAIL PROTECTED] wrote: Mendola Gaetano [EMAIL PROTECTED] writes: A test for null string is missing here: MemoryContextStrdup(MemoryContext context, const char *string) { char *nstr; - - if ( !string ) - { - elog(ERROR, MemoryContextStrdup called with a NULL pointer);

[HACKERS] on-disk format changes

2003-09-08 Thread Andreas Joseph Krogh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi. Will there be any more on-disk format changes before 7.4 goes final which will require a dump-restore, or is that impossible to say? - -- Andreas Joseph Krogh [EMAIL PROTECTED] Managing Director, Senior Software Developer OfficeNet AS - -

Re: [HACKERS] on-disk format changes

2003-09-08 Thread Bruno Wolff III
On Mon, Sep 08, 2003 at 14:45:41 +0200, Andreas Joseph Krogh [EMAIL PROTECTED] wrote: Will there be any more on-disk format changes before 7.4 goes final which will require a dump-restore, or is that impossible to say? While it is impossible to say with 100% certainly, the developers

Re: [HACKERS] on-disk format changes

2003-09-08 Thread Andreas Joseph Krogh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Monday 08 September 2003 15:27, Bruno Wolff III wrote: On Mon, Sep 08, 2003 at 14:45:41 +0200, Andreas Joseph Krogh [EMAIL PROTECTED] wrote: Will there be any more on-disk format changes before 7.4 goes final which will require a

Re: [HACKERS] on-disk format changes

2003-09-08 Thread Bruno Wolff III
On Mon, Sep 08, 2003 at 19:13:47 +0530, Shridhar Daithankar [EMAIL PROTECTED] wrote: On 8 Sep 2003 at 8:42, Bruno Wolff III wrote: If that was hash index, Tom suggested to bump version number of the indexes in later versions and throw an error and ask user to reindex that particular

Re: [HACKERS] mcxt.c

2003-09-08 Thread Tom Lane
Gaetano Mendola [EMAIL PROTECTED] writes: Tom Lane [EMAIL PROTECTED] wrote: This seems inappropriate to me. Are you going to suggest that every routine that takes a pointer parameter needs to explicitly test for null? Of course I'm not suggesting this, what I'm suggesting is put an assert(

[HACKERS] plpgsql debugging

2003-09-08 Thread Andreas Pflug
The current implementation of plpgsql lacks some details that makes programming really hard: there's no language validator to check the code when creating the function, and there's support to debug the code. Before I start hacking on this, I'd like to share my thoughts. Looking at the code, I

Re: [HACKERS] plpgsql debugging

2003-09-08 Thread Richard Huxton
On Monday 08 September 2003 15:14, Andreas Pflug wrote: Looking at the code, I think that a validator could be added quite soon. The PLpgSQL_execstate struct could be extended by a validation_active bool flag, which changes the behaviour of all exec_stmt_XXX routines. The validator primarily

Re: [HACKERS] plpgsql debugging

2003-09-08 Thread Andreas Pflug
Richard Huxton wrote: Actually, a simple trace ability would be a huge step forward. It'd save me dotting RAISE statements around my functions while I write them. Sounds bloody familiar... :-( Even the ability to add DEBUG statements that checked some global flag before firing would be very

[HACKERS] pgsql vc++|win32

2003-09-08 Thread luke
Hi guys, I'm planning with some friends to develop a port of pgsql, to native win32 environment using vc++; We read about MingW choice of official dev team, and we comprise their worries but we think that best results could be obtained using some really native win32 libraries (for better or for

Re: [HACKERS] row level lock and table level locks

2003-09-08 Thread Jenny -
HI, I found out that TupleTable stores per-tuple information(it stores HeapTupleData) and that also there are multiple TupleTables in the db at a time.Based on what are diffrent TupleTables created? thank you Jenny From: Larry Douzie [EMAIL PROTECTED] To: Tom Lane [EMAIL PROTECTED] CC: [EMAIL

Re: [HACKERS] plpgsql doesn't coerce boolean expressions to boolean

2003-09-08 Thread Andreas Pflug
Tom Lane wrote: Here are some possible responses, roughly in order of difficulty to implement: 1. Leave well enough alone (and perhaps document the behavior). 2. Throw an error if the expression doesn't return boolean. I'd opt for 2. It's quite common that newer compilers will detect more bogus

Re: [HACKERS] plpgsql doesn't coerce boolean expressions to boolean

2003-09-08 Thread Doug McNaught
Andreas Pflug [EMAIL PROTECTED] writes: Tom Lane wrote: 2. Throw an error if the expression doesn't return boolean. I'd opt for 2. It's quite common that newer compilers will detect more bogus coding than older ones. There might be existing functions that break from this because they

Re: [HACKERS] plpgsql doesn't coerce boolean expressions to boolean

2003-09-08 Thread Tom Lane
Doug McNaught [EMAIL PROTECTED] writes: I agree with another poster that deprecation in 7.4 and removal in 7.5 might make sense. How would we deprecate it exactly? Throw a NOTICE? regards, tom lane ---(end of

Re: [HACKERS] row level lock and table level locks

2003-09-08 Thread Tom Lane
Jenny - [EMAIL PROTECTED] writes: I found out that TupleTable stores per-tuple information(it stores HeapTupleData) and that also there are multiple TupleTables in the db at a time.Based on what are diffrent TupleTables created? TupleTables are just temporary data structures to hold

Re: [HACKERS] FreeBSD/i386 thread test

2003-09-08 Thread Bruce Momjian
Jeroen Ruigrok/asmodai wrote: -On [20030908 06:32], Bruce Momjian ([EMAIL PROTECTED]) wrote: Your gethostbyname() is _not_ thread-safe Your getpwuid() is _not_ thread-safe Your functions are _not_ all thread-safe Interesting. Do you have all the *_r files listed in thread.c? I sure

Re: [HACKERS] plpgsql doesn't coerce boolean expressions to boolean

2003-09-08 Thread Doug McNaught
Tom Lane [EMAIL PROTECTED] writes: Doug McNaught [EMAIL PROTECTED] writes: I agree with another poster that deprecation in 7.4 and removal in 7.5 might make sense. How would we deprecate it exactly? Throw a NOTICE? I was thinking of just a mention in the release notes that we've found

Re: [HACKERS] plpgsql doesn't coerce boolean expressions to boolean

2003-09-08 Thread Andreas Pflug
Tom Lane wrote: Doug McNaught [EMAIL PROTECTED] writes: I agree with another poster that deprecation in 7.4 and removal in 7.5 might make sense. How would we deprecate it exactly? Throw a NOTICE? Good question. A NOTICE just might be ignored, breaking everything surprisingly in 7.5.

Re: [HACKERS] mcxt.c

2003-09-08 Thread Serguei Mokhov
Date: Mon, 08 Sep 2003 09:57:30 -0400 From: Tom Lane [EMAIL PROTECTED] Gaetano Mendola [EMAIL PROTECTED] writes: Tom Lane [EMAIL PROTECTED] wrote: This seems inappropriate to me. Are you going to suggest that every routine that takes a pointer parameter needs to explicitly test for

Re: [HACKERS] row level lock and table level locks

2003-09-08 Thread Jenny -
TupleTables are just temporary data structures to hold transiently created tuples during execution of a query. There's usually one for each plan node. whats a 'plan node'? From: Tom Lane [EMAIL PROTECTED] To: Jenny - [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: [HACKERS] row level lock

Re: [HACKERS] FreeBSD/i386 thread test

2003-09-08 Thread Jeroen Ruigrok/asmodai
-On [20030908 18:52], Bruce Momjian ([EMAIL PROTECTED]) wrote: So you don't have all the *_r functions, and your non-*_r functions aren't thread-safe. Should we disable theading on FreeBSD? Seems so. Exactly. Most other threading works though. :) -- Jeroen Ruigrok van der Werven asmodai

Re: [HACKERS] row level lock and table level locks

2003-09-08 Thread Alvaro Herrera
On Mon, Sep 08, 2003 at 10:17:46AM -0700, Jenny - wrote: TupleTables are just temporary data structures to hold transiently created tuples during execution of a query. There's usually one for each plan node. whats a 'plan node'? Have you tried reading the documentation, source code and the

Re: [HACKERS] plpgsql doesn't coerce boolean expressions to boolean

2003-09-08 Thread Andrew Dunstan
Tom Lane wrote: Doug McNaught [EMAIL PROTECTED] writes: I agree with another poster that deprecation in 7.4 and removal in 7.5 might make sense. How would we deprecate it exactly? Throw a NOTICE? Release notes, I guess. A NOTICE would be fine as long as it didn't result in a flood

[HACKERS] constraint modification on todo list

2003-09-08 Thread Jeroen Ruigrok/asmodai
Hi people, can someone add: Add an ALTER TABLE MODIFY CONSTRAINT item to the todo list? I am even willing to pick this one up in a while, after I finish some other outstanding tasks. -- Jeroen Ruigrok van der Werven asmodai(at)wxs.nl / asmodai PGP fingerprint: 2D92 980E 45FE 2C28 9DB7 9D88

Re: [HACKERS] pgsql vc++|win32

2003-09-08 Thread Dann Corbit
-Original Message- From: luke [mailto:[EMAIL PROTECTED] Sent: Monday, September 08, 2003 9:16 AM To: Hackers Subject: [HACKERS] pgsql vc++|win32 Hi guys, I'm planning with some friends to develop a port of pgsql, to native win32 environment using vc++; We read about MingW

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Rod Taylor
On Mon, 2003-09-08 at 14:32, Jeroen Ruigrok/asmodai wrote: Hi people, can someone add: Add an ALTER TABLE MODIFY CONSTRAINT item to the todo list? I am even willing to pick this one up in a while, after I finish some other outstanding tasks. This could be rather time consuming to

Re: [HACKERS] plpgsql debugging

2003-09-08 Thread Richard Huxton
On Monday 08 September 2003 17:14, Andreas Pflug wrote: Richard Huxton wrote: Actually, a simple trace ability would be a huge step forward. It'd save me dotting RAISE statements around my functions while I write them. Sounds bloody familiar... :-( Even the ability to add DEBUG statements

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Jeroen Ruigrok/asmodai
-On [20030908 20:52], Rod Taylor ([EMAIL PROTECTED]) wrote: This could be rather time consuming to actually write but having the ability to change foreign key on update / on delete modes without rechecking all of the data would be very useful. I was more interested in this feature for CHECK

Re: [HACKERS] pgsql vc++|win32

2003-09-08 Thread Bruce Momjian
Dann Corbit wrote: Mingw uses the native Win32 libraries. Porting from a Mingw port to VC++ will be trivial compared to what we have now. where can I access latest dev source code and dev docs in the/from CVS ? Maybe you want the Win32 page. There are some links to it in recent

Re: [HACKERS] plpgsql doesn't coerce boolean expressions to boolean

2003-09-08 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes: Tom Lane wrote: How would we deprecate it exactly? Throw a NOTICE? Release notes, I guess. A NOTICE would be fine as long as it didn't result in a flood of them. If that happened once at parse time that should be fine, I think. It would be

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Tom Lane
Jeroen Ruigrok/asmodai [EMAIL PROTECTED] writes: can someone add: Add an ALTER TABLE MODIFY CONSTRAINT item to the todo list? Why? For a constraint, it's not obvious what this would do for you that dropping and re-adding the constraint wouldn't do. In the places where we support CREATE OR

[HACKERS] pgsql in shared lib

2003-09-08 Thread ivan
hi, ist possible to compile postgres (after same small modification) to shared so, or dll , and usr it like normal postgres , but without any server and so on. Its whould be work like simple database (with all funciton in one lib), which dont need any others additionals like (network,other

Re: [HACKERS] pgsql in shared lib

2003-09-08 Thread Doug McNaught
ivan [EMAIL PROTECTED] writes: hi, ist possible to compile postgres (after same small modification) to shared so, or dll , and usr it like normal postgres , but without any server and so on. Not without very major code changes. -Doug ---(end of

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Bruce Momjian
Tom Lane wrote: Jeroen Ruigrok/asmodai [EMAIL PROTECTED] writes: can someone add: Add an ALTER TABLE MODIFY CONSTRAINT item to the todo list? Why? For a constraint, it's not obvious what this would do for you that dropping and re-adding the constraint wouldn't do. In the places where

Re: [HACKERS] pgsql vc++|win32

2003-09-08 Thread scott.marlowe
On Mon, 8 Sep 2003, Bruce Momjian wrote: Dann Corbit wrote: Mingw uses the native Win32 libraries. Porting from a Mingw port to VC++ will be trivial compared to what we have now. where can I access latest dev source code and dev docs in the/from CVS ? Maybe you want the

Re: [HACKERS] pgsql in shared lib

2003-09-08 Thread Andrew Dunstan
ivan wrote: hi, ist possible to compile postgres (after same small modification) to shared so, or dll , and usr it like normal postgres , but without any server and so on. Its whould be work like simple database (with all funciton in one lib), which dont need any others additionals like

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Jeroen Ruigrok/asmodai
-On [20030908 22:42], Bruce Momjian ([EMAIL PROTECTED]) wrote: I assume MODIFY would allow you to alter the constraint without re-checking all the rows, as would be required by DROP/ADD. However, if you are modifying the constraint, wouldn't we have to recheck all the rows anyway. Of course, one

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: I assume MODIFY would allow you to alter the constraint without re-checking all the rows, as would be required by DROP/ADD. However, if you are modifying the constraint, wouldn't we have to recheck all the rows anyway. Yeah. Rod's point about altering

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Tom Lane
Jeroen Ruigrok/asmodai [EMAIL PROTECTED] writes: Because what I can imagine, and please correct me if I miss something in my thought pattern, you have a small gap between dropping a constraint and adding the new one allowing the possibility of missing checks. If you're concerned about

Re: [HACKERS] pgsql in shared lib

2003-09-08 Thread Tom Lane
Doug McNaught [EMAIL PROTECTED] writes: ivan [EMAIL PROTECTED] writes: ist possible to compile postgres (after same small modification) to shared so, or dll , and usr it like normal postgres , but without any server and so on. Not without very major code changes. ... which are unlikely to

Re: [HACKERS] plpgsql doesn't coerce boolean expressions to boolean

2003-09-08 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan [EMAIL PROTECTED] writes: What's the practice in deprecating other features? We generally don't ;-). Certainly 7.4 contains bigger incompatible changes than this one, and so have most of our prior releases. I thought I had seen discussions along the

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Gaetano Mendola
Jeroen Ruigrok/asmodai [EMAIL PROTECTED] wrote: Because what I can imagine, and please correct me if I miss something in my thought pattern, you have a small gap between dropping a constraint and adding the new one allowing the possibility of missing checks. I think, someone correct me if I'm

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Gaetano Mendola
Tom Lane [EMAIL PROTECTED] wrote: Bruce Momjian [EMAIL PROTECTED] writes: I assume MODIFY would allow you to alter the constraint without re-checking all the rows, as would be required by DROP/ADD. However, if you are modifying the constraint, wouldn't we have to recheck all the rows

Re: [HACKERS] [PATCHES] mcxt.c

2003-09-08 Thread Greg Stark
Neil Conway [EMAIL PROTECTED] writes: I think the percentage of deployments that enable assertions (which causes a runtime performance hit) but NOT debugging info (which does not) is pretty small. How big a penalty is it? If it's small, or if it could be made small by making a few assertions

Re: [HACKERS] FreeBSD/i386 thread test

2003-09-08 Thread Peter Eisentraut
Bruce Momjian writes: Both gethostbyname() and getpwuid() have no _r equivalents on FreeBSD-STABLE, ergo no thread-safe functions of these. So you don't have all the *_r functions, and your non-*_r functions aren't thread-safe. Should we disable theading on FreeBSD? Seems so. Why would

Re: [HACKERS] FreeBSD/i386 thread test

2003-09-08 Thread Jeroen Ruigrok/asmodai
-On [20030908 23:52], Peter Eisentraut ([EMAIL PROTECTED]) wrote: Why would FreeBSD have a library of thread-safe libc functions (libc_r) if the functions weren't thread-safe? I think the test is faulty. Having libc_r is not a guarantee that all functions of libc are represented in that library

Re: [HACKERS] FreeBSD/i386 thread test

2003-09-08 Thread Manfred Spraul
Jeroen Ruigrok/asmodai wrote: -On [20030908 23:52], Peter Eisentraut ([EMAIL PROTECTED]) wrote: Why would FreeBSD have a library of thread-safe libc functions (libc_r) if the functions weren't thread-safe? I think the test is faulty. A thread-safe library has a per-thread errno value

Re: [HACKERS] [PATCHES] mcxt.c

2003-09-08 Thread Tom Lane
Greg Stark [EMAIL PROTECTED] writes: Neil Conway [EMAIL PROTECTED] writes: I think the percentage of deployments that enable assertions (which causes a runtime performance hit) but NOT debugging info (which does not) is pretty small. How big a penalty is it? If it's small, or if it could be

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Bruce Momjian
Jeroen Ruigrok/asmodai wrote: -On [20030908 22:42], Bruce Momjian ([EMAIL PROTECTED]) wrote: I assume MODIFY would allow you to alter the constraint without re-checking all the rows, as would be required by DROP/ADD. However, if you are modifying the constraint, wouldn't we have to recheck

Re: [HACKERS] FreeBSD/i386 thread test

2003-09-08 Thread Bruce Momjian
Manfred Spraul wrote: Jeroen Ruigrok/asmodai wrote: -On [20030908 23:52], Peter Eisentraut ([EMAIL PROTECTED]) wrote: Why would FreeBSD have a library of thread-safe libc functions (libc_r) if the functions weren't thread-safe? I think the test is faulty. A thread-safe

Re: [HACKERS] FreeBSD/i386 thread test

2003-09-08 Thread Bruce Momjian
Bruce Momjian wrote: Manfred Spraul wrote: Jeroen Ruigrok/asmodai wrote: -On [20030908 23:52], Peter Eisentraut ([EMAIL PROTECTED]) wrote: Why would FreeBSD have a library of thread-safe libc functions (libc_r) if the functions weren't thread-safe? I think the test is faulty

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: Oh, you bring up two important issues --- one is is the gap in time between the drop and the recreate. This case can be done by doing the query in a transaction --- the lock will exist until the transaction completes, and in fact, you can roll it back

Re: [HACKERS] constraint modification on todo list

2003-09-08 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: I assume MODIFY would allow you to alter the constraint without re-checking all the rows, as would be required by DROP/ADD. However, if you are modifying the constraint, wouldn't we have to recheck all the rows anyway. Yeah.

Re: [HACKERS] [PATCHES] ISO 8601 Time Intervals of the format with time-unit designators

2003-09-08 Thread Ron Mayer
Tom wrote... At this point it should move to pghackers, I think. Background for pghackers first, open issues below... Over on pgpatches we've been discussing ISO syntax for “time intervals” of the “format with time-unit designators”.

Re: [HACKERS] row level lock and table level locks

2003-09-08 Thread Jenny -
TupleTables are just temporary data structures to hold transiently created tuples during execution of a query. There's usually one for each plan node. So, if i have the following transaction: begin work; select * from students where a age=19 for update; lock table studens in share mode; commit;

Re: [HACKERS] row level lock and table level locks

2003-09-08 Thread Tom Lane
Jenny - [EMAIL PROTECTED] writes: TupleTables are just temporary data structures to hold transiently created tuples during execution of a query. There's usually one for each plan node. The TupleTable will exist for the query from the point the query is made untill the transaction is

[HACKERS] Maximum table size

2003-09-08 Thread Bruce Momjian
Is our maximum table size limited by the maximum block number? With our block number maximum of: #define MaxBlockNumber ((BlockNumber) 0xFFFE) 0xFFFE = 4294967294 would the max table size really be (4GB * 8k) or 32 TB, not 16TB, as listed in the FAQ:

Re: [HACKERS] [PATCHES] mcxt.c

2003-09-08 Thread Neil Conway
On Mon, 2003-09-08 at 11:09, Gaetano Mendola wrote: Tom Lane [EMAIL PROTECTED] wrote: I see no value at all in an assert. The code will dump core just fine with or without an assert ... Right but an assert can display information about the file and line number without debug the

Re: [HACKERS] mcxt.c

2003-09-08 Thread Gaetano Mendola
Tom Lane [EMAIL PROTECTED] wrote: Gaetano Mendola [EMAIL PROTECTED] writes: Tom Lane [EMAIL PROTECTED] wrote: This seems inappropriate to me. Are you going to suggest that every routine that takes a pointer parameter needs to explicitly test for null? Of course I'm not suggesting

Re: [HACKERS] Index creation takes for ever

2003-09-08 Thread Zeugswetter Andreas SB SD
I don't think so, because the patch does nothing to keep the sort order once the index is initially created. As Tom mentioned, we might not want to keep the tid's in order after the index is created because he wants the most recent tid's first, so the expired ones migrate to the end.

Re: [HACKERS] Index creation takes for ever

2003-09-08 Thread Manfred Koizar
On Mon, 8 Sep 2003 11:31:05 +0200, Zeugswetter Andreas SB SD [EMAIL PROTECTED] wrote: As Tom mentioned, we might not want to keep the tid's in order after the index is created because he wants the most recent tid's first, so the expired ones migrate to the end. But on average this argument

[HACKERS] plpgsql doesn't coerce boolean expressions to boolean

2003-09-08 Thread Tom Lane
Following up this gripe http://archives.postgresql.org/pgsql-sql/2003-09/msg00044.php I've realized that plpgsql just assumes that the test expression of an IF, WHILE, or EXIT statement is a boolean expression. It doesn't take any measures to ensure this is the case or convert the value if it's

Re: [HACKERS] plpgsql doesn't coerce boolean expressions to boolean

2003-09-08 Thread Andrew Dunstan
Tom Lane wrote: Following up this gripe http://archives.postgresql.org/pgsql-sql/2003-09/msg00044.php I've realized that plpgsql just assumes that the test expression of an IF, WHILE, or EXIT statement is a boolean expression. It doesn't take any measures to ensure this is the case or convert