[HACKERS] best place for xstrdup

2003-09-16 Thread Mendola Gaetano
As suggested by Bruce Mojiman I'm working on substitute some strdup not checked with xstrdup. I seen that in the backend source tree there is no xstrdup ( there is one in bin/psql tree) , I wrote it and inserted temporarelly in backend/utils/mmgr/aset.c I don't know exactly how work the error

Re: [HACKERS] best place for xstrdup

2003-09-16 Thread Tom Lane
Mendola Gaetano [EMAIL PROTECTED] writes: if ( !ret_value ) { ereport(FATAL, (errcode(ERRCODE_OUT_OF_MEMORY), errmsg(strdup out of memory))); } Should be ERROR not FATAL (the places that are insisting on FATAL

Re: [HACKERS] best place for xstrdup

2003-09-16 Thread Mendola Gaetano
Tom Lane [EMAIL PROTECTED] wrote: Mendola Gaetano [EMAIL PROTECTED] writes: if ( !ret_value ) { ereport(FATAL, (errcode(ERRCODE_OUT_OF_MEMORY), errmsg(strdup out of memory))); } Should be ERROR not FATAL

[HACKERS] New thoughts about indexing cross-type comparisons

2003-09-16 Thread Tom Lane
We've spent much effort trying to solve the int8col = 42 doesn't use an index class of problems. AFAIR, all the recent tries have focused on trying to get the parser to choose an index-compatible operator initially. (In this example, that would mean promoting 42 to int8 so that int8 = int8 would

[HACKERS] FOR$X not work anymore with 7.4beta

2003-09-16 Thread Mendola Gaetano
I discover that the following declaration inside a stored procedure with postgres7.3 was legal: a_variable ALIAS FOR$1; note the missing space after FOR now is not working anymore with 7.4beta I don't know how much people will be affected, may be is good wrote this in the migration note.

[HACKERS] observations about temporary tables and schemas

2003-09-16 Thread Merlin Moncure
Following tests were made in linux server running pg 7.4 beta 2. I have been playing with temporary tables a little bit and noticed some interesting things. I'm not sure if this is a part of the standard canon or not but I thought it worth mentioning. Sorry if I'm bleating out the obvious!

Re: [HACKERS] New thoughts about indexing cross-type comparisons

2003-09-16 Thread Dave Smith
If this is only dealing with constants, why not just explicitly add a cast to the constant of the column type at the planner level. It would solve this problem as well ... create table test (f int2); select * from test where f=cast('1981928928921' as int2); ERROR: pg_atoi: error reading

Re: [HACKERS] observations about temporary tables and schemas

2003-09-16 Thread Tom Lane
Merlin Moncure [EMAIL PROTECTED] writes: The other and more interesting way is to manually jump into the temporary schema (eg. pg_temp_x) that hosts a temp table constructed by another backend. While this is unlikely to happen in a normal setting, the server does allow it. Following this,

Re: [HACKERS] New thoughts about indexing cross-type comparisons

2003-09-16 Thread Tom Lane
Dave Smith [EMAIL PROTECTED] writes: If this is only dealing with constants, why not just explicitly add a cast to the constant of the column type at the planner level. It would solve this problem as well ... create table test (f int2); select * from test where f=cast('1981928928921' as

[HACKERS] Compiling HP-UX 10.20

2003-09-16 Thread tachuelita
I was following an example on a book, and when I compiled it, it finishes with the error: 1075 Function Prototypes are an ANSI feature. What is this?. I compile others programs and I havenĀ“t got such problems. Pls rspnd asap... Regards -- Posted via http://dbforums.com

[HACKERS] (forw) problem with dumping as restoring

2003-09-16 Thread Christian Ruediger Bahls
as suggested by Andreas Pflug [EMAIL PROTECTED] i send this to psql-hackers - Forwarded message from Christian Ruediger Bahls [EMAIL PROTECTED] - Date: Mon, 15 Sep 2003 18:43:17 +0200 Subject: Re: [BUGS] problem with libpq/encrypted To: Tom Lane [EMAIL PROTECTED] hello tom .. .. i am

Re: [HACKERS] observations about temporary tables and schemas

2003-09-16 Thread Merlin Moncure
Tom Lane Tom Lane writes: The SQL spec's notion of temp tables is only tenuously related to ours in the first place :-(. However, the spec appears to require that references to temp tables be unqualified names, so AFAICT it's not expected that applications can reference more than one schema's

Re: [HACKERS] Compiling HP-UX 10.20

2003-09-16 Thread Alvaro Herrera Munoz
On Mon, Sep 15, 2003 at 04:36:10PM -0400, tachuelita wrote: I was following an example on a book, and when I compiled it, it finishes with the error: 1075 Function Prototypes are an ANSI feature. Huh, you need the real compiler from HP. The one bundled with the operating system is apparently

Re: [HACKERS] observations about temporary tables and schemas

2003-09-16 Thread Tom Lane
Merlin Moncure [EMAIL PROTECTED] writes: ... In this case, I think the SQL spec was not thought out very well. Many people think that about a lot of aspects of the spec ;-) I did not see a TODO item regarding global temporary tables...has this been attempted/done? We concluded in the last

Re: [HACKERS] New thoughts about indexing cross-type comparisons

2003-09-16 Thread Dave Smith
My point was that it was inconstant behavour. What exactly are you comparing with int2? To me the case without the cast should should throw the same error as the statement with the cast. Tom Lane wrote: Dave Smith [EMAIL PROTECTED] writes: If this is only dealing with constants, why not just

Re: [HACKERS] Compiling HP-UX 10.20

2003-09-16 Thread Tom Lane
tachuelita [EMAIL PROTECTED] writes: I was following an example on a book, and when I compiled it, it finishes with the error: 1075 Function Prototypes are an ANSI feature. You forgot to use -Ae in the cc command line. HP's compiler has odd ideas about which generation of C programmers use it

Re: [HACKERS] massive quotes?

2003-09-16 Thread Andrew Dunstan
Richard Hall wrote: But if THIS solution is implemented then QUOTE('MyEndMarker') and MyEndMarker become noise words and it seems the parser could just assume to handle everything between CREATE FUNCTION ... AS and LANGUAGE as the delimiters for a function definition. But as that's

Re: [HACKERS] massive quotes?

2003-09-16 Thread Tom Lane
Richard Hall [EMAIL PROTECTED] writes: But if THIS solution is implemented then QUOTE('MyEndMarker') and MyEndMarker become noise words and it seems the parser could just assume to handle everything between CREATE FUNCTION ... AS and LANGUAGE as the delimiters for a

Re: [HACKERS] New thoughts about indexing cross-type comparisons

2003-09-16 Thread Tom Lane
Dave Smith [EMAIL PROTECTED] writes: My point was that it was inconstant behavour. What exactly are you comparing with int2? To me the case without the cast should should throw the same error as the statement with the cast. select * from test where f=1981928928921; I contend not. The

Re: [HACKERS] [BUGS] pg_dump/all doesn't output schemas correctly

2003-09-16 Thread Joshua D. Drake
Hello, I asked my programmers to look into this. They think they have fixed it. I have asked them to provide me a patch. Should I post the patch here? Sincerely, Joshua Drake Bruce Momjian wrote: I can confirm that this bug still exists in current CVS. The problem is that CREATE SCHEMA

Re: [HACKERS] observations about temporary tables and schemas

2003-09-16 Thread Kris Jurka
On Tue, 16 Sep 2003, Merlin Moncure wrote: I have been playing with temporary tables a little bit and noticed some interesting things. Something else I've noticed about temp tables is that you are prohibited from having a permanent table contain a foreign key reference to a temp table, but

[HACKERS] locking for unique hash indexes

2003-09-16 Thread Neil Conway
I'm working on adding support for unique indexes to the hash index code. The majority of the code is finished, with the exception of the changes to locking. My proposed changes are below -- if anyone sees a better way to do things, let me know. There's lots of info on the locking scheme used by

Re: [HACKERS] New thoughts about indexing cross-type comparisons

2003-09-16 Thread Hiroshi Inoue
Tom Lane wrote: (B (B Dave Smith [EMAIL PROTECTED] writes: (B If this is only dealing with constants, why not just explicitly add a (B cast to the constant of the column type at the planner level. It would (B solve this problem as well ... (B (B create table test (f int2); (B select

Re: [HACKERS] Error compiling timestamp.c in 7.4

2003-09-16 Thread Bruno Wolff III
On Tue, Sep 16, 2003 at 00:38:10 -0400, Tom Lane [EMAIL PROTECTED] wrote: I stuck a finger into the dike, but I think some people need to reconsider just how far they want to push Informix compatibility. #define date long is certain to break and keep breaking our code, and doubtless a lot

Re: [HACKERS] [BUGS] pg_dump/all doesn't output schemas correctly

2003-09-16 Thread Tom Lane
Joshua D. Drake [EMAIL PROTECTED] writes: I asked my programmers to look into this. They think they have fixed it. I have asked them to provide me a patch. Should I post the patch here? pgsql-patches is the usual place for patches. I was planning to work on this myself tomorrow, so you