AW: BLERe: AW: AW: [HACKERS] relation ### modified while in use

2000-10-24 Thread Zeugswetter Andreas SB

   Are there many applications which have many SELECT statements(without
   FOR UPDATE) in one tx ?
 
  Why not ?
 
 It seems to me that multiple SELECT statements in a tx has little
 meaning unless the tx is executed in SERIALIZABLE isolation level.

E.g. a table is accessed multiple times to select different data
in an inner application loop. No need for serializable here.

Andreas


Re: AW: BLERe: AW: AW: [HACKERS] relation ### modified while in use

2000-10-24 Thread Hiroshi Inoue


Zeugswetter Andreas SB wrote:

Are there many applications which have many SELECT statements(without
FOR UPDATE) in one tx ?
  
   Why not ?
  
  It seems to me that multiple SELECT statements in a tx has little
  meaning unless the tx is executed in SERIALIZABLE isolation level.

 E.g. a table is accessed multiple times to select different data
 in an inner application loop. No need for serializable here.


And seems no need to execute in one tx.
Hmm,we seems to be able to call a cleanup procedure
internally which is equivalent to 'commit' after each
consecutive read-only statement.  Is it a problem ?

Regards.
Hiroshi Inoue


Re: AW: AW: BLERe: AW: AW: [HACKERS] relation ### modified while in use

2000-10-24 Thread Hiroshi Inoue


Zeugswetter Andreas SB wrote:

[snip]


 Also the result would be, that the first readonly statements are allowed to
 see schema changes, but selects after the first DML would not :-(


Does it mean that even read-only statements aren't allowed
to release locks after other DMLs ?

Regards.
Hiroshi Inoue


[HACKERS] Two-phase commit

2000-10-24 Thread devik

Hello,
anyone thought about implementing two-phase commit to
be able to support distributed transactions ?
I have no clue how complex it would be, someone knows ?

devik





[HACKERS] Re: how to access backend pid from libpq ?

2000-10-24 Thread Hannu Krosing

Hannu Krosing wrote:
 
 I was unable to find the way to access the backend pid from libpq
 
 It is probably saved somewhere as part of BackendKeyData message
 but there seems to be no function to access it ?
 
 I'm using a temporary solution (my own 'C' function) but I'd like
 to use the info already received.

Ok, I found it from the libpq source: PQbackendPID

I still think it could be documented ;)


Hannu



[HACKERS] Re: [COMMITTERS] pgsql/src/backend/access/transam (xact.c xlog.cxlogutils.c)

2000-10-24 Thread Peter Eisentraut

Vadim B. Mikheev - CVS writes:

   Date: Tuesday, October 24, 2000 @ 05:56:09
 Author: vadim
 
 Update of /home/projects/pgsql/cvsroot/pgsql/src/backend/access/transam
  from hub.org:/home/projects/pgsql/tmp/cvs-serv70071/backend/access/transam
 
 Modified Files:
   xact.c xlog.c xlogutils.c 
 
 -  Log Message  -
 
 WAL misc

We seem to be missing a file "src/include/access/xlogutils.h".

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




[HACKERS] RE: [INTERFACES] RE: JDBC now needs updates for large objects

2000-10-24 Thread Peter Mount

Yes, the joins were one of the reasons I was going to do it.

If no one starts a list by Saturday, then I'll start one when I go through
JDBC.

Peter

-- 
Peter Mount
Enterprise Support Officer, Maidstone Borough Council
Email: [EMAIL PROTECTED]
WWW: http://www.maidstone.gov.uk
All views expressed within this email are not the views of Maidstone Borough
Council


