Re: [HACKERS] patch (for 9.1) string functions

2010-03-09 Thread Pavel Stehule
2010/3/9 Merlin Moncure : > On Tue, Mar 9, 2010 at 1:45 PM, Pavel Stehule wrote: >> updated version, concat function doesn't use separator > > btw...very cool stuff.  I took a brief look at the sprintf > implementation.  The main switch: > switch (pdesc.field_type) > > It looks like format codes w

Re: [HACKERS] Re: Hot Standby query cancellation and Streaming Replication integration

2010-03-09 Thread Josh Berkus
All, I've been playing with vacuum_defer_cleanup_age in reference to the query cancel problem. It really seems to me that this is the way forward in terms of dealing with query cancel for normal operation rather than wal_standby_delay, or maybe in combination with it. As a first test, I set up a

Re: [HACKERS] Warning about invalid .pgpass passwords

2010-03-09 Thread Tom Lane
Bruce Momjian writes: > The attached patch reports the fact that .pgpass was used if the libpq > connection fails: The test is in a very inappropriate place --- it will be missed by several fully-supported code paths. > I am not sure if I like the parentheses or not. I don't like 'em. If you d

Re: [HACKERS] Warning about invalid .pgpass passwords

2010-03-09 Thread Fujii Masao
On Wed, Mar 10, 2010 at 11:52 AM, Bruce Momjian wrote: > The attached patch reports the fact that .pgpass was used if the libpq > connection fails: + /* +* If the connection failed, we should mention that +* we got the password from .pgpass in case that +*

[HACKERS] Warning about invalid .pgpass passwords

2010-03-09 Thread Bruce Momjian
Bruce Momjian wrote: > Tom Lane wrote: > > Alvaro Herrera writes: > > > It had to do with me having a bogus password in .pgpass (so psql was > > > first trying empty password, then the one in .pgpass, and both failing). > > > Pilot error. However, I'd say that we ought to give a notice if the > >

Re: [HACKERS] lock mode for ControlFileLock which pg_start_backup uses

2010-03-09 Thread Takahiro Itagaki
Fujii Masao wrote: > Currently pg_start_backup() accesses the shared ControlFile > by using ControlFileLock with LW_EXCLUSIVE lock mode. But > since that access is read-only operation, LW_SHARED should > be chosen instead of LW_EXCLUSIVE. > > The attached patch changes the lock mode which pg_st

Re: [HACKERS] Access violation from palloc, Visual Studio 2005, C-language function

2010-03-09 Thread Tom Lane
"Kevin Flanagan" writes: > Environment: Windows Vista, PostgreSQL 8.4 (1-click installer), Visual > Studio 2005 sp1. > I have a bare-bones DLL built as per the above, compiling the 'add_one' and > 'copytext' samples found at > http://www.postgresql.org/docs/8.4/interactive/xfunc-c.html (version 1

[HACKERS] Access violation from palloc, Visual Studio 2005, C-language function

2010-03-09 Thread Kevin Flanagan
Environment: Windows Vista, PostgreSQL 8.4 (1-click installer), Visual Studio 2005 sp1. I have a bare-bones DLL built as per the above, compiling the 'add_one' and 'copytext' samples found at http://www.postgresql.org/docs/8.4/interactive/xfunc-c.html (version 1 calling convention), compiled as 'C

Re: [HACKERS] Core dump running PL/Perl installcheck with bleadperl [PATCH]

2010-03-09 Thread Tom Lane
Tim Bunce writes: > The attached patch fixes the problem by changing the SvTYPE check to use > SvROK instead. Although I only tripped over one case, the patch changes > all four uses of SvTYPE(sv) == SVt_RV. The remaining uses of SvTYPE are ok. Applied back to 8.0. 7.4 seems not to contain any t

Re: [HACKERS] patch (for 9.1) string functions

2010-03-09 Thread Merlin Moncure
On Tue, Mar 9, 2010 at 1:45 PM, Pavel Stehule wrote: > updated version, concat function doesn't use separator btw...very cool stuff. I took a brief look at the sprintf implementation. The main switch: switch (pdesc.field_type) It looks like format codes we choose not to support (like %p) are s

Re: [HACKERS] Dyamic updates of NEW with pl/pgsql

2010-03-09 Thread Pavel Stehule
2010/3/9 strk : > On Tue, Mar 09, 2010 at 06:59:31PM +0100, Pavel Stehule wrote: >> 2010/3/9 strk : >> > How can a pl/pgsql trigger change the >> > values of dynamic fields in NEW record ? >> > >> > By "dynamic" I mean that the field name >> > is a variable in the trigger context. >> > >> > I've be

Re: [HACKERS] Dyamic updates of NEW with pl/pgsql

2010-03-09 Thread strk
On Tue, Mar 09, 2010 at 06:59:31PM +0100, Pavel Stehule wrote: > 2010/3/9 strk : > > How can a pl/pgsql trigger change the > > values of dynamic fields in NEW record ? > > > > By "dynamic" I mean that the field name > > is a variable in the trigger context. > > > > I've been told it's easy to do wi

Re: [HACKERS] patch (for 9.1) string functions

2010-03-09 Thread Pavel Stehule
updated version, concat function doesn't use separator Pavel 2010/3/9 Pavel Stehule : > 2010/3/9 Merlin Moncure : >> On Tue, Mar 9, 2010 at 9:30 AM, Pavel Stehule >> wrote: >>> postgres=# select concat('ahaha',10,null,current_date, true); >>>         concat >>> >>>  aha

Re: [HACKERS] patch (for 9.1) string functions

2010-03-09 Thread Pavel Stehule
2010/3/9 Merlin Moncure : > On Tue, Mar 9, 2010 at 9:30 AM, Pavel Stehule wrote: >> postgres=# select concat('ahaha',10,null,current_date, true); >>         concat >> >>  ahaha,10,,2010-03-09,t > > why are there commas in the output? > I though so comma can be default sep

Re: [HACKERS] patch (for 9.1) string functions

2010-03-09 Thread Merlin Moncure
On Tue, Mar 9, 2010 at 9:30 AM, Pavel Stehule wrote: > postgres=# select concat('ahaha',10,null,current_date, true); >         concat > >  ahaha,10,,2010-03-09,t why are there commas in the output? merlin -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql

Re: [HACKERS] patch (for 9.1) string functions

2010-03-09 Thread Yeb Havinga
Pavel Stehule wrote: Hello this patch contains a string formatting function "format" Hi Pavel, This is supercool. Haven't tried it out yet but surely will, thanks! Yeb Havinga -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: htt

Re: [HACKERS] Dyamic updates of NEW with pl/pgsql

2010-03-09 Thread Pavel Stehule
2010/3/9 strk : > How can a pl/pgsql trigger change the > values of dynamic fields in NEW record ? > > By "dynamic" I mean that the field name > is a variable in the trigger context. > > I've been told it's easy to do with pl/perl but > I'd like to delive a pl/pgsql solution to have > less dependen

[HACKERS] patch (for 9.1) string functions

2010-03-09 Thread Pavel Stehule
Hello this patch contains a string formatting function "format" postgres=# select format('some message: % (current user: %)', current_date, current_user); format some message: 2010-03-09 (current user: pavel) (1 row) this pat

[HACKERS] Dyamic updates of NEW with pl/pgsql

2010-03-09 Thread strk
How can a pl/pgsql trigger change the values of dynamic fields in NEW record ? By "dynamic" I mean that the field name is a variable in the trigger context. I've been told it's easy to do with pl/perl but I'd like to delive a pl/pgsql solution to have less dependencies. Thanks in advance. --str

Re: [HACKERS] patch (for 9.1) string functions

2010-03-09 Thread Pavel Stehule
2010/3/9 David E. Wheeler : > On Mar 9, 2010, at 6:30 AM, Pavel Stehule wrote: > >> this patch contains a string formatting function "format" >> >> postgres=# select format('some message: % (current user: %)', >> current_date, current_user); >>                     format >>

Re: [HACKERS] patch (for 9.1) string functions

2010-03-09 Thread David E. Wheeler
On Mar 9, 2010, at 6:30 AM, Pavel Stehule wrote: > this patch contains a string formatting function "format" > > postgres=# select format('some message: % (current user: %)', > current_date, current_user); > format > > some mess

Re: [HACKERS] ECPG, two varchars with same name on same line

2010-03-09 Thread Michael Meskes
On Fri, May 01, 2009 at 03:49:47PM +0300, Heikki Linnakangas wrote: > ECPG constructs internal struct names for VARCHAR fields using the > field name and line number it's defined on. In a contrived example, > though, that's not unique. Consider the following example: > ... This should now be fixed

Re: [HACKERS] Re: [COMMITTERS] pgsql: Augment WAL records for btree delete with GetOldestXmin() to

2010-03-09 Thread Simon Riggs
On Tue, 2010-03-09 at 11:20 +0200, Heikki Linnakangas wrote: > Simon Riggs wrote: > > XLOG_BTREE_DELETE records would not carry latestRemovedXid, this would > > be calculated by inspection of heap tuples. > > You might still want to keep the conservative latestRemovedXid value in > the WAL record

Re: [HACKERS] machine-readable pg_controldata?

2010-03-09 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > (FWIW, my recollection of the original design intention for > pg_controldata was that it was meant as a troubleshooting tool if the > database wouldn't start up. I'm somewhat bemused to hear that people > are trying to use it as part of produ

Re: [HACKERS] machine-readable pg_controldata?

2010-03-09 Thread Dimitri Fontaine
Joe Conway writes: > I have not bothered to start a pgfoundry project yet -- thoughts? For the visibility of the project, pgfoundry is still a good idea it seems, even if you still have to register separately for the online catalogue: http://www.postgresql.org/download/products/1 Now, AFAIUI,

Re: [HACKERS] lock mode for ControlFileLock which pg_start_backup uses

2010-03-09 Thread Heikki Linnakangas
Takahiro Itagaki wrote: > Fujii Masao wrote: >> The attached patch changes the lock mode which pg_start_backup() >> uses. Is it worth applying this patch? > > I think the patch is reasonable to represent what we are doing, > even if there is no performance benefits from it. Agreed. -- Heikki

Re: [HACKERS] Re: [COMMITTERS] pgsql: Augment WAL records for btree delete with GetOldestXmin() to

2010-03-09 Thread Heikki Linnakangas
Simon Riggs wrote: > XLOG_BTREE_DELETE records would not carry latestRemovedXid, this would > be calculated by inspection of heap tuples. You might still want to keep the conservative latestRemovedXid value in the WAL record to avoid the extra work when latestRemovedXid alone allows. -- Heikki

Re: [HACKERS] Re: [COMMITTERS] pgsql: Augment WAL records for btree delete with GetOldestXmin() to

2010-03-09 Thread Simon Riggs
On Sun, 2010-01-31 at 16:53 -0500, Tom Lane wrote: > Heikki Linnakangas writes: > > IIRC it was Greg Stark who suggested last time this was discussed that > > we could calculate the exact value for latestRemovedXid in the standby. > > When replaying the deletion record, the standby could look at a

Re: [HACKERS] Visual Studio 2005, C-language function - avoiding hacks?

2010-03-09 Thread Magnus Hagander
2010/3/9 Takahiro Itagaki : > > Magnus Hagander wrote: > >> >> The existing mechanism >> >> works (as demonstrated by the fact that the contrib modules work on >> >> Windows). >> > >> > Did we use non-standard tools except msvc in the build framework >> > for core code? And what should I do for an