[HACKERS] PQexecPrepared with cursor to fetch single results

2008-04-28 Thread Maurizio Oristanio
if you need a scrollable cursor for a prepared statement (to fetch
single rows from huge result sets)
while still being able to execute statements on the same connection
you can do it this way:

PGresult* res = PQprepare( con, statement1, declare cu1 scroll
cursor with hold for select * from table where col1=$1, 0, NULL );
PGresult* res2 = PQdescribePrepared( con, statement1 );
//now use PQnparams and PQnparamtype to determine parameter
information
//and set paramCount, paramValues and paramLength accordingly
PGresult* res3 = PQexecPrepared( con, statement1, paramCount,
paramValues, paramLength, paramFormat, 0 );
PGresult* res4 = PQexec( con, fetch forward 100 from cu1 ); //to
receive 100 rows from the server
//now with PQnfields, PQftype and PQfname and PQgetvalue access the
result - and other queries can be executed on the same connection


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] Error in compiling pgcrypto module in Win32

2004-08-29 Thread Maurizio Merli
I'm using PostgreSQL 8.0.0 beta1
I can compile all contrib modules but pgcrypton
i have this error  when I execute make



md5.o(.text+0x1ee):md5.c: undefined reference to `bcopy'
md5.o(.text+0x25c):md5.c: undefined reference to `bcopy'
md5.o(.text+0x2ae):md5.c: undefined reference to `bcopy'
md5.o(.text+0x2c1):md5.c: undefined reference to `bcopy'
md5.o(.text+0x2e6):md5.c: undefined reference to `bcopy'
md5.o(.text+0x301):md5.c: more undefined references to `bcopy' follow
crypt-des.o(.text+0x520):crypt-des.c: undefined reference to [EMAIL PROTECTED]'
crypt-des.o(.text+0x52b):crypt-des.c: undefined reference to [EMAIL PROTECTED]'
crypt-des.o(.text+0xb92):crypt-des.c: undefined reference to [EMAIL PROTECTED]'
crypt-des.o(.text+0xb9d):crypt-des.c: undefined reference to [EMAIL PROTECTED]'
crypt-des.o(.text+0xbbe):crypt-des.c: undefined reference to [EMAIL PROTECTED]'
crypt-des.o(.text+0xbca):crypt-des.c: undefined reference to [EMAIL PROTECTED]'
c:\MinGW\bin\dllwrap.exe: c:\MinGW\bin\gcc exited with status 1
make: *** [libpgcrypto.a] Error 1


What can i do? 



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


[HACKERS] php-psql lock problem. Thanks!

2001-10-14 Thread Maurizio Ortolan

Hello to everybody!

I've a little problem with LOCK-ing a
certain row in a table using PHP and
PostgreSQL on LINUX.

  In a few words, I'd like to undertand
  how find out if a certain row is locked,
  in order to prevent a kind of deadlock.

Which is the (system) table where all
locked row or tables are 'saved' ?
Is there any flag?

// 
Example 1:

User A:

BEGIN WORK;
select login from people where userid='1' for update;
[ ... ]
COMMIT WORK;

User B:
BEGIN WORK;
(***)
select login from people where userid='1' for update;

[ WAIT UNTIL 'COMMIT WORK' of user A  !  :(  ]

COMMIT WORK;

Solution:
I'd like to put in (***) a quick check in order to
know if the row with userid='1' is already locked or not.

In this way, if it's already locked, I'll use
select login from people where userid='1';
  [ ONLY READ ]
instead of
select login from people where userid='1' for update;
  [READ  WRITE]

// 
Example 2:

BEGIN WORK;
LOCK TABLE utenti IN SHARE ROW EXCLUSIVE MODE;
select login from people where userid='1';
COMMIT WORK;

// 


Many thanks to everybody!
Ciao!
MaURIZIO

[EMAIL PROTECTED]


It's sure that
  a small example in PHP will very very appreciated!! :))