-Original Message-
From: Tom Lane [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 24, 2000 1:44 PM
To: Peter Mount
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [INTERFACES] RE: JDBC now needs updates for large objects 


Peter Mount [EMAIL PROTECTED] writes:
 Idea: As we have this type of query in more than one part of the source
tree
 (ie: psql, jdbc, probably odbc), should we have a section in the
 documentation containing common queries, like: retrieving a list of
tables,
 views etc?

That's a good thought.  It'd be a useful practice to review such
standard queries from time to time anyway.  For example, now that
outer joins work, a lot of psql's backslash-command queries could
be simplified (don't need the UNION ALL WITH SELECT NULL hack).

Anyone have time to work up a list?

regards, tom lane



Re: [HACKERS] relation ### modified while in use

2000-10-24 Thread Vadim Mikheev
   In my understanding,locking levels you provided contains
   an implicit share/exclusive lock on the corrsponding
   pg_class tuple i.e. AccessExclusive Lock acquires an
   exclusive lock on the corresping pg_class tuple and
   other locks acquire a share lock, Is it right ?
 
  No. Access...Locks are acquired over target table
  (table' oid is used as key for lmgr hash table),
  not over corresponding pg_class tuple, in what case
  we would use pg_clas' oid + table' oid as key
  (possibility I've described below).
 
 
 Yes,I know that "lock table" doesn't touch the correpon
 ding pg_class tuple at all.  However isn't it equivalent ?

From what POV?
Lock manager will allow two simultaneous exclusive locks using these
different methods (keys) and so we can interpret (use) them differently.

Vadim


[HACKERS] Fallback behavior for UNKNOWN types -- proposed change

2000-10-24 Thread Thomas Lockhart

The parser has some heuristics to try to match up existing functions and
operators when not all types are known apriori. We've had this
capability since v6.4, with some modest evolution since then.

Currently, if there is more than one function, say, which *could* match
the specified query, and if the arguments with unspecified types
(typically looking like a bare SQL9x string) come from different
"categories" of types (e.g. integer and string, or float and date) then
the parser throws an error about not finding the function.

I propose that we modify the heuristic slightly, so that if there are
function matches with arguments from different categories, and if one or
more of the possible matches comes from the "string" category, then that
category is preferred.

There are two good reasons for this, and one bad reason ;) :

1) the original query carries "string" semantics, so it is a reasonable
fallback interpretation for the query.

2) a string fallback will make things like

  select tstampfield at time zone 'pst' from t1;

and

  select tstampfield at time zone interval '-08:00' from t1;

possible (oh, btw, I've got patches to implement "at time zone..."),
where currently

  select tstampfield at time zone 'pst' from t1;

fails and requires that 'pst' be specified as "text 'pst'".

3) some braindead "compatibility tests" from some competing open-source
database projects have poorly designed queries which interpret this lack
of fallback as a lack of support for database features. So instead of
getting extra points for having *more* capabilities in a particular
area, they claim that we don't support anything in that area. Most
annoying, and it is not likely to change.

Comments? I've got code which implements the fallback for functions, and
presumably the same for operators will be easy to do...

   - Thomas



Re: [HACKERS] Two-phase commit

2000-10-24 Thread richard excite


i'm developing one. a library for batch transactions, so you
can continue processing in the middle of the file(or table) in
case an abort happens. it can support multi-databases.
i think i can share it to freshmeat.

On Tue, 24 Oct 2000 13:52:38 +0200, [EMAIL PROTECTED] wrote:

  Hello,
  anyone thought about implementing two-phase commit to
  be able to support distributed transactions ?
  I have no clue how complex it would be, someone knows ?
  
  devik
  






___
Say Bye to Slow Internet!
http://www.home.com/xinbox/signup.html




[HACKERS] Re: [PATCHES] add darwin/osxpb support to cvs

2000-10-24 Thread Peter Eisentraut

Bruce Hartzler writes:

 this patch and tar archive will add support for the darwin/osxpb to the current cvs 
tree.

Next time you can make your patch with "diff -crN" so that you don't have
to create a separate tarball.

 - the config.guess and config.sub files have been updated by apple to
 support their new os. i don't think these changes have been folded
 back in to the main archive yet

I installed the latest ones from GNU which claim to support it according
to the ChangeLog.

 - the situation with darwin's implementation of sysv semaphores is in
 progress at the moment (the shm/ipc support *is* there and seems to
 work fine). so this patch uses HAVE_SYS_SEM_H to conditionally build

HAVE_SYS_SEM_H is a preprocessor symbol, not a makefile variable.

 the src/backend/port/darwin semaphore code (borrowed from qnx4).

If you could arrange it, could you use the same files as QNX, perhaps with
an #ifdef here or there

 I've followed the BeOS example of including the necessary sem.h
 declarations in src/include/port/darwin.h. this is rather messy at the
 moment and can be dumped once apple releases a version of PB with sysv
 sem built into the kernel.

The include/port/beos.h isn't really a shining example of how to do this.  
This file is include *everywhere*, but we don't want to know about
semaphores everywhere.  I'd prefer it if you use the QNX approach and
symlink sem.h into an include directory (e.g., /usr/local/include/sys),
since it's only temporary anyway.

Also, overriding configure results (à la #undef HAVE_UNION_SEMUN) isn't
cool.

I'm also somewhat concerned about the dynloader.c because it's under the
Apache license which has a funny advertisement clause.  Comments from
someone?

 - i'm a bit confused over the __powerpc__ tas function in s_lock.c
 (there i assume for the ppc-linux port). it doesn't compile at all on
 darwin so i just added a version that does work on darwin under
 DARWIN_OS. it's potentially a bit confusing and s_lock.c should
 probably be changed to include a better conditional.

The compiler probably predefines something like __darwin__, which you
should use.  You can find out with 

touch foo.h
cc -E -dM foo.h
rm foo.h

And finally, what's up with this:

CFLAGS='-O0 -g -traditional-cpp'

?  What's wrong with the "modern-cpp"?

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




Re: [HACKERS] Re: Add support for xti.h

2000-10-24 Thread Tom Lane

 This is an IRIX bug but I think that we need to work around it.

 Roger, will do.

I have changed configure in the CVS repository to test for netinet/tcp.h
per your recommendation.  At your convenience, please verify that it
really does do the right thing on IRIX.

regards, tom lane



Re: [HACKERS] Re: Add support for xti.h

2000-10-24 Thread Tom Lane

Pete Forman [EMAIL PROTECTED] writes:
 On IRIX 6.5.5m I get the following error.  The header standards.h is
 included by (nearly!) all of the standard headers.  It is the IRIX
 equivalent of config.h if you will.

 configure:4349: checking for netinet/tcp.h
 configure:4359: cc -E   conftest.c /dev/null 2conftest.out
 cc-1035 cc: WARNING File = /usr/include/sys/endian.h, Line = 32
   #error directive:  "standards.h must be included before sys/endian.h."

   #error "standards.h must be included before sys/endian.h."
^
 configure: failed program was:
 #line 4354 "configure"
 #include "confdefs.h"
 #include netinet/tcp.h

How bizarre.  One would think it'd make more sense to just include the
desired file, instead of going belly-up like that.

 In order to preprocess this test on IRIX a system header such as
 stdio.h must precede netinet/tcp.h.  The logical choice of header
 to use is netinet/in.h as tcp.h is supplying values for levels
 defined in in.h.

 This is an IRIX bug but I think that we need to work around it.

Roger, will do.

regards, tom lane



Re: [HACKERS] Re: Add support for xti.h

2000-10-24 Thread Pete Forman

Tom Lane writes:
   Actually, given your description of the problem, I'm half
   inclined to revert the whole patch and instead make configure's
   test for availability of netinet/tcp.h first include
   netinet/in.h, so that that configure test will succeed on IRIX
   etc.
  
  Pete,
After looking at this I'm confused again.  The configure test
  consists of seeing whether cpp will process
  
   #include netinet/tcp.h
  
  without complaint.  I can well believe that the full C compilation
  process will generate errors if netinet/tcp.h is included without
  also including netinet/in.h, but it's a little harder to believe
  that cpp alone will complain.  Could you double-check this?
  
  It would be useful to look at the config.log file generated by the
  configure run that's reporting tcp.h isn't found.  It should
  contain the error messages generated by failed tests.

On IRIX 6.5.5m I get the following error.  The header standards.h is
included by (nearly!) all of the standard headers.  It is the IRIX
equivalent of config.h if you will.

In order to preprocess this test on IRIX a system header such as
stdio.h must precede netinet/tcp.h.  The logical choice of header
to use is netinet/in.h as tcp.h is supplying values for levels
defined in in.h.

This is an IRIX bug but I think that we need to work around it.


configure:4349: checking for netinet/tcp.h
configure:4359: cc -E   conftest.c /dev/null 2conftest.out
cc-1035 cc: WARNING File = /usr/include/sys/endian.h, Line = 32
  #error directive:  "standards.h must be included before sys/endian.h."

  #error "standards.h must be included before sys/endian.h."
   ^
configure: failed program was:
#line 4354 "configure"
#include "confdefs.h"
#include netinet/tcp.h



-- 
Pete Forman -./\.- Disclaimer: This post is originated
Western Geophysical   -./\.-  by myself and does not represent
[EMAIL PROTECTED] -./\.-  the opinion of Baker Hughes or
http://www.crosswinds.net/~petef  -./\.-  its divisions.



Re: [HACKERS] Mailing list archives available?

2000-10-24 Thread The Hermit Hacker

On Tue, 24 Oct 2000, Vince Vielhaber wrote:

 On Tue, 24 Oct 2000, The Hermit Hacker wrote:
 
  
  http://www.postgresql.org/mhonarc has them all listed .. not sure how to
  get there from the Web site ... Vince?
 
 There are links from both the Developer's Corner and User's Lounge -
 General Info.

Ya know, I've gone in and looked several times and my eye always gets draw
down to the section titled ' Mailing Lists '? :)  Can you put lnks from
the 'pgsql-{admin,announce,general,etc}' in that section to the archives
as well, so its a bit easier to find?  And maybe 'bold' the words "mailing
lists" in the General Info section, so that it stands out a bit more? :)


   Vince.
 
 
  
  On Mon, 23 Oct 2000, Krzysztof Kowalczyk wrote:
  
   Are mailing list archives of various postgresql mailing list available
   anywhere?
   
   I know they were some time ago but I couldn't find any link on
   www.postgresql.org now. I subscribed to a list mainly because I want to
   monitor the progress but the amount of messages kills my inbox. It would
   be really convenient for me if I could just browse the archives on web
   once in a while.
   
   Krzysztof Kowalczyk
   
   
  
  Marc G. Fournier   ICQ#7615664   IRC Nick: Scrappy
  Systems Administrator @ hub.org 
  primary: [EMAIL PROTECTED]   secondary: scrappy@{freebsd|postgresql}.org 
  
  
 
 -- 
 ==
 Vince Vielhaber -- KA8CSHemail: [EMAIL PROTECTED]http://www.pop4.net
  128K ISDN from $22.00/mo - 56K Dialup from $16.00/mo at Pop4 Networking
 Online Campground Directoryhttp://www.camping-usa.com
Online Giftshop Superstorehttp://www.cloudninegifts.com
 ==
 
 
 
 

Marc G. Fournier   ICQ#7615664   IRC Nick: Scrappy
Systems Administrator @ hub.org 
primary: [EMAIL PROTECTED]   secondary: scrappy@{freebsd|postgresql}.org 




[HACKERS] Re: [PATCHES] binary operators on integers

2000-10-24 Thread Tom Lane

Peter Eisentraut [EMAIL PROTECTED] writes:
 This patch was installed, with xor as "#".  The parser still needs work.  
 Besides the known issue of "|", this also parses funny:

 = select 5  ~ 6;
 ERROR:  Unable to identify a right operator '' for type 'int4'

I think we're kind of stuck on that, at least in terms of a solution
specifically for ~ --- I don't think we should be wiring knowledge of
whether specific operators are prefix/suffix/infix into the grammar.

It might perhaps be possible to tweak the grammar so that

operand operator operator operand

is generically resolved as

operand infix-op (prefix-op operand)

and not

(operand postfix-op) infix-op operand

the way it is now.  Given that postfix operators are relatively seldom
used, this seems a more sensible default --- but I suppose somewhere out
there is an application that will break.  (At least it probably won't
break silently.)

Comments anyone?

regards, tom lane



[HACKERS] Bogus-looking SSL code in postmaster wait loop

2000-10-24 Thread Tom Lane

The postmaster contains this code just before it waits for input:

#ifdef USE_SSL
for (curr = DLGetHead(PortList); curr; curr = DLGetSucc(curr))
{
if (((Port *) DLE_VAL(curr))-ssl 
SSL_pending(((Port *) DLE_VAL(curr))-ssl)  0)
{
no_select = true;
break;
}
}
if (no_select)
FD_ZERO(rmask);/* So we don't accept() anything below */
#endif

I am not sure exactly what SSL_pending() is defined to mean, but as
near as I can tell, whenever SSL_pending() returns true, the postmaster
will completely ignore every other input-ready condition.  This spells
"denial of service" from where I sit: a nonresponsive SSL client will
cause the postmaster to freeze up for all other clients.

Can anyone who knows about SSL defend or even explain the above code?
I am strongly inclined to just dike it out.

regards, tom lane



[HACKERS] Re: [PATCHES] add darwin/osxpb support to cvs

2000-10-24 Thread Bruce Hartzler

Next time you can make your patch with "diff -crN" so that you don't have
to create a separate tarball.

No problem. I tried just doing a diff with cvs but wasn't able to get 
the -N option to work. This is the first time I've ever tried 
patching unix software so I'm sorry if it's a bit messy. Thanks for 
you help in getting it right.


   - the config.guess and config.sub files have been updated by apple to
  support their new os. i don't think these changes have been folded
  back in to the main archive yet

I installed the latest ones from GNU which claim to support it according
to the ChangeLog.

I'll try checking out the new versions and see if they work. I can 
send you a diff with the ones I have here if you want to see the 
additions Apple made.


   I've followed the BeOS example of including the necessary sem.h
  declarations in src/include/port/darwin.h. this is rather messy at the
  moment and can be dumped once apple releases a version of PB with sysv
  sem built into the kernel.

The include/port/beos.h isn't really a shining example of how to do this. 
This file is include *everywhere*, but we don't want to know about
semaphores everywhere.  I'd prefer it if you use the QNX approach and
symlink sem.h into an include directory (e.g., /usr/local/include/sys),
since it's only temporary anyway.

I agree it's rather messy. I originally had just used the sym link in 
/usr/local/include, but as I said, some of the newer Darwin kernels 
have the sysv sem.h file already there and I was worried about people 
overwriting it. If you think it's fair to put this responsibility on 
the end user, I'm ok with that. I just thought it might be nice to 
check and see if the semaphore implementation was already there, and 
if not, build the necessary parts. I'll switch it back to the way it 
was.

I'm also somewhat concerned about the dynloader.c because it's under the
Apache license which has a funny advertisement clause.  Comments from
someone?

I wondering about this too. I'll try emailing Wilfredo Sanchez and 
see if I can get the code outside the Apache license. This would 
probably be easiest.


The compiler probably predefines something like __darwin__, which you
should use.  You can find out with

It doesn't actually provide __darwin__ but as I mentioned in a 
previous post, Apple is suggesting people use __APPLE__ combined with 
__ppc__ or __i386__ for the different darwin builds. The section in 
s_lock.c should probably be changed to reflect this instead of using 
DARWIN_OS.


And finally, what's up with this:

CFLAGS='-O0 -g -traditional-cpp'

?  What's wrong with the "modern-cpp"?

Apple's "modern-cpp" called cpp-precomp uses some strange parsing 
that breaks on several files in the postgresql build. They are still 
working on it apparently and are suggesting people simply use the 
-traditional-cpp flag when this happens instead of trying to update 
the files.

Thanks again for all your comments and suggestions.

Bruce