Re: [HACKERS] How to allocate a global variable (to implement virutal databases)

2006-04-29 Thread Juan Manuel Diaz Lara
Thanks, but from the vail site "windows sorry"... I am working in windows.     I was thinking in a simply implementation, with only global variables used with the rule system.     I can write the c code for this.Tom Lane <[EMAIL PROTECTED]> wrote:  Juan Manuel Diaz Lara <[EMAIL PROTECTED]>writes:> I would like to implement a row-level security for> application-level-user (the user is not a postgresql user),Have you looked at Veil?http://veil.projects.postgresql.org/regards, tom laneAtte.Juan Manuel Díaz Lara
		Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.

[HACKERS] How to allocate a global variable (to implement virutal databases)

2006-04-29 Thread Juan Manuel Diaz Lara
I would like to implement a row-level security for application-level-user (the user is not a postgresql user), I wish to restrict access to rows in diferent tables based on this application-level-user. My idea is to use rules to rewrite queries based on the contents of a global variable that is set with the application-level-userid, to this end I like to set the variabale at connection-time only, and aplied to all queris by the rewrite rules.      I think I can write a c-function but I do not know the correct way to allocate memory with session duration, maybe simply with alloc (o should I use palloc?).     Or is there a solution I do not know about?     Thanks.Atte.Juan Manuel Díaz Lara
		Blab-away for as little as 1¢/min. Make  PC-to-Phone Calls using Yahoo! Messenger with Voice.

[HACKERS] Problem compiling from cvs, mingw

2006-04-14 Thread Juan Manuel Diaz Lara
I get the following error:     gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -fno-strict-aliasing -I. -I../../../src/include -I./src/include/port/win32 -DEXEC_BACKEND  "-I../../../src/include/port/win32" -DBUILDING_DLL  -c -o bootparse.o bootparse.cbootparse.y:101:10: "b4_file_name" is not a valid filenamemake[3]: *** [bootparse.o] Error 1make[3]: Leaving directory `/pgsql/src/backend/bootstrap'make[2]: *** [bootstrap-recursive] Error 2make[2]: Leaving directory `/pgsql/src/backend'make[1]: *** [all] Error 2make[1]: Leaving directory `/pgsql/src'make: *** [all] Error 2  I have installed flex 2.5.4 y bison 2.1.     The configure scripts pass correctly the tests for flex and bison.     The problem seems to como from src/backend/bootstrap/bootparse.c with I suposse works with bison, but I do not know how. 
    Thanks for any help.   Atte.Juan Manuel Díaz Lara
		How low will we go? Check out Yahoo! Messenger’s low  PC-to-Phone call rates.

[HACKERS] How to implement oracle like rownum(function or seudocolumn) ?

2006-04-08 Thread Juan Manuel Diaz Lara
I need a rownum column, like Oracle. I have searched the mailing lists and I don't see a satisfactory solution, so I was wondering write a UDF to implement it, the requirements are:     1. Need to preserve state between calls to the function (the rowcount). Maybe using a MemoryContext with a lifespan equal to the executing query.  2. It should be called every time a new row is produced.  3. And more important, need to be called in the right place when called from subquerys:     Imagine one to man relationship between table A and tabla B. Then next query     SELECT s.id, s.rownum   FROM (SELECT a.id, rownum() AS rownum  FROM a) s,     b  WHERE a.id = b.id     In this
 case, the rownum function should behave as if it was an aggregated function, where the subquery is evaluated first and the results joined with table b. I think that a UDF could be evaluated last by the planner (when producing the final resultset) so it won't give the intended result.     I looking for a general solution, Any ideas? .     Thanks.         Atte.Juan Manuel Díaz Lara
		New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.

[HACKERS] Rigth toolset to compile under mingw?

2006-04-05 Thread Juan Manuel Diaz Lara
I have tried to compile 8.1.3 with mingw but I am receiving come errors, I do not know with versions are the correct one.     Could some body tell me the right versions ? and url's to download from ? please. I searched the mainling lists but it is not clear.     Thanks.Atte.Juan Manuel Díaz Lara
		New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.

[HACKERS] Problem compiling with mingw

2006-04-01 Thread Juan Manuel Diaz Lara
I run configure (no complains about bison o flex), after a few seconds I receive the next errors:     make[4]: Leaving directory `/pgsql/src/backend/access/nbtree'make -C transam SUBSYS.omake[4]: Entering directory `/pgsql/src/backend/access/transam'make[4]: `SUBSYS.o' is up to date.make[4]: Leaving directory `/pgsql/src/backend/access/transam'make[3]: Leaving directory `/pgsql/src/backend/access'make -C bootstrap allmake[3]: Entering directory `/pgsql/src/backend/bootstrap'gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -fno-strict-aliasing -I. -I../../../src/include -I./src/include/port/win32 -DEXEC_BACKEND  "-I../../../src/include/port/win32" -DBUILDING_DLL  -c -o bootparse.o bootparse.cbootparse.y:101:10: "b4_file_name" is not a valid filenamemake[3]: *** [bootparse.o] Error 1make[3]: Leaving directory `/pgsql/src/backend/bootstrap'make[2]: *** [bootstrap-recursive]
 Error 2make[2]: Leaving directory `/pgsql/src/backend'make[1]: *** [all] Error 2make[1]: Leaving directory `/pgsql/src'make: *** [all] Error 2     My enviroment, installed in that order:     MSYS-1.0.8.exe  --> d:\msys  inGW-3.1.0-1.exe  --> d:\msys\mingw  msysDTK-1.0.1.exe -> d:\msys  bison-2.1.exe --> d:\gnuwin32  flex-2.5.4a-1.exe --> d:\gnuwin32     fstab  --  #Win32_Path  Mount_Point#c:/mingw  /mingw#c:/ActiveState/perl /perld:/gnuwin32  /gnuwin32   profile  ---  ...  if [ $MSYSTEM == MINGW32 ]; then  export PATH=".:/usr/local/bin:/mingw/bin:/bin:/gnuwin32/bin:$PATH"else  export PATH=".:/usr/local/bin:/bin:/mingw/bin:/gnuwin32/bin:$PATH"fi 
 ...     S.O. : Windows 2003 server     Can any body help ? Thanks in advance.               Atte.Juan Manuel Díaz Lara
		New Yahoo! Messenger with Voice. Call regular phones from your PC for low, low rates.