PS: it's possible to setup a timeout for a locked table,
 in order to exec an aoutomatic ROLLBACK ??
 (for examples if the user goes away?

***
**  Happy surfing on THE NET !!  **
**   Ciao by   **
**   C R I X 98  **
***
AntiSpam: rimuovere il trattino basso
 dall'indirizzo  per scrivermi...
(delete the underscore from the e-mail address to reply)


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

http://archives.postgresql.org



Fw: [HACKERS] QNX : POSSIBLE BUG IN CONFIGURE ?

2001-04-07 Thread Maurizio

I searched for the error and I have found :

when I execute psql template0
the SIGSEGV is generated when postinit calls RelationPhaseInitializePhase2
in heap_openr with RelationName = pg_am at the return r I have the error.

when I execute psql template1
the SIGSEGV is generated when postinit calls RelationPhaseInitializePhase2
in heap_openr with RelationName = pg_class at the return r I have the error.

I can't understand whats happen.

Could someone help me ?

Thanks

Maurizio Cauci


.
- Original Message -
From: "Maurizio" [EMAIL PROTECTED]
To: "Peter Eisentraut" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, April 03, 2001 6:31 PM
Subject: Re: [HACKERS] QNX : POSSIBLE BUG IN CONFIGURE ?


 OK,
 I compiled postgresql RC2. I have not error nor warnings so I hope it's
all
 right.
 I also changed something in os.h -- port/qnx4.h
 and in s_lock.c

 I will post the changes until the end of the week.

 I executed initdb and all works fine.
 I executed postmaster and the proces run OK.

 When I run psql template0 I have an error. I am not expert walking throu
 postgresql sources.
 could You tell me  if there some change from beta 6 to RC1 or RC2 that can
 give this problem in QNX so I can try to check all?

 Attached is the server.log file with the SIGSEGV.

 Thanks

 - Original Message -
 From: "Peter Eisentraut" [EMAIL PROTECTED]
 To: "Maurizio" [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Monday, April 02, 2001 6:38 PM
 Subject: Re: [HACKERS] QNX : POSSIBLE BUG IN CONFIGURE ?


  Maurizio writes:
 
   the problem is :
  
   when I execute configure it recognize the executable suffix as .map
   and this is not right. And the test program fails.
 
  This is a known (to me) bug in Autoconf.  Maybe there's a way to prevent
  the .map files to be generated?  Fixing this isn't too hard, but I don't
  feel urgent about it when there are more problems with the QNX port
still
  down the line.
 
  --
  Peter Eisentraut  [EMAIL PROTECTED]   http://yi.org/peter-e/
 
 
  ---(end of broadcast)---
  TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]








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



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

http://www.postgresql.org/search.mpl



Re: [HACKERS] QNX : POSSIBLE BUG IN CONFIGURE ?

2001-04-03 Thread Maurizio

OK,
I compiled postgresql RC2. I have not error nor warnings so I hope it's all
right.
I also changed something in os.h -- port/qnx4.h
and in s_lock.c

I will post the changes until the end of the week.

I executed initdb and all works fine.
I executed postmaster and the proces run OK.

When I run psql template0 I have an error. I am not expert walking throu
postgresql sources.
could You tell me  if there some change from beta 6 to RC1 or RC2 that can
give this problem in QNX so I can try to check all?

Attached is the server.log file with the SIGSEGV.

Thanks

- Original Message -
From: "Peter Eisentraut" [EMAIL PROTECTED]
To: "Maurizio" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, April 02, 2001 6:38 PM
Subject: Re: [HACKERS] QNX : POSSIBLE BUG IN CONFIGURE ?


 Maurizio writes:

  the problem is :
 
  when I execute configure it recognize the executable suffix as .map
  and this is not right. And the test program fails.

 This is a known (to me) bug in Autoconf.  Maybe there's a way to prevent
 the .map files to be generated?  Fixing this isn't too hard, but I don't
 feel urgent about it when there are more problems with the QNX port still
 down the line.

 --
 Peter Eisentraut  [EMAIL PROTECTED]   http://yi.org/peter-e/


 ---(end of broadcast)---
 TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

 Server.log


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



[HACKERS] QNX : POSSIBLE BUG IN CONFIGURE ?

2001-04-02 Thread Maurizio



Hi all

As I posted few days ago I started checking 
postgresql 7.1RC1 in QNX 4.25. The last I checked was 7.1b3.

the problem is :

whenI execute configure it recognize the 
executable suffix as .map and this is not right. And the test program 
fails.
If I try the same in 7.1b3 all works 
good.

Then I tried to modify configure : 
line 1472
*.c | *.o | *.obj | *.map) 
;;   // I added 
*.map

