Re: [SQL] BOOLEAN question

2002-10-28 Thread Stephan Szabo
On Mon, 28 Oct 2002, Josh Berkus wrote: > Stephan, > > > Well, you might be better off making a max(bool), but a not > > super-efficient version might be: > > max(case when col then 1 else 0 end)=1 > > Good, I'm not just brain-dead. I did figure out another way to do it, but if > I wrote a MAX(

Re: [SQL] BOOLEAN question

2002-10-28 Thread Josh Berkus
Stephan, > Well, you might be better off making a max(bool), but a not > super-efficient version might be: > max(case when col then 1 else 0 end)=1 Good, I'm not just brain-dead. I did figure out another way to do it, but if I wrote a MAX(bool), what are the chances it would get added to the

Re: [SQL] BOOLEAN question

2002-10-28 Thread Stephan Szabo
On Mon, 28 Oct 2002, Josh Berkus wrote: > Odd question: I have a query that returns a set of none to several rows. One > column in these rows is BOOLEAN. I want the query to return: > 1) TRUE if *any* of the BOOLEAN values is TRUE; > 2) FALSE if *all* of the BOOLEAN values are FALSE; > 3) FALSE

[SQL] BOOLEAN question

2002-10-28 Thread Josh Berkus
Folks, Odd question: I have a query that returns a set of none to several rows. One column in these rows is BOOLEAN. I want the query to return: 1) TRUE if *any* of the BOOLEAN values is TRUE; 2) FALSE if *all* of the BOOLEAN values are FALSE; 3) FALSE or NULL if no rows are returned. I thoug

Re: [SQL] subscrip out of range

2002-10-28 Thread Chad Thompson
"subscript out of range" is an error that means you are trying to access part of an array that doesnt exist. It probably means that your data doesnt have all the fields for all the records. Check to see if your data is truncated or if there is an unusual (usually shortened) number of fields in a g

[SQL] psql history

2002-10-28 Thread [EMAIL PROTECTED]
Hi everibody, i have installed Postgres 7.2.2 from a tarball, but using psql i can not have the history of the last command. When i used Postgres from rpm this useful element worked very well! Why that? Best Regards Massimo Arnaudo ---(end of broadcast)--

Re: [SQL] VACUUM and locking

2002-10-28 Thread Tom Lane
"Denise Bossarte" <[EMAIL PROTECTED]> writes: > I have looked at the documentation on locking and VACUUM and have found > conflicting reports. > http://www.postgresql.org/idocs/index.php?locking-tables.html states that > VACUUM (without FULL) acquires a ShareUpdateExclusiveLock and VACUUM with > F

Re: [SQL] Accumulated sums in SQL query

2002-10-28 Thread Marek Bartnikowski
I think,that is not good solution. What will happen when some records have the same date? I suggest to operate on rowid or something like thaţ (maybe some serial?) and everything will be good. But, when each row has different date, its good :) regards. marek On Mon, Oct 28, 2002 at 03:55:46PM +010

Re: [SQL] Accumulated sums in SQL query

2002-10-28 Thread Kabai József
Thank you Christoph this logic helped me a lot. Regards Joseph - Original Message - From: "Christoph Haller" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, October 28, 2002 1:27 PM Subject: Re: [SQL] Accumulated sums in SQL query > > > > OK I have a tab

Re: [SQL] CoreReader

2002-10-28 Thread Roberto Mello
On Fri, Oct 25, 2002 at 10:32:00PM -0500, John Ragan wrote: > > Does anybody know of CoreReader being run against > PostGresql? > > If so, I would appreciate knowing the results. What's CoreReader? -Roberto -- +|Roberto Mello -http://www.brasileiro.net/ |--+ +

Re: [SQL] multiple databases

2002-10-28 Thread Roberto Mello
On Sat, Oct 26, 2002 at 03:15:18PM +1000, peter wrote: > I need to create a recordset in vb which combines a view/table from 2 > different databases. Is this possible? in mssql you could go > dbo.databasename.tablename. Can it be done in vb code? There's an extension to PostgreSQL, called dblin

Re: [SQL] Hairy question - transpose columns

2002-10-28 Thread mark carew
Hi Andres, For mine, I would read the data in using any langauage that I was familiar with and parse it into an array or some other form in the required format then create the "copy" statement for postgresql, connect and apply. Regards Mark ---(end of broadcast)

[SQL] multiple databases

2002-10-28 Thread peter
I need to create a recordset in vb which combines a view/table from 2 different databases. Is this possible? in mssql you could go dbo.databasename.tablename. Can it be done in vb code? Thanks for any help Peter ---(end of broadcast)--- TIP 2:

[SQL] subscrip out of range

2002-10-28 Thread peter
i am getting this error when iimport data using the pgaccess client from a txt file. I will import some records then crash out. Any IDeas? has it got anything to do with the primary key on the destination table and if so how do you temporaryily disable it Thanks for any hellp PEter

Re: [SQL] Foreign character struggles

2002-10-28 Thread Tony Grant
On Fri, 2002-10-25 at 15:33, Tim Perdue wrote: > I compiled postgres with --enable-multibyte and --enable-recode, and it > doesn't appear to help with my problem. createdb my_db_name -E LATIN1 Worked just fine for me but the client wanted to be able to search with accents so I turned the to_ascii

[SQL] CoreReader

2002-10-28 Thread John Ragan
Does anybody know of CoreReader being run against PostGresql? If so, I would appreciate knowing the results. -- John Ragan [EMAIL PROTECTED] http://www.CoreReader.com/ ---(end of broadcast)--- TIP 6: Have you searche

[SQL] VACUUM and locking

2002-10-28 Thread Denise Bossarte
I am trying to automate VACUUMing several databases and am confused on how client connections to the database might affect the VACUUM. I have looked at the documentation on locking and VACUUM and have found conflicting reports. The 7.2.1 Documentation http://www.postgresql.org/idocs/index.php?loc

Re: [SQL] Accumulated sums in SQL query

2002-10-28 Thread Christoph Haller
> > OK I have a table named bank_account_movements containing two columns = > date and amount: > > date amount (in USD) > - > 2002-10-01 20 > 2002-10-02 30 > 2002-10-03 -15 > 2002

Re: [SQL] Accumulated sums in SQL query

2002-10-28 Thread Kabai József
Thanks, but it seems not to be the solution to me, the example was not good enough. The table for example represents a bank account, records are debits and credits, and I need the balance in the new query: D&C balance --- 11 34 -2 2 5

Re: [SQL] Accumulated sums in SQL query

2002-10-28 Thread Christoph Haller
> Which is the simplest way to create an SQL query to get accumulated sums of > records like this (from the table containing the numbers): > > numbersums > --- > 1 1 > 2 3 > 3 6 > 4 10 > SELECT number, SUM(your_sum_column) FROM

[SQL] Accumulated sums in SQL query

2002-10-28 Thread Kabai József
Hi, Which is the simplest way to create an SQL query to get accumulated sums of records like this (from the table containing the numbers): numbersums --- 1 1 2 3 3 6 4 10 Thanks in advance Regards, Joseph