[HACKERS] [PATCH] ipv6 support for getaddrinfo.c

2006-02-20 Thread R, Rajesh (STSD)



Patch for getaddrinfo.c to recognize ipv6 addresses.Used inet_pton to 
achieve that.On machines that dont have getaddrinfo function, Client 
authenciation failsfor ipv6 addresses if pgsql uses getaddrinfo implemented 
in this.This is a fix for that.Rajesh R--This space 
intentionally left non-blank.


ipv6-getaddrinfo.patch
Description: ipv6-getaddrinfo.patch

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] [GENERAL] [PATCH] Better way to check for getaddrinfo function.

2006-01-24 Thread R, Rajesh (STSD)



Its not a macro.I meant that the code generated by 
AC_REPLACE_FUNCS([getaddrinfo]) by configure.in for "configure"does not have 
"#include netdb.h". Hence function is not detected(unresolved 
getaddrinfo).Hence I thought AC_TRY_LINK could give test program 
instead of AC_REPLACE_FUNCS taking one.$ diff -r configure.in 
configure.in.new918a919 AC_MSG_CHECKING([for 
getaddrinfo])920c921,926 
AC_REPLACE_FUNCS([getaddrinfo])--- AC_TRY_LINK([#include 
netdb.h #include 
assert.h], 
[char (*f)();f=getaddrinfo;], ac_cv_func_getaddrinfo=yes, 
ac_cv_func_getaddrinfo=no) if test x"$ac_cv_func_getaddrinfo" = xyes; 
then AC_DEFINE(HAVE_GETADDRINFO,1,[Define if you have the 
getaddrinfo function]) fi923a930 
AC_MSG_RESULT([$ac_cv_func_getaddrinfo])Regards,Rajesh R--This 
space intentionally left non-blank.-Original 
Message-From: Tom Lane [mailto:[EMAIL PROTECTED]]Sent: Tuesday, 
January 17, 2006 8:34 PMTo: R, Rajesh (STSD)Cc: 
pgsql-hackers@postgresql.orgSubject: Re: [HACKERS] [GENERAL] [PATCH] Better 
way to check for getaddrinfo function."R, Rajesh (STSD)" 
[EMAIL PROTECTED] writes: But the bottomline is the default test 
does not include netdb.h in the test code.That's 
odd. Is getaddrinfo a macro on Tru64? If so, the appropriate patch 
would probably make the test look more like the tests for finite() and 
friends:dnl Cannot use AC_CHECK_FUNC because finite may be a macro 
AC_MSG_CHECKING(for finite) AC_TRY_LINK([ #include math.h double 
glob_double; 
], [return 
finite(glob_double) ? 0 : 
1;], 
[AC_DEFINE(HAVE_FINITE, 1, [Define to 1 if you have finite().]) 
AC_MSG_RESULT(yes)], 
[AC_MSG_RESULT(no)]) 
 
 regards, tom 
lane


Re: [HACKERS] [GENERAL] [PATCH] Better way to check for getaddrinfo function.

2006-01-24 Thread R, Rajesh (STSD)



sorry. It is a macro.so, would it be better to 
check for the macroas suggested by Tom or go with this patch$ diff -r configure.in configure.in.new918a919 
AC_MSG_CHECKING([for getaddrinfo])920c921,926 
AC_REPLACE_FUNCS([getaddrinfo])--- AC_TRY_LINK([#include 
netdb.h #include 
assert.h], 
[char (*f)();f=getaddrinfo;], ac_cv_func_getaddrinfo=yes, 
ac_cv_func_getaddrinfo=no) if test x"$ac_cv_func_getaddrinfo" = xyes; 
then AC_DEFINE(HAVE_GETADDRINFO,1,[Define if you have the 
getaddrinfo function]) fi923a930 
AC_MSG_RESULT([$ac_cv_func_getaddrinfo])
I guess, instead of adding seperate code for macro 
checking as suggested by Tom, this might serve dual purpose.Thanks,Rajesh R--This 
space intentionally left non-blank.-Original 
Message-From: Martijn van Oosterhout [mailto:kleptog@svana.org]Sent: Tuesday, 
January 24, 2006 2:46 PMTo: R, Rajesh (STSD)Cc: Tom Lane; 
pgsql-hackers@postgresql.org; pgsql-general@postgresql.orgSubject: Re: 
[HACKERS] [GENERAL] [PATCH] Better way to check for getaddrinfo 
function.On Tue, Jan 24, 2006 at 02:33:13PM +0530, R, Rajesh (STSD) 
wrote: Its not a macro. I meant that the code generated by 
AC_REPLACE_FUNCS([getaddrinfo]) by configure.in for "configure" 
does not have "#include netdb.h". Hence function is not 
detected(unresolved getaddrinfo). Hence I thought AC_TRY_LINK 
could give test program instead of AC_REPLACE_FUNCS taking 
one.But if it isn't a macro, why do you need the header file? In C it's 
perfectly legal to declare the symbol yourself and try to link and it should 
work *unless* it's normally a macro.We're still missing some necessary 
understanding here...Have a nice day,--Martijn van 
Oosterhout kleptog@svana.org http://svana.org/kleptog/ Patent. 
n. Genius is 5% inspiration and 95% perspiration. A patent is a tool for 
doing 5% of the work and then sitting around waiting for someone else to 
do the other 95% so you can sue them.