With this all works. I can compile but when I run 
initdb it crashes. this is the output file
---
Running with debug mode 
on.Initdb variables: 
PGDATA=/usr/local/pgsql/data1 
datadir=/usr/local/pgsql/share 
PGPATH=//1/usr/local/pgsql/bin 
TEMPFILE=/tmp/initdb.25146 
MULTIBYTE= 
MULTIBYTEID=0 
POSTGRES_SUPERUSERNAME=maurizio 
POSTGRES_SUPERUSERID=100 
TEMPLATE1_BKI=/usr/local/pgsql/share/template1.bki 
GLOBAL_BKI=/usr/local/pgsql/share/global.bki 
TEMPLATE1_DESCR=/usr/local/pgsql/share/template1.description 
GLOBAL_DESCR=/usr/local/pgsql/share/global.description 
POSTGRESQL_CONF_SAMPLE=/usr/local/pgsql/share/postgresql.conf.sample 
PG_HBA_SAMPLE=/usr/local/pgsql/share/pg_hba.conf.sample 
PG_IDENT_SAMPLE=/usr/local/pgsql/share/pg_ident.conf.sampleThis 
database system will be initialized with username "maurizio".This user will 
own all the data files and must also own the server process.Creating 
directory /usr/local/pgsql/data1Creating directory 
/usr/local/pgsql/data1/baseCreating directory 
/usr/local/pgsql/data1/globalCreating directory 
/usr/local/pgsql/data1/pg_xlogCreating template1 database in 
/usr/local/pgsql/data1/base/1Running: //1/usr/local/pgsql/bin/postgres -boot 
-x1 -C -F -D/usr/local/pgsql/data1 -d template1DEBUG: database system was shut down at 
2001-04-02 10:59:31 cestDEBUG: 
CheckPoint record at (0, 8)DEBUG: Redo record at (0, 8); Undo record at 
(0, 8); Shutdown TRUEDEBUG: 
NextTransactionId: 514; NextOid: 16384DEBUG: database system is in production 
stateproname name proowner int4 prolang oid 
proisinh bool proistrusted bool proiscachable 
bool proisstrict bool pronargs int2 
proretset bool prorettype oid proargtypes 
oidvector probyte_pct int4 properbyte_cpu int4 
propercall_cpu int4 prooutin_ratio int4 prosrc 
text probin bytea  creating bootstrap 
relationbootstrap relation created ok Commit Endtuple 
1242Inserting value: 'boolin'Typ == NULL, typeindex = 3 idx = 
0boolin End InsertValueInserting value: '100'Typ == NULL, typeindex 
= 6 idx = 1100 End InsertValueInserting value: '12'Typ == NULL, 
typeindex = 9 idx = 212 End InsertValueInserting value: 'f'Typ == 
NULL, typeindex = 0 idx = 3f End InsertValueInserting value: 't'Typ 
== NULL, typeindex = 0 idx = 4t End InsertValueInserting value: 
't'Typ == NULL, typeindex = 0 idx = 5t End InsertValueInserting 
value: 't'Typ == NULL, typeindex = 0 idx = 6t End 
InsertValueInserting value: '1'Typ == NULL, typeindex = 4 idx = 71 
End InsertValueInserting value: 'f'Typ == NULL, typeindex = 0 idx = 
8f End InsertValueInserting value: '16'Typ == NULL, typeindex = 9 
idx = 916 End InsertValueInserting value: '0'Typ == NULL, typeindex 
= 13 idx = 10End 
InsertValueInserting value: '100'Typ == NULL, typeindex = 6 idx = 
11100 End InsertValueInserting value: '0'Typ == NULL, typeindex = 6 
idx = 120 End InsertValueInserting value: '0'Typ == NULL, typeindex 
= 6 idx = 130 End InsertValueInserting value: '100'Typ == NULL, 
typeindex = 6 idx = 14100 End InsertValueInserting value: 
'boolin'Typ == NULL, typeindex = 8 idx = 15boolin End 
InsertValueInserting value: '-'Typ == NULL, typeindex = 1 idx = 16- 
End InsertValueInsert BeginInsertOneTuple oid 1242, 17 
attrs-


