Re: [GENERAL] Cant connect if -B 1024 was set to postmaster

2001-03-19 Thread Lamar Owen

"Poul L. Christiansen" wrote:
> 
> H, don't you mean /var/lib/pgsql/data/postmaster.opts ?

Yes, I do.  Monday morning. :-)  GUC is much nicer in 7.1..one
file.
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



[GENERAL] Re: IDE or RAD tools

2001-03-19 Thread Tony Grant

On 19 Mar 2001 11:25:10 +1100, Gavin Sherry wrote:

> On Fri, 16 Mar 2001, Terry Fielder wrote:
> 
> > Can anyone recommend any Iintegrated Development Environment or Rapid
> > Application Development tools for hooking upto a PostgrSQL database?
> > 
> > In particular, I am looking for something that develops for Linux,
> > because that is what my server is, and I want the users to work thin
> > client.
> 
> Unix (and therefore Linux) differ very much from Windows
> environmentally. One of the best things about a GNU Unix systems is that
> you basically have every possible tool at your finger tips. You should
> consider the shell your IDE or RAD environment.


Sorry this is not an option for some of us. This maybe great for people
who are _real_ programmers but not in my case and maybe not in the case
of Terry. I need symbolic representation of data. While I am drawing
pretty dataflow structures why not have the data actually use this work
instead of drawing up the database on paper then hand coding everything
from a text editor? 

I would suggest Java - JDBC - Postgresql. JBuilder 4 is the tool I am
testing at the moment. If you need a WWW thin client throw in
Enhydra/Kelp application server.

Cheers

Tony Grant


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



Re: [GENERAL] Cannot start postmaster

2001-03-19 Thread Brent R. Matzelle

3/17/2001 1:32:53 PM, "Moishe Groger" <[EMAIL PROTECTED]> wrote:
>   I just finished compiling and installing the newest versions of cygwin,
>   cygipc, and postgresql 7.1 beta 6. When I attempt to run "postmaster -D
>   /usr/local/pgsql/data", however, I receive the following error message:
>
>   C:\cygwin\usr\local\pgsql\bin\postgres.exe: ***
>   recreate_mmaps_after_fork_failed
>   /usr/local/pgsql/bin/postmaster: Startup proc 924 exited with status 256 

The current version of Cygwin, 1.1.8, has a bug in mmap()/fork() that causes 
that particular error.  You can refer to this bug report: 
http://sources.redhat.com/ml/cygwin/2001-02/msg00203.html.  The bug has been 
fixed and has been placed in the current CVS.  I personally have not tried 
it.

Brent


