What happens if I run two backends on different ports at the same time on
the same database? Is there any kind of locking done?

No, one backend won't do since one software want US style dates and the
other wants German style dates. There should be no concurrent access but who
knows when I will type the wrong port.

michael
-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De           | Use PostgreSQL!

Fri, 4 Feb 2000 09:55:25 +0100
Michael Meskes <meskes@postgresql.org>
Two backends at the same time
Michael Meskes wrote:

> No, one backend won't do since one software want US style dates and the
> other wants German style dates.

SET DateStyle can select date styles per session. There is no need to do
that at backend level.

Sevo

Fri, 04 Feb 2000 13:01:23 +0100
Sevo Stille <sevo@ip23.net>
Re: [HACKERS] Two backends at the same time
On Fri, Feb 04, 2000 at 01:01:23PM +0100, Sevo Stille wrote:
> SET DateStyle can select date styles per session. There is no need to do
> that at backend level.

Oops. I should have thought before asking. Sorry.

Michael
-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De           | Use PostgreSQL!

Fri, 4 Feb 2000 15:29:50 +0100
Michael Meskes <meskes@postgresql.org>
Re: [HACKERS] Two backends at the same time
Michael Meskes <meskes@postgreSQL.org> writes:
> What happens if I run two backends on different ports at the same time on
> the same database? Is there any kind of locking done?

You mean two postmasters?  Death and destruction is what will happen.
I believe there's an interlock to prevent this mistake in current
sources, but I don't recall if it was in 6.5.*.

> No, one backend won't do since one software want US style dates and the
> other wants German style dates. There should be no concurrent access but who
> knows when I will type the wrong port.

As Sevo points out, setting DATESTYLE per-session is the right way to do
this.  You might find that setting environment variable PGDATESTYLE on
the client side is a comfortable way to work --- if libpq sees that
variable set, it will issue a SET DATESTYLE command for you during
connection startup.  Works with any libpq-based client, so it's
pretty transparent...

			regards, tom lane

Fri, 04 Feb 2000 10:17:53 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Two backends at the same time 
On Fri, Feb 04, 2000 at 10:17:53AM -0500, Tom Lane wrote:
> You mean two postmasters?  Death and destruction is what will happen.
> I believe there's an interlock to prevent this mistake in current
> sources, but I don't recall if it was in 6.5.*.

I don't think there is one in 6.5.* since I was able to start two.

> As Sevo points out, setting DATESTYLE per-session is the right way to do
> this.  You might find that setting environment variable PGDATESTYLE on
> the client side is a comfortable way to work --- if libpq sees that

Yes, that would be a much better way. If now my perl wasn't so rusty since I
have to set that variable in a CGI script.

Michael
-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De           | Use PostgreSQL!

Fri, 4 Feb 2000 20:45:48 +0100
Michael Meskes <meskes@postgreSQL.org>
Re: [HACKERS] Two backends at the same time
> If now my perl wasn't so rusty since I
> have to set that variable in a CGI script.

$ENV{"PGDATESTYLE"} = "German";

might do it, but I'm not recalling with certainty that Perl does the
Right Thing in to make the variable visible to children (pretty sure
it does).

                   - Thomas

-- 
Thomas Lockhart				lockhart@alumni.caltech.edu
South Pasadena, California

Sat, 05 Feb 2000 01:51:50 +0000
Thomas Lockhart <lockhart@alumni.caltech.edu>
Re: [HACKERS] Two backends at the same time
On Sat, Feb 05, 2000 at 01:51:50AM +0000, Thomas Lockhart wrote:
> $ENV{"PGDATESTYLE"} = "German";
> 
> might do it, but I'm not recalling with certainty that Perl does the
> Right Thing in to make the variable visible to children (pretty sure
> it does).

Yes, that's exactly what I tried and it works.

Michael
-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De           | Use PostgreSQL!

Sun, 6 Feb 2000 11:23:26 +0100
Michael Meskes <meskes@postgresql.org>
Re: [HACKERS] Two backends at the same time