I don't know how configure works 
but from 7.1b3 to 7.1RC1 something was changed in it and I think this is the 
problem in QNX.

I also checked my coimpiler but I 
can compile all but the last postgresql version.


Could You help me ?

Thanks.

Maurizio CauciDREAMTECH di Cauci 
MaurizioVia Ronchetti, 2 - 21013 Gallarate (VA)www.dreamtech-it.com


[HACKERS] testing last sanpshot in QNX platform

2001-03-30 Thread Maurizio




hi,

Sorry if you receive this message again. I just sent it yesterday 
with attached the config file but probably was too large.

I come back in office after a long period out for 
work.
Yesterday I have downloaded the last 
snapshot.

When I execute configure I have an error compiling 
conftest.
Seems that non found some librarys but in the 
previus lines (when execute the check write yes)

The last version I have checked was 7.1 b3 and all 
works fine.

This is only the last few linesof the 
config.log file.
-

configure:6840: checking test 
programconfigure:6849: gcc -o conftest.map conftest.c -lz 
-lunix -lresolv -lPW -lgen -lBSD -lcompat -lld -ldld -llc -lIPC -lipc -lnsl 
-lsocket -ldl -lm -lbsd -lsfio -lunix 15cc warning: cc: cannot find 
library 'resolv'cc warning: cc: cannot find library 'PW'cc warning: cc: 
cannot find library 'gen'cc warning: cc: cannot find library 'BSD'cc 
warning: cc: cannot find library 'compat'cc warning: cc: cannot find library 
'ld'cc warning: cc: cannot find library 'dld'cc warning: cc: cannot find 
library 'lc'cc warning: cc: cannot find library 'IPC'cc warning: cc: 
cannot find library 'ipc'cc warning: cc: cannot find library 'nsl'cc 
warning: cc: cannot find library 'dl'cc warning: cc: cannot find library 
'bsd'cc warning: cc: cannot find library 'sfio'cc warning: cc: cannot 
find library 'resolv'cc warning: cc: cannot find library 'PW'cc warning: 
cc: cannot find library 'gen'cc warning: cc: cannot find library 'BSD'cc 
warning: cc: cannot find library 'compat'cc warning: cc: cannot find library 
'ld'cc warning: cc: cannot find library 'dld'cc warning: cc: cannot find 
library 'lc'cc warning: cc: cannot find library 'IPC'cc warning: cc: 
cannot find library 'ipc'cc warning: cc: cannot find library 'nsl'cc 
warning: cc: cannot find library 'dl'cc warning: cc: cannot find library 
'bsd'cc warning: cc: cannot find library 'sfio'configure: failed program 
was:#line 6845 "configure"#include "confdefs.h"int main() { return 
0; }
-
Has someone any suggestion ?

Thanks


Maurizio CauciDREAMTECH di Cauci 
MaurizioVia Ronchetti, 2 - 21013 Gallarate (VA)www.dreamtech-it.com


[HACKERS] testing last sanpshot in QNX platform

2001-03-30 Thread Maurizio



hi,

I come back in office after a long period out for 
work.
Yesterday I have downloaded the last 
snapshot.

When I execute configure I have an error compiling 
conftest.
The last version I have checked was 7.1 b3 and all 
works fine.

Attached is the config.log file.
Has someone any suggestion ?

Thanks



Maurizio CauciDREAMTECH di Cauci 
MaurizioVia Ronchetti, 2 - 21013 Gallarate (VA)www.dreamtech-it.com
 Config.log


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



[HACKERS] Error in the date field (with NULL value...).Thanks!

2001-03-30 Thread Maurizio Ortolan

Subject: Importing data from Informix to PostgreSQL.
  Error in the date field (WITH NULL value)

Hello!
I'll try to explain my little problem. Well, I have this table

create table  mytable
   ( codice char(16) not null,
 dt_inizio  date,
 dt_finedate,
 tipo_operazione char(1),
 causa_operazione integer
   );

ok!

I find out that pgsql:

