Joe Conway <[EMAIL PROTECTED]> writes:
> Specifically I'd like to reset a variable within my PL/R interpreter
> each time a new SQL statement begins.
Define "new SQL statement". In particular, what of a PL function
executing multiple SQL statements inside an outer SQL statement that
invoked the
Already applied by Tom. Thanks.
---
Kurt Roeckx wrote:
> On Tue, Jul 08, 2003 at 12:34:19PM +0900, Kenji Sugita wrote:
> > From: Kurt Roeckx <[EMAIL PROTECTED]>
> > Subject: Re: [HACKERS] PostgreSQL 7.4devel - LOG: PGSTAT:
Bruce Momjian <[EMAIL PROTECTED]> writes:
> Should the new threading configure option be called:
> --enable-thread-safeness
> or
> --enable-thread-safety
safety is a common word, safeness isn't. (The OED has entries for both,
but the entry for safety is about 10x longer; a smaller di
Thomas Swan <[EMAIL PROTECTED]> writes:
>>> When a SELECT FOR UPDATE query is executed, are the row level locks on a
>>> table acquired in any specific order
Nope, just whatever order the chosen plan happens to visit the tuples
in.
> I had remembered several readings on ordered locking as a met
--On Thursday, July 24, 2003 21:42:59 -0400 Bruce Momjian
<[EMAIL PROTECTED]> wrote:
Should the new threading configure option be called:
--enable-thread-safeness
or
--enable-thread-safety
or something else? Someone was asking me about the validity of the word
safeness.
the latter, IMHO.
Should the new threading configure option be called:
--enable-thread-safeness
or
--enable-thread-safety
or something else? Someone was asking me about the validity of the word
safeness.
--
Bruce Momjian| http://candle.pha.pa.us
[EMAIL PROTECTED]
Bruce Momjian wrote:
Thomas Swan wrote:
When a SELECT FOR UPDATE query is executed, are the row level locks on a
table acquired in any specific order such as to enhance deadlock
prevention? ( primary key, oid, etc. )
Interesting question, because in a join, you could have multiple tables
Thomas Swan wrote:
> When a SELECT FOR UPDATE query is executed, are the row level locks on a
> table acquired in any specific order such as to enhance deadlock
> prevention? ( primary key, oid, etc. )
Interesting question, because in a join, you could have multiple tables
involved. Sorry, I do
When a SELECT FOR UPDATE query is executed, are the row level locks on a
table acquired in any specific order such as to enhance deadlock
prevention? ( primary key, oid, etc. )
---(end of broadcast)---
TIP 2: you can get off all lists at once with
I know that I can use fcinfo->flinfo->fn_extra to determine if a
particular function has been previously called within a given SQL
statement execution, but what is the best way to determine that the
current statement has or has not changed?
Specifically I'd like to reset a variable within my PL
On Thu, 24 Jul 2003, Francisco Figueiredo Jr. wrote:
> Nigel J. Andrews wrote:
>
> > On Tue, 22 Jul 2003, Francisco Figueiredo Jr. wrote:
> >
> >
> >>>How's this for an alternative if you really don't want any rows returned:
> >>>
> >>>create function fincF ( ) returns setof integer as '
> >>>
> "Bruce" == Bruce Momjian <[EMAIL PROTECTED]> writes:
>> -- Pip-pip Sailesh http://www.cs.berkeley.edu/~sailesh
Bruce> ^^^ Watch out, that code from
Bruce> Berkeley usually is a mess. :-)
LOL !
That's why we release the code - in the hope of getting r
> "Tom" == Tom Lane <[EMAIL PROTECTED]> writes:
Tom> Sailesh Krishnamurthy <[EMAIL PROTECTED]> writes:
>> We implemented a Shared Memory MemoryContext using OSSP libmm
>> (used in Apache) for TelegraphCQ.
Tom> How portable is that? What kind of real-world performance do
T
'K, fixed the TAG to point to the right revision and am rebuilding the
packages right now ...
On Thu, 24 Jul 2003, Tom Lane wrote:
> The Hermit Hacker <[EMAIL PROTECTED]> writes:
> > Please check it over before I announce it more generally ... but she looks
> > good from here ..
>
> Almost there
Sailesh Krishnamurthy <[EMAIL PROTECTED]> writes:
> We implemented a Shared Memory MemoryContext using OSSP libmm (used in
> Apache) for TelegraphCQ.
How portable is that? What kind of real-world performance do you get?
regards, tom lane
---(end
Sailesh Krishnamurthy wrote:
> > "Tom" == Tom Lane <[EMAIL PROTECTED]> writes:
>
> Tom> Sailesh Krishnamurthy <[EMAIL PROTECTED]> writes:
> >> Why not have the traditional approach of a lock table in shared
> >> memory, growing and shrinking as appropriate,
>
> Tom> Because we
> "Tom" == Tom Lane <[EMAIL PROTECTED]> writes:
Tom> Sailesh Krishnamurthy <[EMAIL PROTECTED]> writes:
>> Why not have the traditional approach of a lock table in shared
>> memory, growing and shrinking as appropriate,
Tom> Because we can't grow shared memory. Whatever size w
Sailesh Krishnamurthy <[EMAIL PROTECTED]> writes:
> Why not have the traditional approach of a lock table in shared
> memory, growing and shrinking as appropriate,
Because we can't grow shared memory. Whatever size we get at startup is
what we're stuck with. (I suppose we could try asking the ke
> "Tom" == Tom Lane <[EMAIL PROTECTED]> writes:
Tom> Rod Taylor <[EMAIL PROTECTED]> writes:
>> It may be best to have a locking manager run as a separate
>> process. That way it could store locks in ram or spill over to
>> disk.
Tom> Hmm, that might be workable. We could
Jan Wieck wrote:
> Marcus B?rger wrote:
> > ATM i have a patch doing the following:
> > Connect:
> > If PQprotocolVersion() is available and >= 3 PQparameterStatus() is available
> > then i check the server version. Else i check the lib version (*).
> > If the version to check is >= 7.2 ido one
Marcus Börger wrote:
ATM i have a patch doing the following:
Connect:
If PQprotocolVersion() is available and >= 3 PQparameterStatus() is available
then i check the server version. Else i check the lib version (*).
If the version to check is >= 7.2 ido one of the following:
- If one of PQprotoc
Marcus B?rger wrote:
> BM> I believe this should be BEGIN;ROLLBACK;RESET ALL; because our default
> BM> for a client that disconnects is to abort the transaction.
>
> >> - If protocol version >= 3 and transaction status == PQTRANS_IDLE:
> >> "RESET ALL;"
> >> - If protocol version >= 3 and
Stephan Szabo wrote:
On Thu, 24 Jul 2003, Joe Conway wrote:
I see your point, but mine was that in this case I'd like a NULL
returned and I don't really care about the type. ISTM that NULL should
be able to morph into any type it needs to.
I don't think that's necessarily true.
As a potentially abs
On Thu, 24 Jul 2003, Joe Conway wrote:
> Tom Lane wrote:
> > Joe Conway <[EMAIL PROTECTED]> writes:
> >>So far so good. But look at this one:
> >>regression=# select dwarray(null,null);
> >>ERROR: cannot determine ANYARRAY/ANYELEMENT type because input is UNKNOWN
> >
> > That seems correct to me
Joe Conway <[EMAIL PROTECTED]> writes:
> Tom Lane wrote:
>> We could probably hack the inlining logic to prevent it from inlining
>> the function in this scenario, but I wonder whether this doesn't say
>> that ExecEvalArray is behaving inconsistently. In other operations, any
>> NULL in means NULL
Marcus B?rger wrote:
> >> BM> I don't see why you wouldn't just do BEGIN;COMMIT;RESET ALL; when you
> >> BM> pass the connection to a new client.
> >>
> >>
> >> Bruce you said RESET ALL is available since 7.2. I am currently checking for
> >> the lib version but it would be more correct to check
Tom Lane wrote:
Joe Conway <[EMAIL PROTECTED]> writes:
So far so good. But look at this one:
regression=# select dwarray(null,null);
ERROR: cannot determine ANYARRAY/ANYELEMENT type because input is UNKNOWN
That seems correct to me. What would you expect to happen? There's no
type we could assig
--On Thursday, July 24, 2003 16:30:14 -0400 Bruce Momjian
<[EMAIL PROTECTED]> wrote:
Peter Eisentraut wrote:
Larry Rosenman writes:
> I beg to differ. Explicitly, on UnixWare, the header,
> reproduced below, under fair use, show an EXPLICIT difference in what
> happens with _REENTRANT:
Hmm,
Peter Eisentraut wrote:
> Larry Rosenman writes:
>
> > I beg to differ. Explicitly, on UnixWare, the header,
> > reproduced below, under fair use, show an EXPLICIT difference in what
> > happens with _REENTRANT:
>
> Hmm, I was too optimistic. I guess we'll just have to handcraft a
> different
may be there could be option (while compiling) to database for many users,
like in normal public servers where everyone has own db, and option to
postgres for one database with may users (like in comrporation etc )
Defferences should be also in initdb , when pg_catalog is created
and sth like de
The Hermit Hacker <[EMAIL PROTECTED]> writes:
> Please check it over before I announce it more generally ... but she looks
> good from here ..
Almost there: src/backend/utils/adt/date.c is one rev behind where it
should be. Looks like you checked out before I applied that fix from
Joe Conway.
I'm trying to keep a variable around for the duration of a transaction.
Unfortunately, the "SET LOCAL" command doesnt allow me to create my own
variable. Also, the "CREATE TEMP TABLE ... ON COMMIT DELETE ROWS" isnt
yet implemented.
But, I believe I can implement it using a TEMP table like this
Joe Conway <[EMAIL PROTECTED]> writes:
> So far so good. But look at this one:
> regression=# select dwarray(null,null);
> ERROR: cannot determine ANYARRAY/ANYELEMENT type because input is UNKNOWN
That seems correct to me. What would you expect to happen? There's no
type we could assign as the
Sorry to bother you again but i am having a real hard time getting stats
from the relation. What i have is a shared memory linked list of
relfilenodes. I simply want to get the stats of all these relations and
add them up. I was using pgstat_fetch_stat_tabentry(relid) as an sql
statement and this w
On Thu, Jul 24, 2003 at 10:17:06AM -0700, Adam Haberlach wrote:
> So, one of the many machines that I support seems to have developed
> an incredibly odd and specific corruption that I've never seen before.
>
> Whenever a query requiring an aggregate is attempted, it spits out:
> cannot open
I created a function thus:
CREATE OR REPLACE FUNCTION dwarray(anyelement, anyelement)
RETURNS anyarray AS '
SELECT ARRAY[$1,$2]
' LANGUAGE 'sql' IMMUTABLE STRICT;
My hope was to use STRICT to get the following behavior: if either or
both arguments are NULL, I get a NULL. If both are non-NULL, I
Please check it over before I announce it more generally ... but she looks
good from here ..
Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: [EMAIL PROTECTED] secondary: [EMAIL PROTECTED]|postgresql}.org
--
Adam Haberlach <[EMAIL PROTECTED]> writes:
> Whenever a query requiring an aggregate is attempted, it spits out:
> cannot open pg_aggregate: No such file or directory
> and fails.
Weird. It would be useful to find out exactly what pathname it's trying
to open. strace'ing the backend might be the
On Thu, 24 Jul 2003, Adam Haberlach wrote:
> So, one of the many machines that I support seems to have developed
> an incredibly odd and specific corruption that I've never seen before.
>
> Whenever a query requiring an aggregate is attempted, it spits out:
> cannot open pg_aggregate: No su
Adam Haberlach <[EMAIL PROTECTED]> writes:
> So, one of the many machines that I support seems to have developed
> an incredibly odd and specific corruption that I've never seen before.
>
> Whenever a query requiring an aggregate is attempted, it spits out:
> cannot open pg_aggregate: No su
So, one of the many machines that I support seems to have developed
an incredibly odd and specific corruption that I've never seen before.
Whenever a query requiring an aggregate is attempted, it spits out:
cannot open pg_aggregate: No such file or directory
and fails.
If I do:
select * f
On Thu, Jul 24, 2003 at 00:32:32 +0200,
ivan <[EMAIL PROTECTED]> wrote:
>
> When ie function is whitout any grant == public have grant to execute it.
> public or user who have grant to usage on this func. namepsace.
>
> I think when i create function , the default grant should be only for
> own
> Better remove transactions then, yeah? Performace hit! Profile it and
> see how minor (or likely non-existent) it is...
You can do that. Turn fsync to off and you remove a large majority of
the transaction hit, but I understand what you're saying.
signature.asc
Description: This is a digitall
Peter Eisentraut writes:
> Larry Rosenman writes:
> > I beg to differ. Explicitly, on UnixWare, the header,
> > reproduced below, under fair use, show an EXPLICIT difference in what
> > happens with _REENTRANT:
> Hmm, I was too optimistic. I guess we'll just have to handcraft a
> different
Larry Rosenman writes:
> I beg to differ. Explicitly, on UnixWare, the header,
> reproduced below, under fair use, show an EXPLICIT difference in what
> happens with _REENTRANT:
Hmm, I was too optimistic. I guess we'll just have to handcraft a
different solution for each platform. But clearly
Bruce Momjian writes:
> Peter Eisentraut wrote:
> > Bruce Momjian writes:
> > > THREAD_CFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
> > Those flags are bogus. You don't need any flags under Linux.
> Is that true for all versions of Linux? Don't we need the first one so
>
--On Thursday, July 24, 2003 17:21:17 +0200 Peter Eisentraut
<[EMAIL PROTECTED]> wrote:
Bruce Momjian writes:
Now I see what you are saying, that _REENTRANT just makes it reentrant,
_REENTRANT only makes additional functions visible in the header files, it
doesn't change any functions to behav
On Wed, 23 Jul 2003, Larry Rosenman wrote:
> Date: Wed, 23 Jul 2003 15:22:49 -0500
> From: Larry Rosenman <[EMAIL PROTECTED]>
> To: Robert Treat <[EMAIL PROTECTED]>
> Cc: Josh Berkus <[EMAIL PROTECTED]>, [EMAIL PROTECTED],
> pgsql-hackers list <[EMAIL PROTECTED]>
> Subject: Re: [HACKERS] Feat
Peter Eisentraut wrote:
> Bruce Momjian writes:
>
> > Now I see what you are saying, that _REENTRANT just makes it reentrant,
>
> _REENTRANT only makes additional functions visible in the header files, it
> doesn't change any functions to behave differently. (This is not hard to
> imagine, becau
Bruce Momjian writes:
> Now I see what you are saying, that _REENTRANT just makes it reentrant,
_REENTRANT only makes additional functions visible in the header files, it
doesn't change any functions to behave differently. (This is not hard to
imagine, because the lack of reentrancy of most func
Bruce Momjian writes:
> However, notice the flags needed under Linux:
>
> THREAD_CFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
>
> or are you saying libpq needs only the first one because libpq, itself,
> doesn't use threads --- interesting distinction, and perhaps a
Bruce Momjian <[EMAIL PROTECTED]> writes:
> Now I see what you are saying, that _REENTRANT just makes it reentrant,
> and doesn't have a downside in terms of performance.
That's at best an unsupported assertion. Why would the platform bother
with supplying two copies of libc if they didn't think
Tom Lane writes:
> Bruce Momjian <[EMAIL PROTECTED]> writes:
> > Now I see what you are saying, that _REENTRANT just makes it reentrant,
> > and doesn't have a downside in terms of performance.
> That's at best an unsupported assertion. Why would the platform bother
> with supplying two copie
Lee Kindness wrote:
> Tom Lane writes:
> > Lee Kindness <[EMAIL PROTECTED]> writes:
> > > Bruce Momjian writes:
> > >>> My guess is that if the OS has separate threaded libs, we have to mimic
> > >>> that stuff.
> > > But there are NO thread primitives/calls in libpq
> > That's not the point
Tom Lane writes:
> If the OS supplies both libc and libc_r, it is unlikely to be a good
> idea to link a threaded libpq with libc, or a non-threaded libpq with
> libc_r.
What modern OS has libc_r? The majors (Linux, Soalris, HPUX, AIX)
certainly do not.
L.
---(end of b
"Francisco Figueiredo Jr." <[EMAIL PROTECTED]> writes:
> I just wanted void functions behave like others when called as select *
> from voidfunction So I dont have to do select voidfunction. :)
It's not only void functions that fail --- I believe the code will
reject any pseudo-type, which inclu
Peter Eisentraut wrote:
> Bruce Momjian writes:
>
> > The strange thing is that accoring to template/freebsd, libc_r was
> > _added_ in FreeBSD 5.0, while most OS are moving away from separate
> > threaded libs.
>
> The template is wrong. libc_r has existed in FreeBSD for quite a while,
> but yo
Tom Lane writes:
> Lee Kindness <[EMAIL PROTECTED]> writes:
> > Bruce Momjian writes:
> >>> My guess is that if the OS has separate threaded libs, we have to mimic
> >>> that stuff.
> > But there are NO thread primitives/calls in libpq
> That's not the point. The point is stuff that isn't n
Bruce Momjian writes:
> The strange thing is that accoring to template/freebsd, libc_r was
> _added_ in FreeBSD 5.0, while most OS are moving away from separate
> threaded libs.
The template is wrong. libc_r has existed in FreeBSD for quite a while,
but your're not supposed to use it directly.
Nigel J. Andrews wrote:
On Tue, 22 Jul 2003, Francisco Figueiredo Jr. wrote:
How's this for an alternative if you really don't want any rows returned:
create function fincF ( ) returns setof integer as '
begin
delete from blah;
return;
end;
' language 'plpgsql';
This works, but what I rea
Lee Kindness <[EMAIL PROTECTED]> writes:
> Bruce Momjian writes:
>>> My guess is that if the OS has separate threaded libs, we have to mimic
>>> that stuff.
> But there are NO thread primitives/calls in libpq
That's not the point. The point is stuff that isn't necessarily visible
in the source
Lee Kindness writes:
> Guys, take a look at what was done in libpq to make it
> thread-safe... No locks! No overheaded - just using "proper" reentrant
> functions...
There is a difference between being reentrant and being thread-safe.
Making libpq reentrant is relatively easy if you use the right
On 24 Jul 2003 at 8:59, Bruce Momjian wrote:
> Shridhar Daithankar wrote:
> > FreeBSD and windows..:-) Two I know of..
>
> The strange thing is that accoring to template/freebsd, libc_r was
> _added_ in FreeBSD 5.0, while most OS are moving away from separate
> threaded libs.
Well, I have used l
--On Thursday, July 24, 2003 08:52:37 -0400 Bruce Momjian
<[EMAIL PROTECTED]> wrote:
Lee Kindness wrote:
Guys, take a look at what was done in libpq to make it
thread-safe... No locks! No overheaded - just using "proper" reentrant
functions...
If we have libpq_r then we're making a complete has
Bruce Momjian writes:
> Lee Kindness wrote:
> > Guys, take a look at what was done in libpq to make it
> > thread-safe... No locks! No overheaded - just using "proper" reentrant
> > functions...
> > If we have libpq_r then we're making a complete hash of it all - being
> > reentrant is good,
Rod Taylor <[EMAIL PROTECTED]> writes:
> It may be best to have a locking manager run as a separate process.
> That way it could store locks in ram or spill over to disk.
Hmm, that might be workable. We could imagine that in place of the
HEAP_MARKED_FOR_UPDATE status bit, we have a "this row is
Shridhar Daithankar wrote:
> On 23 Jul 2003 at 13:35, Bruce Momjian wrote:
> > I thought glibc was the one to introduce libc_r in the first place ---
> > are they making libc thread-safe now?
>
> AFAIK, glibc plays all threadsafe in glibc2. Don't know prior to that. Of
> course they do record if
Lee Kindness wrote:
> Guys, take a look at what was done in libpq to make it
> thread-safe... No locks! No overheaded - just using "proper" reentrant
> functions...
>
> If we have libpq_r then we're making a complete hash of it all - being
> reentrant is good, even if you're not using threads!
>
> > You want to process all invoices to count them and to sum up the
> > amounts on a per month/area/type basis. The initial data size is in
> > GB, but the size of the expected result is in KB (namely 2 data for
> > each 100 areas * 12 months * 4 types).
>
> The key to handling large datasets for
Hello,
> > FOR tuple IN
> > SELECT area, type, month, amount FROM client, invoice WHERE id=client
> > LOOP
> > UPDATE tmp SET amount=amount+tuple.amount, count=count+1
> > WHERE area=tuple.area AND type=tuple.type AND month=tuple.month
> > END LOOP;
> > ...
> >
> > It is very SLOO
On Wed, Jul 23, 2003 at 12:53:34PM -0400, Tom Lane wrote:
> Patrick Welche <[EMAIL PROTECTED]> writes:
> > On a different note, I also wonder about:
> >
> > M src/backend/parser/gram.c
> >
> > It seems that you checkout the source with no gram.c. Build it, thus creating
> > gram.c. Next time you
On Thu, 2003-07-24 at 02:45, Sailesh Krishnamurthy wrote:
> > "Tom" == Tom Lane <[EMAIL PROTECTED]> writes:
>
> Tom> That doesn't work, unless you insist that the first backend
> Tom> can't exit its transaction until all the other ones are done.
> Tom> Which introduces its own poss
Guys, take a look at what was done in libpq to make it
thread-safe... No locks! No overheaded - just using "proper" reentrant
functions...
If we have libpq_r then we're making a complete hash of it all - being
reentrant is good, even if you're not using threads!
Now, ecpg is another issue...
L.
73 matches
Mail list logo