Re: [GENERAL] hierarchy select question?

2000-08-03 Thread Craig Johannsen
Joe Selko's book SQL for Smarties (Morgan Kaufmann, 1995) Chapter 26 covers the topic querying and updating trees. It describes several different approaches and some vendor specific extensions for handling tree data. It mentions CJ Date's EXPLODE() operator that would convert a table into another

[GENERAL] Is union better than or

2000-08-03 Thread Michaël Fiey
Hi, I wonder what's the best between these 2 commands : First command : SELECT * FROM TABLE1 WHERE COL1 like 'A%' AND COL2 LIKE 'B%' AND (COL3 LIKE 'C%' OR COL4 LIKE 'D%')   Second command : SELECT * FROM TABLE1 WHERE COL1 like 'A%' AND COL2 LIKE 'B%' AND COL3 LIKE 'C%' UNION SELECT * FROM T

RE: [GENERAL] Unions in views

2000-08-03 Thread Robert D. Nelson
>AFAIK you must recompile your PHP if you upgrade your PostgreSQL from 6.x >to 7.x. While you're at it, you may want to upgrade your PHP as well, >unless you're already on 4.0.1pl2. :) We have used the same PHP module before and after upgrading from Postgres 6.5.3 to 7.0.2, under Red Hat 6.2. We

Re: [GENERAL] Re: [HACKERS] random() function produces wrong range

2000-08-03 Thread Roland Roberts
-BEGIN PGP SIGNED MESSAGE- > "Tom" == Tom Lane <[EMAIL PROTECTED]> writes: Tom> Actually the odds are far better than that. If the range is Tom> 2^31-1 then only about 2^-16th of the outputs should be less Tom> than 2^15. So ten probes gives you a failure probability of

[GENERAL] OFF topic : does anybody know free hosting with PgSQL & PHP

2000-08-03 Thread luc00

Re: [GENERAL] Unions in views

2000-08-03 Thread Federico Sevilla III
On Thu, 3 Aug 2000 at 11:11, Tom Lane wrote: >There are a lot of things that do work better in 7.0 than 6.5, though, >so I think it's worth your trouble to upgrade. Dunno whether you must >update PHP at the same time or not. AFAIK you must recompile your PHP if you upgrade your PostgreSQL from 6

Re: [GENERAL] Re: [HACKERS] random() function produces wrong range

2000-08-03 Thread Tom Lane
Roland Roberts <[EMAIL PROTECTED]> writes: > Call random() several times and test the maximum value against your > thresholds of 2^15 and 2^31. If random() is generating values in the > range 1:2^31-1, you would expect half of your values to be greater > than 2^15-1; more importantly, if you gene

[GENERAL] Re: [HACKERS] random() function produces wrong range

2000-08-03 Thread Roland Roberts
-BEGIN PGP SIGNED MESSAGE- > "Thomas" == Thomas Swan <[EMAIL PROTECTED]> writes: Thomas> Is it possible to test (during configure phase) and then Thomas> go from there... or does it need to be the same for all Thomas> platforms? You should be able to test, but it is, of

Re: [GENERAL] Unions in views

2000-08-03 Thread Tom Lane
Matthias Teege <[EMAIL PROTECTED]> writes: > Are unions in views implemented in the current version (7.x)? No. This is currently planned for 7.2, maybe six months or so from now. There are a lot of things that do work better in 7.0 than 6.5, though, so I think it's worth your trouble to upgrade

Re: [GENERAL] Functional indices with const params.

2000-08-03 Thread Tom Lane
Denis Perchine <[EMAIL PROTECTED]> writes: > is it possible to create functional indices with constant params? > create index ix_s_m on stats(date_part('month', sent_date)); No. > If it is not possible is there any workarounds for this? Sure: make your own function that does what you want with

[GENERAL] Re: [HACKERS] random() function produces wrong range

2000-08-03 Thread Tom Lane
Thomas Swan <[EMAIL PROTECTED]> writes: >> I suspect we have a good chance at getting burned no matter what we use >> :-(. But RAND_MAX is definitely the wrong thing. > Is it possible to test (during configure phase) and then go from there... > or does it need to be the same for all platforms?

Re: [GENERAL] Can't copy from file into table

2000-08-03 Thread Guillaume Perréal
[EMAIL PROTECTED] wrote: > > Dear all, > > I am using > copy tableA from '/tmp/A.data' and have the following error: > > Unable to identify an operatior '=' for types 'varchar' > You will have to retype this query using an explicit cast. > > What is "an explicit cast"? Something like this:

[GENERAL] libpq++ app code examples ?

2000-08-03 Thread luc00
Hi Any help about [web] applications code samples, based on libpq++ for PgSQL 7.x Thanks Lucian

RE: [GENERAL] Documentation

2000-08-03 Thread anuj
PQresultStatus use for error handling. *** This is a part of the postgres manual *** PQresultStatus Returns the result status of the query. PQresultStatus can return one of the following values: PGRES_EMPTY_QUERY, PGRES_COMMAND_OK, /* the query was a command returning no data */ PGRES_TUPL

[GENERAL] Unions in views

2000-08-03 Thread Matthias Teege
Moin, I use PostgreSQL 6.5.1 and PHP4 under FreeBSD and now I want to use unions in views. But PostgreSQL says "ERROR: Views on unions not implemented.". Are unions in views implemented in the current version (7.x)? Must I reinstall PHP if I update PostgreSQL? Many thank's Matthias