In my example '' is the NULL value exported from Informix... !  (an ASCII file)

INFORMIX   PostgreSQL
char(16)   ''  --   blank 
string (I think it's   ok! )
char(1)''   --   blank 
string (I think it's ok)
integer''   -- 0  (is 
it an error? )
date   ''--  ERROR!  Bad date 
external representation ''


  select * from mytable ;

codice | dt_inizio   | dt_fine | 
tipo_operazione | causa_operazione

  ABCEDEF | 
2001-03-28  | |   |0
  XXXYYYAAA23C957Y | 
2001-03-28  | |  |0


clinica=# insert into mytable values ( '','03/28/2001', '' , '' , ''  );
ERROR:  Bad date external representation ''   ^^^

PostgreSQL doesn't want '' as an input of a date with NULL value:
it's necessary to use this kind of insert:

  insert into mytable values ( '','03/28/2001',null,'','');
 ^^

Now there is a new line in the table:

   | 
2001-03-28  | |  |0


My question:
How can I resolv my problem?  I have a big data file to import where
in the 2nd date field there is '' instead of  null 

How can I "binds" PostgreSQL to consider '' as null ?

Many thanks for any suggestions!

CIAO!
MAURIZIO

***
**  Happy surfing on THE NET !!  **
**   Ciao by   **
**   C R I X 98  **
***
AntiSpam: rimuovere il trattino basso
 dall'indirizzo  per scrivermi...
(delete the underscore from the e-mail address to reply)


---(end of broadcast)---
TIP 3: 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



Re: [HACKERS] 7.1 beta 3 CHANGES FOR QNX

2001-02-09 Thread Maurizio

Hi,
I have deleted the include of termios.h in include/port/qnx4.h.
Then I recompiled pgsql and I have compiled a program with ecpg.

All seem to work right.

Thanks
Maurizio

.
- Original Message -
From: "Tom Lane" [EMAIL PROTECTED]
To: "Maurizio" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; "Bruce Momjian"
[EMAIL PROTECTED]; "Kardos, Dr. Andreas" [EMAIL PROTECTED]
Sent: Tuesday, February 06, 2001 4:08 AM
Subject: Re: [HACKERS] 7.1 beta 3 CHANGES FOR QNX


 "Maurizio" [EMAIL PROTECTED] writes:
  ECHO is defined in the following QNX gcc include files :
  termio.h
  termios.h
  If ECHO was not redefined in pgc.l you can't compile in embedded SQL C.

 Well, my question still stands: why aren't the other four flex outputs
 also broken?  They all use ECHO.

 In any case, I'd prefer to see this fixed by not including termios.h
 rather than hacking up the .l files.  Surely it doesn't need to be
 included everywhere, as src/include/port/qnx4.h is now causing to
 happen.  In fact, it looks to me like qnx4.h probably includes and
 defines a lot more than it needs to; would you experiment with stripping
 it down?

  I am also checking for another problem.
  I have some errors if I compile pgsql without change the typedef Size in
  c.h.
  To succesfully compile pgsql I have changed typedef Size in int insteed
  size_t.

 That strikes me as *horribly* dangerous.  There is too much code whose
 behavior might change in unpleasant ways if Size becomes a signed type.
 Please explain what problems you are seeing that make you think this is
 a good idea.


 Andreas, the QNX port is largely your work IIRC.  What do you think of
 these issues?  Have you tried 7.1beta on QNX?

 regards, tom lane




Re: [HACKERS] 7.1 beta 3 CHANGES FOR QNX

2001-02-06 Thread Maurizio

 "Tom Lane" [EMAIL PROTECTED] writes:
 Well, my question still stands: why aren't the other four flex outputs
 also broken?  They all use ECHO.

I don't know why, but probably you are right. I only know that if ECHO was
not redefined, when I compile with ecpg the output c file has all the
original lines on the same row (without an LF).

 In any case, I'd prefer to see this fixed by not including termios.h
 rather than hacking up the .l files.  Surely it doesn't need to be
 included everywhere, as src/include/port/qnx4.h is now causing to
 happen.  In fact, it looks to me like qnx4.h probably includes and
 defines a lot more than it needs to; would you experiment with stripping
 it down?

If You want I can experiment on qnx4.h. On Saturday I will post the risults.

 That strikes me as *horribly* dangerous.  There is too much code whose
 behavior might change in unpleasant ways if Size becomes a signed type.
 Please explain what problems you are seeing that make you think this is
 a good idea.

In 7.0.2 and 7.0.3 release I have errors about some parameters in TCP/IP
functions.
The compiler tells me that I have a long int where an int was expected. When
I changed Size in int I compiled successfuly PGSQL. In 7.1 I changed
immediatly the size type and all seems works.
After your message I modified again Size type in size_t and recompiled 7.1
release. I compiled successfuly this version the only warnings are about
elog lines in wich there are Size variables. The compiler tells me I have a
long int where an unsigned was expected  (only the format, there is a %u).
However PGSQL works right.

 Andreas, the QNX port is largely your work IIRC.  What do you think of
 these issues?  Have you tried 7.1beta on QNX?

I  also would like to know what Andreas Kardos think. When, some month ago,
I starded looking for POSTGRESQL and I had a lot of problems compiling 7.0.1
version (the major problem was what I have to do for the Size type?) I send
some e-mails to Dr. Kardos and he tells me that his version working fine.
After the first replay he didn't replay to me.
Also other QNX users has the same problems I had and send me e-mails to know
if I have compiled successfully PGSQl for QNX. Nobody has had a reply from
Dr. Kardos.

regards
Maurizio Cauci


- Original Message -
From: "Tom Lane" [EMAIL PROTECTED]
To: "Maurizio" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; "Bruce Momjian"
[EMAIL PROTECTED]; "Kardos, Dr. Andreas" 
Sent: Tuesday, February 06, 2001 4:08 AM
Subject: Re: [HACKERS] 7.1 beta 3 CHANGES FOR QNX


 "Maurizio" [EMAIL PROTECTED] writes:
  ECHO is defined in the following QNX gcc include files :
  termio.h
  termios.h
  If ECHO was not redefined in pgc.l you can't compile in embedded SQL C.

 Well, my question still stands: why aren't the other four flex outputs
 also broken?  They all use ECHO.

 In any case, I'd prefer to see this fixed by not including termios.h
 rather than hacking up the .l files.  Surely it doesn't need to be
 included everywhere, as src/include/port/qnx4.h is now causing to
 happen.  In fact, it looks to me like qnx4.h probably includes and
 defines a lot more than it needs to; would you experiment with stripping
 it down?

  I am also checking for another problem.
  I have some errors if I compile pgsql without change the typedef Size in
  c.h.
  To succesfully compile pgsql I have changed typedef Size in int insteed
  size_t.

 That strikes me as *horribly* dangerous.  There is too much code whose
 behavior might change in unpleasant ways if Size becomes a signed type.
 Please explain what problems you are seeing that make you think this is
 a good idea.


 Andreas, the QNX port is largely your work IIRC.  What do you think of
 these issues?  Have you tried 7.1beta on QNX?

 regards, tom lane





Re: [HACKERS] 7.1 beta 3 CHANGES FOR QNX

2001-02-03 Thread Maurizio

I have tested and works well.

.
- Original Message -
From: "Bruce Momjian" [EMAIL PROTECTED]
To: "Maurizio" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, February 02, 2001 7:21 PM
Subject: Re: [HACKERS] 7.1 beta 3 CHANGES FOR QNX


 I have applied the following patch for QNX.  I had to do the ECHO test
 in pgc.l because pgc.c is generated from pgc.l.  Can you test this to
 see it fixes the problem?


 in [ Charset ISO-8859-1 unsupported, converting... ]
  I have compiled 7.1 b3 in QNX but to let postgresql works I changed
something.
 
  In src/backend/port/qnx4/sem.c
  #define SEMMAX
SEMS_PER_SET) --OLD
  #define SEMMAX  (PROC_NSEMS_PER_SET +
   --NEW
 
  in src/include/storage/s_lock.h
  #if
  --OLD
  #if (defined(__i386__) 
   --NEW
 
  in src/interfaces/ecpg/preproc/pgc.c
  #ifndef
 -OLD
  #ifndef (ECHO ||
  --NEW
 
  Attached are the files
 
 
 
 
  Maurizio Cauci
  DREAMTECH di Cauci Maurizio
  Via Ronchetti, 2 - 21013 Gallarate (VA)
  www.dreamtech-it.com
 

 [ Attachment, skipping... ]

 [ Attachment, skipping... ]

 [ Attachment, skipping... ]


 --
   Bruce Momjian|  http://candle.pha.pa.us
   [EMAIL PROTECTED]   |  (610) 853-3000
   +  If your life is a hard drive, |  830 Blythe Avenue
   +  Christ can be your backup.|  Drexel Hill, Pennsylvania 19026







 ? config.log
 ? config.cache
 ? config.status
 ? GNUmakefile
 ? src/Makefile.custom
 ? src/GNUmakefile
 ? src/Makefile.global
 ? src/log
 ? src/crtags
 ? src/backend/port/Makefile
 ? src/bin/pg_dump/pg_dump
 ? src/bin/pg_dump/pg_restore
 ? src/bin/pg_dump/pg_dumpall
 ? src/include/config.h
 ? src/include/stamp-h
 ? src/interfaces/libpq/libpq.so.2.1
 Index: src/backend/port/qnx4/sem.c
 ===
 RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/port/qnx4/sem.c,v
 retrieving revision 1.3
 diff -c -r1.3 sem.c
 *** src/backend/port/qnx4/sem.c 2000/04/12 17:15:30 1.3
 --- src/backend/port/qnx4/sem.c 2001/02/02 18:13:12
 ***
 *** 26,32 


   #define SETMAX ((MAXBACKENDS + PROC_NSEMS_PER_SET - 1) /
PROC_NSEMS_PER_SET)
 ! #define SEMMAX (PROC_NSEMS_PER_SET)
   #define OPMAX 8

   #define MODE 0700
 --- 26,32 


   #define SETMAX ((MAXBACKENDS + PROC_NSEMS_PER_SET - 1) /