[HACKERS] [PATCH] Better way to check for getaddrinfo function.

2006-01-16 Thread R, Rajesh (STSD)
Title: [PATCH] Better way to check for getaddrinfo function.








Just thought that the following patch might improve checking for getaddrinfo function (in configure.in)

I was forced to write 'coz getaddrinfo went unnoticed in Tru64 Unix.


(displaying attached patch)


$ diff -r configure.in configure.in.1

920c920,944

 AC_REPLACE_FUNCS([getaddrinfo])

---

 AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,

 [AC_TRY_LINK([#include netdb.h],

 [struct addrinfo *g,h;g=h;getaddrinfo(,,g,g);],

 AC_TRY_RUN([

 #include assert.h

 #include netdb.h

 #include sys/types.h

 #ifndef AF_INET

 # include sys/socket.h

 #endif

 #ifdef __cplusplus

 extern C

 #endif

 char (*f) ();

 int main(void) {



 f = getaddrinfo;



 return 0;

 }

 ],ac_cv_func_getaddrinfo=yes, ac_cv_func_getaddrinfo=no),

 ac_cv_func_getaddrinfo=no)])

 if test $ac_cv_func_getaddrinfo = yes; then

 AC_DEFINE(HAVE_GETADDRINFO,1,[Define if you have the getaddrinfo function])

 fi




Rajesh R

--

This space intentionally left non-blank. 

 configure-in.patch 





configure-in.patch
Description: configure-in.patch

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] [GENERAL] [PATCH] Better way to check for getaddrinfo function.

2006-01-16 Thread R, Rajesh (STSD)
Title: RE: [GENERAL] [PATCH] Better way to check for getaddrinfo function. 







That was very much situation specific.

But the bottomline is the default test does not include netdb.h in the test code.

So, pg uses getaddrinfo.c.And the getaddrinfo.c does not work for me. 

Ipv6 client authenciation fails.


I have modified the patch.


$ diff -r configure.in configure.in.new

918a919

 AC_MSG_CHECKING([for getaddrinfo])

920c921,926

 AC_REPLACE_FUNCS([getaddrinfo])

---

 AC_TRY_LINK([#include netdb.h #include assert.h],

 [char (*f)();f=getaddrinfo;],

 ac_cv_func_getaddrinfo=yes, ac_cv_func_getaddrinfo=no)

 if test x$ac_cv_func_getaddrinfo = xyes; then

 AC_DEFINE(HAVE_GETADDRINFO,1,[Define if you have the getaddrinfo function])

 fi

923a930

 AC_MSG_RESULT([$ac_cv_func_getaddrinfo])



Rajesh R

--

This space intentionally left non-blank. 


-Original Message-

From: Tom Lane [mailto:[EMAIL PROTECTED]] 

Sent: Monday, January 16, 2006 11:28 PM

To: R, Rajesh (STSD)

Cc: pgsql-hackers@postgresql.org; pgsql-general@postgresql.org

Subject: Re: [GENERAL] [PATCH] Better way to check for getaddrinfo function. 


R, Rajesh (STSD) [EMAIL PROTECTED] writes:

 Just thought that the following patch might improve checking for 

 getaddrinfo function (in configure.in)


Since AC_TRY_RUN tests cannot work in cross-compilation scenarios, you need an *extremely* good reason to put one in. I thought this might improve things doesn't qualify. Exactly what problem are you trying to solve and why is a run-time test necessary? Why doesn't the existing coding work for you?

   regards, tom lane configure-in.patch 





configure-in.patch
Description: configure-in.patch

---(end of broadcast)---
TIP 6: explain analyze is your friend


[HACKERS] Ipv6 and Postgresql 8.0.3

2005-11-28 Thread R, Rajesh (STSD)
 
PLZ REPLY

Hello there,

I run Postgresql 8.0.3 on Tru64 Unix m/c.

I have included the ipv6 auth. line in my pg_hba.conf file(::1/128) I
keep getting error msgs from postmaster everytime I try to connect.

Going by previous posts on the topic am unable to conclude.
Does this mean pg 8.0.3 doesn't support ipv6 client auth. ??
Or is there a patch somewhere ??
Plz reply.Thanks in advance. 

--
Rajesh R

SORRY FOR THE CROSS POST last time.

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


[HACKERS] Ipv6 and Postgresql 8.0.3

2005-11-25 Thread R, Rajesh (STSD)
 
Hello there,

I run Postgresql 8.0.3 on Tru64 Unix m/c.

I have included the ipv6 auth. line in my pg_hba.conf file(::1/128) I
keep getting error msgs from postmaster everytime I try to connect.

Going by previous posts on the topic am unable to conclude.
Does this mean pg 8.0.3 doesn't support ipv6 client auth. ??
Or is there a patch somewhere ??
Plz reply.Thanks in advance. 

--
Rajesh R

SORRY FOR THE CROSS POST last time.

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


[HACKERS] Ipv6 and Postgresql 8.0.3

2005-11-25 Thread R, Rajesh (STSD)
 


Hello there,

I have included the ipv6 auth. line in my pg_hba.conf file(::1/128) I
keep getting error msgs from postmaster everytime I try to connect.

Going by previous posts on the topic am unable to conclude.
Does this mean pg 8.0.3 doesn't support ipv6 client auth. ??
Or is there a patch somewhere ??
Plz reply.Thanks in advance. 

--
Rajesh R

SORRY FOR THE CROSS POST last time.

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] NULL safe equality operator

