Re: [HACKERS] Explicit psqlrc

2010-03-07 Thread David Christensen
On Mar 7, 2010, at 9:22 AM, Tom Lane wrote: Magnus Hagander writes: 2010/3/6 Tom Lane : The analogy I was thinking about was psql -X, but I agree that it's not obvious why this shouldn't be thought of as an additional -f file. Uh, I don't follow. When we use -f, we'll run the script and

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

2010-03-07 Thread Takahiro Itagaki
Tom Lane wrote: > Takahiro Itagaki writes: > > I'd like to propose to define PGALWAYSEXPORT macro: > > #ifdef WIN32 > > #define PGALWAYSEXPORT __declspec (dllexport) > > #endif > > and modify PG_MODULE_MAGIC and PG_FUNCTION_INFO_V1 to use it > > instead of PGDLLEXPORT. > > This se

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

2010-03-07 Thread Tom Lane
Takahiro Itagaki writes: > I'd like to propose to define PGALWAYSEXPORT macro: > #ifdef WIN32 > #define PGALWAYSEXPORT __declspec (dllexport) > #endif > and modify PG_MODULE_MAGIC and PG_FUNCTION_INFO_V1 to use it > instead of PGDLLEXPORT. This seems like change for the sake of chang

Re: [HACKERS] arithmetic about inet

2010-03-07 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, Mar 08, 2010 at 09:47:00AM +0800, fanng yuan wrote: > I got some point from others.I already red and debug network.c . Now I now > the basic logic behind that. But still I'm confused by arithmetic. I find > some comments on that , I need some o

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

2010-03-07 Thread Takahiro Itagaki
"Kevin Flanagan" wrote: > 1. you have to define the symbol BUILDING_DLL in your code before > including postgres.h No, BUILDING_DLL does not work. We use PGDLLIMPORT both exported global variables and PG_MODULE_MAGIC/PG_FUNCTION_INFO_V1 for now, but actually we should always use __declspec (dll

[HACKERS] arithmetic about inet

2010-03-07 Thread fanng yuan
I got some point from others.I already red and debug network.c . Now I now the basic logic behind that. But still I'm confused by arithmetic. I find some comments on that , I need some one's help. /* * int * bitncmp(l, r, n) * compare bit masks l and r, for n bits. * return: * -1, 1, or 0 in

[HACKERS] ecpg compiler warning about char* comparison

2010-03-07 Thread Takahiro Itagaki
There is a complier warning in ecpg/ecpglib/error.c on HEAD: error.c: In function 'eecpg_raise_backend': error.c:309: warning: comparison with string literal results in unspecified behavior It comes from the following coparison: --- #define ECPG_SQLSTATE_ECPG_INTERNAL_ERROR "YE000" char

Re: [HACKERS] Re: incorrect exit code from psql with single transaction + violation of deferred FK constraint

2010-03-07 Thread Bruce Momjian
BBruce Momjian wrote: > Tom Lane wrote: > > Bruce Momjian writes: > > > The attached patch checks for the proper return from BEGIN/COMMIT, and > > > properly frees the libpq structures. In testing, this does return 3 as > > > you expected. > > > > Really? It looks to me like you'd get exit(1).

Re: [HACKERS] Re: incorrect exit code from psql with single transaction + violation of deferred FK constraint

2010-03-07 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian writes: > > The attached patch checks for the proper return from BEGIN/COMMIT, and > > properly frees the libpq structures. In testing, this does return 3 as > > you expected. > > Really? It looks to me like you'd get exit(1). Maybe that's the right > thing, but

Re: [HACKERS] Re: incorrect exit code from psql with single transaction + violation of deferred FK constraint

2010-03-07 Thread Tom Lane
Bruce Momjian writes: > The attached patch checks for the proper return from BEGIN/COMMIT, and > properly frees the libpq structures. In testing, this does return 3 as > you expected. Really? It looks to me like you'd get exit(1). Maybe that's the right thing, but MainLoop itself seems to retu

Re: [HACKERS] psql with GSS can crash

2010-03-07 Thread Zdenek Kotala
Magnus Hagander píše v po 01. 03. 2010 v 16:55 +0100: > 2010/3/1 Zdenek Kotala : > > Magnus Hagander píše v čt 25. 02. 2010 v 15:17 +0100: > >> On Thu, Feb 25, 2010 at 15:04, Zdenek Kotala wrote: > >> > Hi all, > >> > > >> > I got following stack: > >> > > >> > fd7ffed14b70 strlen () + 40 > >

[HACKERS] Re: incorrect exit code from psql with single transaction + violation of deferred FK constraint

2010-03-07 Thread Bruce Momjian
Dominic, sorry you didn't get any reply to your bug report from October, but it was picked up by Robert Haas in January: http://archives.postgresql.org/pgsql-hackers/2010-01/msg00478.php and is now listed as an outstanding 9.0 bug: http://wiki.postgresql.org/wiki/PostgreSQL_9.0_

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

2010-03-07 Thread Tom Lane
Tim Bunce writes: > I encountered a core dump running PL/Perl installcheck with a very > recent git HEAD of PostgreSQL and a not quite so recent git HEAD of perl. > The cause is a subtle difference between SvTYPE(sv) == SVt_RV and > SvROK(sv). The former is checking a low-level implementation det

Re: [HACKERS] Explicit psqlrc

2010-03-07 Thread Bruce Momjian
Magnus Hagander wrote: > >> Also, "-f -" and just "psql" behaves different today (for example, in > >> the showing of startup banners). > > > > Yes, there would be some things to think about there, which is why it's > > a topic for a new devel cycle rather than something to shoehorn in > > after th

Re: [HACKERS] Explicit psqlrc

2010-03-07 Thread Magnus Hagander
2010/3/7 Tom Lane : > Magnus Hagander writes: >> 2010/3/7 Tom Lane : >>> If we were going to support multiple -f options, it would be sensible >>> to interpret "-f -" as "read from stdin until EOF". > >> Right, that would work. Though it would be a lot more user-unfriendly >> for such a simple thi

Re: [HACKERS] Explicit psqlrc

2010-03-07 Thread Tom Lane
Magnus Hagander writes: > 2010/3/7 Tom Lane : >> If we were going to support multiple -f options, it would be sensible >> to interpret "-f -" as "read from stdin until EOF". > Right, that would work. Though it would be a lot more user-unfriendly > for such a simple thing, IMHO. If the issue had

Re: [HACKERS] Explicit psqlrc

2010-03-07 Thread Magnus Hagander
2010/3/7 Tom Lane : > Magnus Hagander writes: >> 2010/3/6 Tom Lane : >>> The analogy I was thinking about was psql -X, but I agree that it's >>> not obvious why this shouldn't be thought of as an additional -f file. > >> Uh, I don't follow. When we use -f, we'll run the script and then >> exit. Th

Re: [HACKERS] Explicit psqlrc

2010-03-07 Thread Tom Lane
Magnus Hagander writes: > 2010/3/6 Tom Lane : >> The analogy I was thinking about was psql -X, but I agree that it's >> not obvious why this shouldn't be thought of as an additional -f file. > Uh, I don't follow. When we use -f, we'll run the script and then > exit. The whole point is to run it a

Re: [HACKERS] Explicit psqlrc

2010-03-07 Thread Magnus Hagander
2010/3/6 Tom Lane : > Peter Eisentraut writes: >> I can see the environment variable variant as an analogy to BASH_ENV, >> but what is the use case for the --psqlrc option?  Wouldn't it be easier >> and more useful to just be able to process more than one file, say by >> specifying -f more than on