[SQL] force command execution

2005-04-15 Thread drdani
Hi, Let's suppose I have a plpgsql function like: ... begin alter ... ...; insert ... ...; create ... ...; drop ...; and lot of such commands in any order... end; ... (There is no "perform" keyword.) Sometimes "ALTER" failes beco

[SQL] Combining values in a column

2005-04-15 Thread Stephen Quinney
I have a query which returns a single column of integers which I want to combine together with &, "bitwise AND". Basically it's a simple list of access levels that a user might have and I want to merge the list into one value. There can be zero, one or more values in the list so I have to be able t

Re: [SQL] Combining values in a column

2005-04-15 Thread Sean Davis
See below for creating aggregates: http://www.postgresql.org/docs/current/static/xaggr.html But, there is a useful function built-in, bit_and, that does what you want: http://www.postgresql.org/docs/current/static/functions- aggregate.html#FUNCTIONS-AGGREGATE-TABLE create table testint (

[SQL]

2005-04-15 Thread TJ O'Donnell
There some documentation about aggregate functions in the manual, for example: http://www.postgresql.org/docs/7.4/static/sql-createaggregate.html Here's a simple agg function that should work for you, assuming your col types are int4. CREATE AGGREGATE andsum ( sfunc = int4and, basetype = int4,

[SQL] send mail from Postgres using PLTCLU language.

2005-04-15 Thread Dinesh Pandey
How to send mail from Postgres using PLTCLU language.   I am able to send mail, but I want to know how to add "Cc" option also. (Program attached below)   How to add "Cc"  (Right now containd "From", "To", "Subject" and "Message"). ---

Re: [SQL] send mail from Postgres using PLTCLU language.

2005-04-15 Thread Dinesh Pandey
After using puts $mySock "rcpt cc: [EMAIL PROTECTED]" I am able to send mail as Cc: also. Thanks Dinesh Pandey   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dinesh PandeySent: Friday, April 15, 2005 6:18 PMTo: 'PostgreSQL'Subject: [SQL] send mail from Postgres using P

Re: [SQL] row-attribute in EXPLAIN-output doesn't match count(*)

2005-04-15 Thread Markus Schaber
Hi, Andreas, Andreas Joseph Krogh schrieb: >>>So, what you're suggesting is that a restart of the webapp should make >>>vacuum able to delete those dead rows? >>Yes, but that'll only solve your problem for now. You'll have the >>problem again soon. What's keeping open the transaction? > Don't k

Re: [SQL] row-attribute in EXPLAIN-output doesn't match count(*)

2005-04-15 Thread Andreas Joseph Krogh
On Friday 15 April 2005 18:22, Markus Schaber wrote: > Hi, Andreas, > > Andreas Joseph Krogh schrieb: > >>>So, what you're suggesting is that a restart of the webapp should make > >>>vacuum able to delete those dead rows? > >> > >>Yes, but that'll only solve your problem for now. You'll have the >

Re: [SQL] row-attribute in EXPLAIN-output doesn't match count(*)

2005-04-15 Thread Markus Schaber
Hi, Andrew, Andrew Sullivan schrieb: > Nope. That's a problem with your pool software. It's no doubt > issuing "BEGIN;" as soon as it connects. This problem may as well be caused by some versions of the postgresql jdbc driver, no need to blame the pool software. This is fixed with the current

Re: [SQL] row-attribute in EXPLAIN-output doesn't match count(*)

2005-04-15 Thread Markus Schaber
Hi, Andreas, Andreas Joseph Krogh schrieb: >>Could you try the latest postgresql-8.0-311.jdbcX.jar? The current >>versions should solve the idle in transaction problem, the previous ones >>tended to issue BEGIN; just after every COMMIT, so there's always an >>open transaction. > I could, but is i

Re: [SQL] row-attribute in EXPLAIN-output doesn't match count(*)

2005-04-15 Thread Andreas Joseph Krogh
On Friday 15 April 2005 18:34, Markus Schaber wrote: > Hi, Andreas, > > Andreas Joseph Krogh schrieb: > >>Could you try the latest postgresql-8.0-311.jdbcX.jar? The current > >>versions should solve the idle in transaction problem, the previous ones > >>tended to issue BEGIN; just after every COMMI