2005-11-25 Thread R, Rajesh (STSD)
 
Hello there,

I have included the ipv6 auth. line in my pg_hba.conf file(::1/128)
I keep getting error msgs from postmaster everytime I try to
connect.

Going by previous posts on the topic am unable to conclude.
Does this mean pg 8.0.3 doesn't support ipv6 client auth. ??
Or is there a patch somewhere ??
Plz reply.Thanks in advance. 

--
Rajesh R

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] [PERFORM] Query in SQL statement

2005-10-05 Thread R, Rajesh (STSD)

Thanks. 
I've already understood that 
I need to post it in another list.

Sorry for wasting your precious time. 

--
Rajesh R

-Original Message-
From: Richard Huxton [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 05, 2005 2:24 PM
To: R, Rajesh (STSD)
Cc: pgsql-hackers@postgresql.org; pgsql-performance@postgresql.org
Subject: Re: [PERFORM] Query in SQL statement

R, Rajesh (STSD) wrote:
  
 Am trying to port a mysql statement to postgres.
 
 Please help me in finding the error in this,

Can I recommend the reference section of the manuals for this sort of
thing? There is an excellent section detailing the valid SQL for the
CREATE TABLE command.

Also - the pgsql-hackers list is for discussion of database development,
and the performance list is for performance problems. This would be
better posted on pgsql-general or -sql or -novice.

 CREATE SEQUENCE ai_id;

This line is causing the first error:
  ERROR:  relation ai_id already exists

That's because you've already successfully created the sequence, so it
already exists. Either drop it and recreate it, or stop trying to
recreate it.

 CREATE TABLE badusers (
   id int DEFAULT nextval('ai_id') NOT NULL,
   UserName varchar(30),
   Date  datetime DEFAULT '-00-00 00:00:00' NOT NULL,

Well, Date is a type-name, datetime isn't and even if it was
-00-00 isn't a valid date is it?

   Reason varchar(200),
   Admin varchar(30) DEFAULT '-',
   PRIMARY KEY (id),
   KEY UserName (UserName),
   KEY Date (Date)

The word KEY isn't valid here either - are you trying to define an
index? If so, see the CREATE INDEX section of the SQL reference.

http://www.postgresql.org/docs/8.0/static/sql-commands.html

If you reply to this message, please remove the pgsql-hackers CC:
--
   Richard Huxton
   Archonet Ltd

---(end of broadcast)---
TIP 6: explain analyze is your friend


[HACKERS] Query in SQL statement

2005-09-29 Thread R, Rajesh (STSD)
 
Am trying to port a mysql statement to postgres.

Please help me in finding the error in this,


CREATE SEQUENCE ai_id;
CREATE TABLE badusers (
  id int DEFAULT nextval('ai_id') NOT NULL,
  UserName varchar(30),
  Date  datetime DEFAULT '-00-00 00:00:00' NOT NULL,
  Reason varchar(200),
  Admin varchar(30) DEFAULT '-',
  PRIMARY KEY (id),
  KEY UserName (UserName),
  KEY Date (Date)
);


Am always getting foll. Errors,

ERROR:  relation ai_id already exists
ERROR:  syntax error at or near ( at character 240

Thanks,
Rajesh R

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly