Re: [GENERAL] Group By and wildcards...

2005-02-19 Thread Bruno Wolff III
On Sat, Feb 19, 2005 at 14:02:34 -0500, Oisin Glynn <[EMAIL PROTECTED]> wrote: > > But the where clause defines the result of the aggregate function (in this > case the SUM)? Not really. > Is the only reason for needing the GROUP BY CLAUSE is because the aggregate > function demands it? Note

Re: [GENERAL] Client lib v. 7.3 to access 8.0 db server. Compatible ?

2005-02-19 Thread Reuben D. Budiardja
On Saturday 19 February 2005 12:38, Robby Russell wrote: > On Sat, 2005-02-19 at 10:02 -0500, Reuben D. Budiardja wrote: > > Hello, > > I mainly use PHP to access my database. The PHP in the server is compiled > > with postgreSQL client lib v. 7.3. I am planning to upgrade my database > > server (o

Re: [GENERAL] Group By and wildcards...

2005-02-19 Thread Greg Stark
Bruno Wolff III <[EMAIL PROTECTED]> writes: > On Sat, Feb 19, 2005 at 12:07:12 -0200, > Jon Lapham <[EMAIL PROTECTED]> wrote: > > > > SELECT a.*, b.*, c.*, SUM(d.blah) > > FROM a, b, c, d > > WHERE > > GROUP BY a.*, b.*, c.* > > > > Instead of having to expand the "GROUP BY a.*, b.*, c.*" usi

Re: [GENERAL] Group By and wildcards...

2005-02-19 Thread Oisin Glynn
This is a very NEWBIE suggestion. I am fully prepared to be laughed out of town... But the where clause defines the result of the aggregate function (in this case the SUM)? Is the only reason for needing the GROUP BY CLAUSE is because the aggregate function demands it? If so could something lik

Re: [GENERAL] PGSQL 8.0.1 Win 2K Installation Problem

2005-02-19 Thread S.D.
I downloaded the PostGreSQL Windows installer from another FTP site but I still ended up with the same arcane error message when I tried to install PostGreSQL 8.0.1 on W2K running inside Virtual PC 6 (Macintosh). I then ran the installer on a "real" computer (Athlon 1900 running W2K) and the i

[GENERAL] quoting internal variable names

2005-02-19 Thread Ron Peterson
Hi, I'm trying to use PostgreSQL's internal variables to simplify some shell scripting database setup stuff. Single quotes appear to behave differently in diffent contexts. CREATE USER :v_dbadmin WITH PASSWORD ':v_dbpass'; CREATE USER CREATE USER worked o.k. CREATE DATABASE :v_dbna

Re: [GENERAL] quoting internal variable names

2005-02-19 Thread Ron Peterson
On Sat, Feb 19, 2005 at 05:30:25PM -0500, Ron Peterson wrote: > Hi, > > I'm trying to use PostgreSQL's internal variables to simplify some shell > scripting database setup stuff. Single quotes appear to behave > differently in diffent contexts. I decided to just do the proper quoting within the

[GENERAL] Returning 0 rows from a PL/PGSQL

2005-02-19 Thread Vitaly Belman
I have the following plpgsql function: CREATE OR REPLACE FUNCTION public."temp"(int4) RETURNS public.books AS $BODY$DECLARE old_book books%rowtype; BEGIN select * into old_book from books where book_id = var_book_id; IF FOUND = false THEN return

Re: [GENERAL] PGSQL 8.0.1 Win 2K Installation Problem

2005-02-19 Thread Jonel Rienton
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 just to let you know, i got the same error message when i tried it on my win2k inistall emulated by Virtual PC 7. - - Jonel Rienton http://blogs.road14.com Software Developer, *nix Advocate On Feb 19, 2005, at 1:14 PM, S.D. wrote: > > I download

Re: [GENERAL] quoting internal variable names

2005-02-19 Thread Peter Eisentraut
Ron Peterson wrote: > Single quotes appear to behave > differently in diffent contexts. > > CREATE USER > :v_dbadmin > WITH PASSWORD > ':v_dbpass'; This sets your password to ":v_dbpass", which is probably not what you wanted. Your next message contains the correct solution: include the quo

Re: [GENERAL] Returning 0 rows from a PL/PGSQL

2005-02-19 Thread Stephan Szabo
On Sun, 20 Feb 2005, Vitaly Belman wrote: > I have the following plpgsql function: > > CREATE OR REPLACE FUNCTION public."temp"(int4) > RETURNS public.books AS > $BODY$DECLARE > old_book books%rowtype; > BEGIN > select * into old_book from books > where book_id = var_book_id; >

Re: [GENERAL] PGSQL 8.0.1 Win 2K Installation Problem

2005-02-19 Thread John DeSoi
On Feb 19, 2005, at 2:14 PM, S.D. wrote: I downloaded the PostGreSQL Windows installer from another FTP site but I still ended up with the same arcane error message when I tried to install PostGreSQL 8.0.1 on W2K running inside Virtual PC 6 (Macintosh). Does Virtual PC 6 really emulate NTFS driv

Re: [GENERAL] PGSQL 8.0.1 Win 2K Installation Problem

2005-02-19 Thread Doug McNaught
John DeSoi <[EMAIL PROTECTED]> writes: > On Feb 19, 2005, at 2:14 PM, S.D. wrote: > >> I downloaded the PostGreSQL Windows installer from another FTP site >> but I still ended up with the same arcane error message when I tried >> to install PostGreSQL 8.0.1 on W2K running inside Virtual PC 6 >> (M

[GENERAL] Triggers, again.. ;-)

2005-02-19 Thread Net Virtual Mailing Lists
Hello, I have asked about this before, but I just haven't been able to get anywhere with it yet.. I'm hoping someone can help me? Here is my original function and trigger: CREATE OR REPLACE VIEW items_category AS select count(*) AS count ,b.category,nlevel(b.category) AS level, subpath(b.cate

Re: [GENERAL] quoting internal variable names

2005-02-19 Thread Tom Lane
Ron Peterson <[EMAIL PROTECTED]> writes: > So it seems like the single quotes are causing :v_encoding to be read as > a string literal for ENCODING, but they don't do that for WITH PASSWORD. Yeah, they behave the same in both cases. If you'd experimented you would have found that the password was

Re: [GENERAL] PGSQL 8.0.1 Win 2K Installation Problem

2005-02-19 Thread Tom Lane
"S.D." <[EMAIL PROTECTED]> writes: > I downloaded the PostGreSQL Windows installer from another FTP site but I > still ended up with the same arcane error message when I tried to install > PostGreSQL 8.0.1 on W2K running inside Virtual PC 6 (Macintosh). > I then ran the installer on a "real" com

Re: [GENERAL] I'm newbie

2005-02-19 Thread Richard Huxton
Mohsen Pahlevanzadeh wrote: Dear Richard: 1.Thank you for reply 2.Dear Richard,I must write a Makefile for my client packge.But i don't know on pgsql's library & path of its include-files. Depends on how you installed PostgreSQL. If it's via RPM then you can see what files are installed with "rpm

Re: [GENERAL] PostgreSQL scaleability question

2005-02-19 Thread Christopher Browne
Centuries ago, Nostradamus foresaw when [EMAIL PROTECTED] ("Wang, Mary Y") would write: > I have been using PostgreSQL for my project repository, because it > is free and easy to use.  My manager is trying to decide if he > should use a commerical database such as Oracle or PostgreSQL for a > gain

Re: [GENERAL] Newbie: PG8 and text file parsing

2005-02-19 Thread Christopher Browne
[EMAIL PROTECTED] (Paul R) wrote: > I need some advice.. I am new to PG8 - I am working on the project > that needs to load data daily to PostgreSQL from the text file.. the > text file is 40MB comma delimited file with row consisting of 20-30 > fields and couple thousands of rows.. > > so the data

[GENERAL] Group By and wildcards...

2005-02-19 Thread Jon Lapham
When using queries with aggregate functions, is there any way to not have to have to explicitly write all the columns names after the GROUP BY ? I would like to use a wildcard "*". Imagine tables a, b, c, d each with hundreds of columns. As an example, I would like to write: SELECT a.*, b.*, c.

[GENERAL] Client lib v. 7.3 to access 8.0 db server. Compatible ?

2005-02-19 Thread Reuben D. Budiardja
Hello, I mainly use PHP to access my database. The PHP in the server is compiled with postgreSQL client lib v. 7.3. I am planning to upgrade my database server (on other machine) to version 8.0. Do I need to recompile PHP to use 8.0 client, or is it compatible ? I would rather not recompile my

Re: [GENERAL] I'm newbie

2005-02-19 Thread Mohsen Pahlevanzadeh
> Mohsen Pahlevanzadeh wrote: >> Dear Richard: >> 1.Thank you for reply >> 2.Dear Richard,I must write a Makefile for my client packge.But i don't >> know on pgsql's library & path of its include-files. > > Depends on how you installed PostgreSQL. If it's via RPM then you can > see what files are i

Re: [GENERAL] PostgreSQL scaleability question

2005-02-19 Thread Matthew T. O'Connor
Christopher Browne wrote: Centuries ago, Nostradamus foresaw when [EMAIL PROTECTED] ("Wang, Mary Y") would write: I have been using PostgreSQL for my project repository, because it is free and easy to use. My manager is trying to decide if he should use a commerical database such as Oracle or P

Re: [GENERAL] Group By and wildcards...

2005-02-19 Thread Bruno Wolff III
On Sat, Feb 19, 2005 at 12:07:12 -0200, Jon Lapham <[EMAIL PROTECTED]> wrote: > When using queries with aggregate functions, is there any way to not > have to have to explicitly write all the columns names after the GROUP > BY ? I would like to use a wildcard "*". > > Imagine tables a, b, c,

Re: [GENERAL] I'm newbie

2005-02-19 Thread Daniel Verite
Mohsen Pahlevanzadeh wrote: > 2.Dear Richard,I must write a Makefile for my client packge.But i don't > know on pgsql's library & path of its include-files. You can call pg_config in your makefile. See http://www.postgresql.org/docs/7.4/static/app-pgconfig.html or man pg_config -- Dani

[GENERAL] How do I change sort order behavious with nulls

2005-02-19 Thread charlie clark
Dear list, is there a simple way to change the way ORDER BY works on columns with NULLs? I can understand the need for default behaviour but there must be cases when this is undesirable. I have such a query with the NULLs arising as the result of an OUTER JOIN and I would like to ORDER BY DESC w

Re: [GENERAL] Client lib v. 7.3 to access 8.0 db server.

2005-02-19 Thread Robby Russell
On Sat, 2005-02-19 at 10:02 -0500, Reuben D. Budiardja wrote: > Hello, > I mainly use PHP to access my database. The PHP in the server is compiled > with > postgreSQL client lib v. 7.3. I am planning to upgrade my database server (on > other machine) to version 8.0. Do I need to recompile PHP to

Re: [GENERAL] How do I change sort order behavious with nulls

2005-02-19 Thread Tom Lane
charlie clark <[EMAIL PROTECTED]> writes: > is there a simple way to change the way ORDER BY works on columns with > NULLs? No, but you can do something like ORDER BY foo IS NOT NULL, foo DESC to make the nulls come first. regards, tom lane

Re: [GENERAL] Group By and wildcards...

2005-02-19 Thread Tom Lane
Bruno Wolff III <[EMAIL PROTECTED]> writes: > Jon Lapham <[EMAIL PROTECTED]> wrote: >> When using queries with aggregate functions, is there any way to not >> have to have to explicitly write all the columns names after the GROUP >> BY ? I would like to use a wildcard "*". > Don't those table

Re: [GENERAL] How do I change sort order behavious with nulls

2005-02-19 Thread Bruno Wolff III
On Sat, Feb 19, 2005 at 18:04:32 +0100, charlie clark <[EMAIL PROTECTED]> wrote: > Dear list, > > is there a simple way to change the way ORDER BY works on columns with > NULLs? I can understand the need for default behaviour but there must be > cases when this is undesirable. I have such a qu

Re: [GENERAL] Client lib v. 7.3 to access 8.0 db server. Compatible

2005-02-19 Thread Frank Finner
Hi, I upgraded PostgreSQL from 7.3 via 7.4 to 8.0.1 and always used the same self compiled PHP module (well, of course I did some upgrading of PHP during that time, but never in relation to PostgreSQL releases and not between PostgreSQL releases 7.4.5 and 8.0.1), and everything worked and still wo

Re: [GENERAL] Group By and wildcards...

2005-02-19 Thread Bruno Wolff III
On Sat, Feb 19, 2005 at 12:40:40 -0500, Tom Lane <[EMAIL PROTECTED]> wrote: > Bruno Wolff III <[EMAIL PROTECTED]> writes: > > Jon Lapham <[EMAIL PROTECTED]> wrote: > >> When using queries with aggregate functions, is there any way to not > >> have to have to explicitly write all the columns na

Re: [GENERAL] Group By and wildcards...

2005-02-19 Thread Jon Lapham
Tom Lane wrote: Bruno Wolff III <[EMAIL PROTECTED]> writes: Jon Lapham <[EMAIL PROTECTED]> wrote: When using queries with aggregate functions, is there any way to not have to have to explicitly write all the columns names after the GROUP BY ? I would like to use a wildcard "*". Don't those tab

Re: [GENERAL] Group By and wildcards...

2005-02-19 Thread Bruno Wolff III
On Sat, Feb 19, 2005 at 15:59:52 -0200, Jon Lapham <[EMAIL PROTECTED]> wrote: > > Since I do not want to have to re-write all my aggregate function > containing queries upon modifications to the table definitions (and I do > not want to write multi-thousand character long SELECT statements),

Re: [GENERAL] Group By and wildcards...

2005-02-19 Thread Russ Brown
Jon Lapham wrote: Ugh. Since I do not want to have to re-write all my aggregate function containing queries upon modifications to the table definitions (and I do not want to write multi-thousand character long SELECT statements), maybe it is easier to use a temp table intermediary? Ugly... ugl