PROC_NSEMS_PER_SET)
 ! #define SEMMAX (PROC_NSEMS_PER_SET+1)
   #define OPMAX 8

   #define MODE 0700
 Index: src/include/storage/s_lock.h
 ===
 RCS file:
/home/projects/pgsql/cvsroot/pgsql/src/include/storage/s_lock.h,v
 retrieving revision 1.86
 diff -c -r1.86 s_lock.h
 *** src/include/storage/s_lock.h 2001/01/24 19:43:28 1.86
 --- src/include/storage/s_lock.h 2001/02/02 18:13:13
 ***
 *** 112,118 
*/


 ! #if defined(__i386__)
   #define TAS(lock) tas(lock)

   static __inline__ int
 --- 112,118 
*/


 ! #if defined(__i386__)  !defined(__QNX__)
   #define TAS(lock) tas(lock)

   static __inline__ int
 Index: src/interfaces/ecpg/preproc/pgc.l
 ===
 RCS file:
/home/projects/pgsql/cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v
 retrieving revision 1.73
 diff -c -r1.73 pgc.l
 *** src/interfaces/ecpg/preproc/pgc.l 2001/01/24 19:43:29 1.73
 --- src/interfaces/ecpg/preproc/pgc.l 2001/02/02 18:13:17
 ***
 *** 35,40 
 --- 35,45 
   #undef yywrap
   #endif /* yywrap */

 + #ifdef __QNX__
 + /* For some reason, QNX needs this, 2001-02-02 */
 + #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
 + #endif
 +
   #define YY_NO_UNPUT

   extern YYSTYPE yylval;





[HACKERS] SIGSEGV in postgres 7.0.0 for QNX

2000-09-16 Thread Maurizio



Hi,


I am tring to use the qnx version of postgresql 
7.0.0

I have qnx 4.25 and TCP/IP


Ihave compiled postgres using 
gcc
I have installed it.


then I have started postgres with -D and -i 
options.

The only commad that I can execute is initdb.

When I execute any other commandI have a 
SIGSEGV error.

I don't understand why.

Could someone help me?
Have I to change the configuration of  QNX kernel, TCP/IP or postgresql 
?

Attached is a log file with the error.


Thanks.

Regards

DREAMTECH
Maurizio Cauci