---(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: [GENERAL] concurrent updates problem

2001-03-19 Thread mwaples

[snip junk]
> [snipped code that looked simple enough to a non tcl-er]
> >
> > they both produces sometimes correct results, sometimes under what the
> > result should be and sometimes over it.
> > But 5 or 6 concurrent requests always produce the correct results, any
> > more than that things go wrong.
> 
> Your code looks fine (it's only sql="..." and exec $sql so there can't
> be anything wrong with it).
> 
> The only things I can think of are:
> 1. bug with pg+aolserver (unlikely I think openACS uses that combo). The
> only peculiarity I know with aolsvr is that it's multi-threading, and I
> don't know if that could cause this.
> 
> 2. you aren't actually fetching the number of pages you think you are.
> It could be that calls are failing and being redone without ab telling
> you. Not sure how to tell this without counting packets on the
> wire/turning logging to max on the webserver.
> 
> - Richard Huxton

Im guessing 2.
I just tried using httperf with --num-conn 50 ra 50
My counter went up by 50 every time - and httperf reported around 25
concurrent requests.

Is there a good way to test out concurrent queries,  and see if they are
working as expected ?
ab doesnt seem to be reporting right - although httperf gives the
results i expect.

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



Re: [GENERAL] Cant connect if -B 1024 was set to postmaster

2001-03-19 Thread Poul L. Christiansen

H, don't you mean /var/lib/pgsql/data/postmaster.opts ?

My pg_options file contains:
verbose=2
query=2
syslog=0

I'm running PostgreSQL 7.0.2 on Redhat 7.0.

Poul L. Christiansen

Lamar Owen wrote:
> 
> "Poul L. Christiansen" wrote:
> > On Mon, 19 Mar 2001, Vilson farias wrote:
> > >   I changed my /etc/rc.d/init.d/postgresql. The postmaster line now is :
> > > su -l postgres -c "/usr/bin/pg_ctl -o '-B 1024' -D $PGDATA -p
> > > /usr/bin/postmaster start >/dev/null 2>&1" < /dev/null
> 
> > I remember having this problem. You need to pass the '-i' switch.
> > Try: '-B 1024 -i'
> 
> Add the line '-B 1024' to /var/lib/pgsql/data/pg_options along with the
> -i that is there already, then restart with '/etc/rc.d/init.d/postgresql
> restart'.
> --
> Lamar Owen
> WGCR Internet Radio
> 1 Peter 4:11

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



[GENERAL] about signals

2001-03-19 Thread hiroko




  we are now going to develop a 
system using PostgreSQL on Linux.
this is the first time for us to use PostgreSQL , as well as 
Linux.
many things we would like to ask...
 
this time, the question is about SIGNALS.
I know there are some signals used for the interactions 
between 
postmaster and backend(DB server).  but not the 
details.
 
for example, 
think of the case when you make PostgreSQL-included programs 
used as LIBRARY.
if a signal occured at PostgreSQL-process when other 
apllication is applying to that 
LIBRARY,  does this application catch that signal (from 
PostgreSQl) in mistake for the one
from its child 
process?? 
we would be much pleased if you help us about this 
question. 
 
we need more detailed information about how they work. 

the info about where we can get answers is pleased, 
too.
 
and this is rather urgent.
I do waiting for your reply!!!  
 


[GENERAL] Re: interval output format ?

2001-03-19 Thread Stefan Waidele jun.

Hi David,

I had the same problem, and here is my solution (I posted it on Pg-Novice 
quite a while back):

Q: How do I have an interval displayed only in 'hours:minutes' instead of 
the default 'days hours:minutes'

A: My solution is a function like this:


CREATE FUNCTION "to_hours" (interval )
RETURNS text
AS 'select date_part(''day'', $1)*24 + date_part(''hour'', $1) || '':'' || 
date_part(''min'', $1);'
LANGUAGE 'SQL'


This allows for the following:

SELECT someattribute, to_hours( sum(myinterval) ) from mytable group by 
someattribue;
which is all I need. It works like I expected a built-in - at least for my 
purposes.
It even works if the interval is larger than a year, but only because the 
interval uses days as its largest unit.

DRAWBACKS:

1. This function WILL break, if intervals will happen to have a 
'date_part('[week|month|year]', i)'
2. This function returns the minute part only as single digit if minutes<10 
(130:7 instead of 130:07) which makes it harder to parse the output. But 
then again if You need the output split, You could use date_part on the 
original value.

It seems to me that Postgres already has all the code it needs, it is just 
has to be put together.
If to_char(INTERVAL) makes it into any release of Postgres, I will change 
my queries to use it :-)

Thanks for Your help,
Stefan


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



[GENERAL] postgreSQL db temporary on Microsoft IIS 4.0

2001-03-19 Thread juerg . rietmann

Hi there

For testing, I have a Microsoft Windows NT Server with IIS 4.0 running in
my DMZ. Currently it is not possible to migrate this server to LinuX. Is
there a way to move an existing postgreSQL 7.0.3 db (with views/sequences)
from a Linux Server to this NT Web server. I have coldfusion on NT, all I
need is the postgres DB or a 100% compatible on NT.

Any ideas ??  Thanks in advance ... jr


PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315



---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



Re: [GENERAL] Cant connect if -B 1024 was set to postmaster

2001-03-19 Thread Lamar Owen

"Poul L. Christiansen" wrote:
> On Mon, 19 Mar 2001, Vilson farias wrote:
> >   I changed my /etc/rc.d/init.d/postgresql. The postmaster line now is :
> > su -l postgres -c "/usr/bin/pg_ctl -o '-B 1024' -D $PGDATA -p
> > /usr/bin/postmaster start >/dev/null 2>&1" < /dev/null
 
