Re: [HACKERS] Custom Data Type Question

2006-11-16 Thread Greg Mitchell
A simpler way to do this might be to only cache the list per query context. In your IO functions, you could whack a pointer to your cache onto fcinfo-flinfo-fn_extra, and the same flinfo gets passed in for e.g. all output function calls for that column for that query, IIRC. This was what I had

Re: [HACKERS] Segmentation fault with HEAD.

2006-11-16 Thread Tom Lane
Rune Bromer [EMAIL PROTECTED] writes: It sure is, but it seems to work now. It could be that the error isn't persistant on a MacBook Pro as these have a x86 arch. Exactly which version of readline (or, perhaps, libedit) are you using? regards, tom lane

Re: [HACKERS] Custom Data Type Question

2006-11-16 Thread Greg Mitchell
As far as memory management goes, do I just use hash_create() and assign that pointer to fn_extra and at the end of the query it will be freed? Or will it not be freed until this end of the transaction? I'm really having trouble understanding the memory management issues with Postgres. Greg

Re: [HACKERS] Custom Data Type Question

2006-11-16 Thread Andrew Dunstan
Greg Mitchell wrote: Also, are there any ADTs like a hash-map or tree-map in the server libraries (my background is C++ and am use to having std::map) or do I need to role my own? Look at the dynahash code. I just used it for the first time in a plperl patch, and it's reasonably

Re: [HACKERS] Custom Data Type Question

2006-11-16 Thread Tom Lane
Greg Mitchell [EMAIL PROTECTED] writes: As far as memory management goes, do I just use hash_create() and assign that pointer to fn_extra and at the end of the query it will be freed? Or will it not be freed until this end of the transaction? I'm really having trouble understanding the

[HACKERS] # of tuples on a Table?

2006-11-16 Thread luis garcia
Hi I've been making some changes to Postgres insertion method (InsertStmt) and I'm trying to find out how much tuples are stored in one specific table before the insertion of the next tuple, because of that will depend the exact insertion method that I will use... I just really wanna know if

Re: [HACKERS] [GENERAL] Not your father's question about deadlocks

2006-11-16 Thread Tom Lane
Clarence Gardner [EMAIL PROTECTED] writes: That scenario seems quite simple, but I can't reproduce the deadlock with this seemingly-identical sequence. This is a bug in 8.1 and up. The reason you couldn't reproduce it is that it requires a minimum of three transactions involved, two of which

Re: [HACKERS] [GENERAL] Not your father's question about deadlocks

2006-11-16 Thread Gurjeet Singh
On 11/17/06, Tom Lane [EMAIL PROTECTED] wrote: we need a special case when we are already a member of the MultiXact: fall through without trying to reacquire the tuple lock. Small implementation detail: Also keep a count of how many times the same session requested the same lock, and do not

Re: [HACKERS] [GENERAL] Not your father's question about deadlocks

2006-11-16 Thread Tom Lane
Gurjeet Singh [EMAIL PROTECTED] writes: On 11/17/06, Tom Lane [EMAIL PROTECTED] wrote: we need a special case when we are already a member of the MultiXact: fall through without trying to reacquire the tuple lock. Small implementation detail: Also keep a count of how many times the same

Re: [HACKERS] [GENERAL] Not your father's question about deadlocks

2006-11-16 Thread Gurjeet Singh
On 11/17/06, Tom Lane [EMAIL PROTECTED] wrote: Gurjeet Singh [EMAIL PROTECTED] writes: Small implementation detail: Also keep a count of how many times the same session requested the same lock, and do not release the lock until he requests same number of releases. No need for that, because

[HACKERS] A suggestion on PG_TRY() exception handling code.

2006-11-16 Thread Gurjeet Singh
Hi hackers, The current usage PG_TRY() looks something like this: ... normal code ... PG_TRY(); { ... code that might throw ereport(ERROR) ... } PG_CATCH(); { ... error recovery code ... ... plus anything that you wish to do even if an error wasn't

Re: [HACKERS] A suggestion on PG_TRY() exception handling code.

2006-11-16 Thread Tom Lane
Gurjeet Singh [EMAIL PROTECTED] writes: I propose a new constuct, PG_FINALLY. I took a look through the existing uses of PG_CATCH, and found that in the places where there is duplicate code between the normal and error exits, it's usually just one or two lines. Where it's more than that, it's

Re: [HACKERS] [PATCHES] replication docs: split single vs. multi-master

2006-11-16 Thread Bruce Momjian
Markus Schiltknecht wrote: Not mentioning that categorization doesn't help in clearing the confusion. Just look around, most people use these terms. They're used by MySQL and Oracle. Even Microsofts ActiveDirectory seems to have a multi-master operation mode. OK. For example, Slony is

[HACKERS] ALTER TABLE RENAME column

2006-11-16 Thread Jim Nasby
Any reason not to support renaming columns? Can this be added to TODO? patch Description: Binary data -- Jim Nasby[EMAIL PROTECTED] EnterpriseDB http://enterprisedb.com 512.569.9461 (cell) ---(end of

Re: [HACKERS] ALTER TABLE RENAME column

2006-11-16 Thread Tom Lane
Jim Nasby [EMAIL PROTECTED] writes: Any reason not to support renaming columns? Can this be added to TODO? Uh, we did that years ago. regards, tom lane ---(end of broadcast)--- TIP 5: don't forget to increase your free

Re: [HACKERS] zic data updates

2006-11-16 Thread Bruce Momjian
Tom Lane wrote: Joachim Wieland [EMAIL PROTECTED] writes: Current beta seems to have the 2006k version of the zic database. The current zic database is version 2006n however. Since this update does not include source code but just data files I would vote to do the update in beta, what

Re: [HACKERS] ALTER TABLE RENAME column

2006-11-16 Thread Peter Eisentraut
Jim Nasby wrote: Any reason not to support renaming columns? Can this be added to TODO? Upgrade to Postgres95. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [HACKERS] [PATCHES] Cast null to int4 upgrading from Version 7.2

2006-11-16 Thread Peter Eisentraut
Jim Nasby wrote: As a less invasive alternative, I *think* you could create an SQL function for casting text to int that treated '' as 0, and then replace the built-in CAST with that. Won't work. You need to replace the data type input function. -- Peter Eisentraut

Re: [HACKERS] [PATCHES] replication docs: split single vs.

2006-11-16 Thread Hannu Krosing
Ühel kenal päeval, R, 2006-11-17 kell 00:01, kirjutas Bruce Momjian: Markus Schiltknecht wrote: Not mentioning that categorization doesn't help in clearing the confusion. Just look around, most people use these terms. They're used by MySQL and Oracle. Even Microsofts ActiveDirectory seems

Re: [HACKERS] [PATCHES] replication docs: split single vs.

2006-11-16 Thread Hannu Krosing
Ühel kenal päeval, R, 2006-11-17 kell 00:01, kirjutas Bruce Momjian: Current version at: http://momjian.us/main/writings/pgsql/sgml/failover.html it refers to Warm Standby Using Point-In-Time Recovery (http://momjian.us/main/writings/pgsql/sgml/warm-standby.html), maybe its a good