> I remember having this problem. You need to pass the '-i' switch.
> Try: '-B 1024 -i'

Add the line '-B 1024' to /var/lib/pgsql/data/pg_options along with the
-i that is there already, then restart with '/etc/rc.d/init.d/postgresql
restart'.
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

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



Re: [GENERAL] concurrent updates problem

2001-03-19 Thread Tom Lane

[EMAIL PROTECTED] writes:
> Im using aolserver - but its Im writing it in php later too.
> code is below

> set sql "BEGIN WORK"
> ns_db exec $db $sql

> set sql "SET TRANSACTION ISOLATION LEVEL SERIALIZABLE"
> ns_db exec $db $sql

> set sql "UPDATE threads set views = views + 1 WHERE forum_id = $forum_id
> AND thread_id = $thread_id"
> ns_db dml $db $sql

> set sql "COMMIT WORK"
> ns_db exec $db $sql

Are you sure that ns_db exec isn't "helpfully" doing a commit after each
command?

> But 5 or 6 concurrent requests always produce the correct results, any
> more than that things go wrong.

Sounds like you might be running into some sort of number-of-concurrent-
connections limit in AOLserver.  I'm not sure what happens when there
are too many threads for the available number of database connections in
AOLserver, but this example suggests that it's not good.  Anyone know?

regards, tom lane

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



Re: [GENERAL] concurrent updates problem

2001-03-19 Thread Tom Lane

>> I have on a web application
>> update threads set views = views + 1 where forum_id = 1 and thread_id = 1

It should work to do

begin;
select * from threads where forum_id = 1 and thread_id = 1 FOR UPDATE;
update threads set views = views + 1 where forum_id = 1 and thread_id = 1;
end;

Note the FOR UPDATE to lock the row and the transaction wrapping to
define the scope of the lock.  Without this I'd expect you to lose
some counter increments as a result of two processes doing the UPDATE
at about the same time (both will read the old value of "views" and
increment it by one).

regards, tom lane

---(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: [GENERAL] concurrent updates problem

2001-03-19 Thread Richard Huxton

[EMAIL PROTECTED] wrote:
> 
> Richard Huxton wrote:
> >
> > From: <[EMAIL PROTECTED]>
> >
> > > I have on a web application
> > > update threads set views = views + 1 where forum_id = 1 and thread_id =
> > > 1

> Im using aolserver - but its Im writing it in php later too.
> code is below

[snipped code that looked simple enough to a non tcl-er]
> 
> they both produces sometimes correct results, sometimes under what the
> result should be and sometimes over it.
> But 5 or 6 concurrent requests always produce the correct results, any
> more than that things go wrong.

Your code looks fine (it's only sql="..." and exec $sql so there can't
be anything wrong with it).

The only things I can think of are:
1. bug with pg+aolserver (unlikely I think openACS uses that combo). The
only peculiarity I know with aolsvr is that it's multi-threading, and I
don't know if that could cause this.

2. you aren't actually fetching the number of pages you think you are.
It could be that calls are failing and being redone without ab telling
you. Not sure how to tell this without counting packets on the
wire/turning logging to max on the webserver.

- Richard Huxton

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



[GENERAL] Win Nt setup help please

2001-03-19 Thread Brian C. Doyle

Hello all,

I am having problems with the setup of postgres on NT. I do have MSVisual 
C++ I have done:

copy include\config.h.win32 include\config.h
nmake /f win32.mak

And I get

NMake : fatal error u1077: 'cd' : return code '0x1'
Stop

Can any one help.

I am using Version 1.62.7022 of NMake
and postgresql 7.0.2

Thank you.


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



Re: [GENERAL] Cant connect if -B 1024 was set to postmaster

2001-03-19 Thread Vilson farias

Great! Now it's ok. Thanks.

- Original Message -
From: Poul L. Christiansen <[EMAIL PROTECTED]>
To: Vilson farias <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; SIMONE Carla MOSENA
<[EMAIL PROTECTED]>
Sent: Segunda-feira, 19 de Março de 2001 11:23
Subject: Re: [GENERAL] Cant connect if -B 1024 was set to postmaster


: I remember having this problem. You need to pass the '-i' switch.
: Try: '-B 1024 -i'
:
: I don't know if this behavior is an error or not.
:
: Poul L. Christiansen
:
: On Mon, 19 Mar 2001, Vilson farias wrote:
:
: > Greetings,
: >
: > There are a very weird problem here.
: >
: >   I changed my /etc/rc.d/init.d/postgresql. The postmaster line now is :
: > su -l postgres -c "/usr/bin/pg_ctl -o '-B 1024' -D $PGDATA -p
: > /usr/bin/postmaster start >/dev/null 2>&1" < /dev/null
: >
: >   That mean now are 8Mb (1024 buffers of 8Kb) available for postgres
: > processes. Ok, but if I set this '-B 1024' all my non-local connections
: > don't work. Then, If I simply remove this -B statement everything work
: > again. Besides, there are lots of -B configurations simply dont work
here,
: > like -B 2048, -B 4096... when I try to call /etc/rc.d/init.d/postgressql
: > start, it checks installation (ok), but postmaster fails.
: >
: > Do you know why this is happening?
: >
: > I'm using RedHat 6.2, AMD K6 400, 256Mb RAM with Postgre 7.0.2.
: > and a Pentium 75, 32Mb RAM, RedHat 6.2 with Postgre 7.0.3 and both has
the
: > same problem.
: >
: > Regards,
: >
: > José Vilson de Mello de Farias
: >
: >
: >
: > ---(end of broadcast)---
: > TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
: >
:


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



Re: [GENERAL] Cant connect if -B 1024 was set to postmaster

2001-03-19 Thread Poul L. Christiansen

I remember having this problem. You need to pass the '-i' switch. 
Try: '-B 1024 -i' 

I don't know if this behavior is an error or not.

Poul L. Christiansen

On Mon, 19 Mar 2001, Vilson farias wrote:

> Greetings,
> 
> There are a very weird problem here.
> 
>   I changed my /etc/rc.d/init.d/postgresql. The postmaster line now is :
> su -l postgres -c "/usr/bin/pg_ctl -o '-B 1024' -D $PGDATA -p
> /usr/bin/postmaster start >/dev/null 2>&1" < /dev/null
> 
>   That mean now are 8Mb (1024 buffers of 8Kb) available for postgres
> processes. Ok, but if I set this '-B 1024' all my non-local connections
> don't work. Then, If I simply remove this -B statement everything work
> again. Besides, there are lots of -B configurations simply dont work here,
> like -B 2048, -B 4096... when I try to call /etc/rc.d/init.d/postgressql
> start, it checks installation (ok), but postmaster fails.
> 
> Do you know why this is happening?
> 
> I'm using RedHat 6.2, AMD K6 400, 256Mb RAM with Postgre 7.0.2.
> and a Pentium 75, 32Mb RAM, RedHat 6.2 with Postgre 7.0.3 and both has the
> same problem.
> 
> Regards,
> 
> José Vilson de Mello de Farias
> 
> 
> 
> ---(end of broadcast)---
> TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
> 


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



[GENERAL] Cant connect if -B 1024 was set to postmaster

2001-03-19 Thread Vilson farias

Greetings,

There are a very weird problem here.

  I changed my /etc/rc.d/init.d/postgresql. The postmaster line now is :
su -l postgres -c "/usr/bin/pg_ctl -o '-B 1024' -D $PGDATA -p
/usr/bin/postmaster start >/dev/null 2>&1" < /dev/null

  That mean now are 8Mb (1024 buffers of 8Kb) available for postgres
processes. Ok, but if I set this '-B 1024' all my non-local connections
don't work. Then, If I simply remove this -B statement everything work
again. Besides, there are lots of -B configurations simply dont work here,
like -B 2048, -B 4096... when I try to call /etc/rc.d/init.d/postgressql
start, it checks installation (ok), but postmaster fails.

Do you know why this is happening?

I'm using RedHat 6.2, AMD K6 400, 256Mb RAM with Postgre 7.0.2.
and a Pentium 75, 32Mb RAM, RedHat 6.2 with Postgre 7.0.3 and both has the
same problem.

Regards,

José Vilson de Mello de Farias



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



Re: [GENERAL] IDE or RAD tools

2001-03-19 Thread Ned Lilly

Hi Michelle,

Check out phpPgAdmin - see http://www.greatbridge.org/project/phppgadmin/

Regards,
Ned


Michelle Murrain wrote:

> On Sunday 18 March 2001 07:50 pm, Doug McNaught wrote:
> 
 Can anyone recommend any Iintegrated Development Environment or Rapid
 Application Development tools for hooking upto a PostgrSQL database?
 
 In particular, I am looking for something that develops for Linux,
 because that is what my server is, and I want the users to work thin
 client.
>>> 
>> [snippage]
>> 
>>> Generally speaking, if you put a good programmer in front of a RAD or
>>> IDE, he or she becomes less productive - just one more thing to
>>> learn. Programmers type, they don't point and click =)
>> 
>> Preach on brother!
> 
> 
> This is a tangent question - I've been thinking alot about a development 
> project to allow mere mortals easily set up web-based databases in pgsql, 
> using a web-based tool. Does anyone know about projects that would basically 
> provide the functionality of pg_access but in a web-based context? 
> 
> If not, it's next on my list of things to tackle.
> 
> Michelle
> 
> Michelle Murrain, Ph.D.
> President
> Norwottuck Technology Resources
> [EMAIL PROTECTED]
> http://www.norwottuck.com
> 
> ---(end of broadcast)---
> TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
> 
> 

-- 

Ned Lilly e: [EMAIL PROTECTED]
Vice Presidentw: www.greatbridge.com
Evangelism / Hacker Relationsv: 757.233.5523
Great Bridge, LLCf: 757.233.


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



[GENERAL] Insert into when the type is an other table

2001-03-19 Thread Mourad EL HADJ MIMOUNE



Hi,
 
I created a Tables : Create Table address (contry 
varchar(20), city varchar(20), zip_code integer),
        
                
    
  Create 
Table  person (Name  varchar(20), addr address);
 
I would know how I can Insert Values in person 
table.
 
note that Postgres add each created table in 
pg_types catalog table. so, each table is considered as a data type. is this 
right?
 
thanks for your help,
 
Mourad 
 
 


Re: [GENERAL] IDE or RAD tools

2001-03-19 Thread Michelle Murrain

On Sunday 18 March 2001 07:50 pm, Doug McNaught wrote:
>
> > > Can anyone recommend any Iintegrated Development Environment or Rapid
> > > Application Development tools for hooking upto a PostgrSQL database?
> > >
> > > In particular, I am looking for something that develops for Linux,
> > > because that is what my server is, and I want the users to work thin
> > > client.
>
> [snippage]
>
> > Generally speaking, if you put a good programmer in front of a RAD or
> > IDE, he or she becomes less productive - just one more thing to
> > learn. Programmers type, they don't point and click =)
>
> Preach on brother!

This is a tangent question - I've been thinking alot about a development 
project to allow mere mortals easily set up web-based databases in pgsql, 
using a web-based tool. Does anyone know about projects that would basically 
provide the functionality of pg_access but in a web-based context? 

If not, it's next on my list of things to tackle.

Michelle

Michelle Murrain, Ph.D.
President
Norwottuck Technology Resources
[EMAIL PROTECTED]
http://www.norwottuck.com

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



Re: [GENERAL] concurrent updates problem

2001-03-19 Thread mwaples

Richard Huxton wrote:
> 
> From: <[EMAIL PROTECTED]>
> 
> > I have on a web application
> > update threads set views = views + 1 where forum_id = 1 and thread_id =
> > 1
> > just to record view for that page - stupid I know but people want it.
> > Problem comes when I use apache's ab to test it.
> >
> > It just doesnt produce the correct result with 10 or so concurrent
> > connections. The views ends up being completely out.(no failed queries)
> 
> So the views total is less than you'd expect.

no views are actually more - for 20 access it can be 30 -40 views -
varies all the time, sometimes views is less.


 
> > I read up on transaction Isolations , using select for update etc
> > but can't get it to work correctly - I thought serilizable might do the
> > trick but only few queries were rolled back -
> > Can anyone point me in the right direction to solve this ?
> 
> Can't think what difference it should make how many connections you have.
> The update you show will take place in its own transaction so should always
> be consistent. The query should block if it needs to wait on another process
> updating.
> 
> I can only think that you might not be checking for success/failure at some
> point in the code.

I haven't been checking for success or failure - I thought I'll have to
test for failure - but the views were greater than then they should be.

 If you can boil it down to a small Perl/PHP script I can
> try and duplicate it here - if not, post the relevant code and we'll see if
> more eyeballs can't spot something.
> 
> - Richard Huxton

Im using aolserver - but its Im writing it in php later too.
code is below

set sql "BEGIN WORK"
ns_db exec $db $sql

set sql "SET TRANSACTION ISOLATION LEVEL SERIALIZABLE"
ns_db exec $db $sql

set sql "UPDATE threads set views = views + 1 WHERE forum_id = $forum_id
AND thread_id = $thread_id"
ns_db dml $db $sql

set sql "COMMIT WORK"
ns_db exec $db $sql


I ve also tried just

set sql "UPDATE threads set views = views + 1 WHERE forum_id = $forum_id
AND thread_id = $thread_id"
ns_db dml $db $sql


they both produces sometimes correct results, sometimes under what the
result should be and sometimes over it.
But 5 or 6 concurrent requests always produce the correct results, any
more than that things go wrong.

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



Re: [GENERAL] concurrent updates problem

2001-03-19 Thread Richard Huxton

From: <[EMAIL PROTECTED]>

> I have on a web application
> update threads set views = views + 1 where forum_id = 1 and thread_id =
> 1
> just to record view for that page - stupid I know but people want it.
> Problem comes when I use apache's ab to test it.
>
> It just doesnt produce the correct result with 10 or so concurrent
> connections. The views ends up being completely out.(no failed queries)

So the views total is less than you'd expect.

> I read up on transaction Isolations , using select for update etc
> but can't get it to work correctly - I thought serilizable might do the
> trick but only few queries were rolled back -
> Can anyone point me in the right direction to solve this ?

Can't think what difference it should make how many connections you have.
The update you show will take place in its own transaction so should always
be consistent. The query should block if it needs to wait on another process
updating.

I can only think that you might not be checking for success/failure at some
point in the code. If you can boil it down to a small Perl/PHP script I can
try and duplicate it here - if not, post the relevant code and we'll see if
more eyeballs can't spot something.

- Richard Huxton


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



Re: [GENERAL] concurrent updates problem

2001-03-19 Thread Gavin Sherry

You should not be experiencing this if you are using transactions.

Gavin


On Mon, 19 Mar 2001 [EMAIL PROTECTED] wrote:

> I have on a web application
> update threads set views = views + 1 where forum_id = 1 and thread_id =
> 1
> just to record view for that page - stupid I know but people want it.
> Problem comes when I use apache's ab to test it.
>  
> It just doesnt produce the correct result with 10 or so concurrent
> connections. The views ends up being completely out.(no failed queries)
> I read up on transaction Isolations , using select for update etc
> but can't get it to work correctly - I thought serilizable might do the
> trick but only few queries were rolled back -
> Can anyone point me in the right direction to solve this ?
> 
> ---(end of broadcast)---
> TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
> 


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



Re: [GENERAL] embedded sql pointer to structure question

2001-03-19 Thread Michael Meskes

On Fri, Mar 16, 2001 at 09:51:20PM +0100, Feite Brekeveld wrote:
> If I do that ( tried that already ) I get an eror message:
> 
> pmr is not a pointer
> 
> at the point where I reference to it in the query:
> ...

Please read my mail completely:
 
> > This should work. But be sure to use the latest CVS version as there was a
> > small bug in this bug. I'm actually committing the fix right now.

Should read "bug in this part" of course. :-)

Michael
-- 
Michael Meskes
[EMAIL PROTECTED]
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!

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