Re: [SQL] Index not recognized

2003-12-09 Thread Ace
Hello Greg, thanks for replying. I definitely lacked the expression you suggested in my 'SELECT' statement. > Is this *= operator from the contrib/array directory? It's not an indexable > operator at all using standard btree indexes. Yes, it is from contrib/array directory. > The GiST indexing

Re: [SQL] postgresql and ColdFusion

2003-12-09 Thread BenLaKnet
Benoît BOURNON wrote: Oh dear a man using CF with postgresql ! ... OH YES ! ... try to use jdbc pilot to connect to postgresql with CFMX ... maybe you can use cfstoredproc with cfprocparam and cfprocrsult Roberto Mello wrote: On Mon, Dec 08, 2003 at 05:38:56PM -0800, viol

[SQL] Values like ''

2003-12-09 Thread Elielson Fontanezi
Hi folks!       Why does the following query work on pgsql 7.2.3 and not in pgsql 7.3.4?   SELECT cronograma_evento.nr_projeto ,cronograma_evento.dt_inic   ,cronograma_evento.nr_sala ,cronograma_evento.tm_hora_inicial   ,cronograma_evento.tm_hora_final ,cronograma_evento.cd_turma   ,cro

Re: [SQL] Values like ''

2003-12-09 Thread Peter Eisentraut
Elielson Fontanezi wrote: > Why does the following query work on pgsql 7.2.3 and not in pgsql > 7.3.4? Please be more detailed on your idea of "works" and "does not work". ---(end of broadcast)--- TIP 7: don't forget to increase your free space

Re: [SQL] postgresql and ColdFusion

2003-12-09 Thread Benoît BOURNON
Oh dear a man using CF with postgresql ! ... OH YES ! ... try to use jdbc pilot to connect to postgresql with CFMX ... maybe you can use cfstoredproc with cfprocparam and cfprocrsult Roberto Mello wrote: On Mon, Dec 08, 2003 at 05:38:56PM -0800, viola wrote: Hi, How to call Pos

[SQL] Fetch a single record

2003-12-09 Thread David Shadovitz
I'm looking for the fastest way to fetch a single record from a table. I don't care what record it is. Here are two techniques I've explored: 1. Use LIMIT SELECT * FROM myTable LIMIT 1 2. Get a valid OID and then get the record. SELECT MIN(oid) AS anOID FROM myTable SELECT * FROM myTable WHERE

Re: [SQL] How to specify the beginning of the month in Postgres SQL syntax?

2003-12-09 Thread CoL
hi [EMAIL PROTECTED] wrote, On 12/7/2003 5:16 PM: Hello, I need to create a view in Postgres that has a where clause of the date < beginning of month. i.e.: SELECT supplier_number, Sum(amount) AS due FROM purchase_orders WHERE date < '2003-12-1' AND paid = 0 GROUP BY supplier_number ORDER BY

[SQL] How to specify the beginning of the month in Postgres SQL syntax?

2003-12-09 Thread jeff
Hello, I need to create a view in Postgres that has a where clause of the date < beginning of month. i.e.: SELECT supplier_number, Sum(amount) AS due FROM purchase_orders WHERE date < '2003-12-1' AND paid = 0 GROUP BY supplier_number ORDER BY supplier_number ASC As you can see, I've specifi

Re: [SQL] Fetch a single record

2003-12-09 Thread Peter Eisentraut
David Shadovitz wrote: > I'm looking for the fastest way to fetch a single record from a > table. I don't care what record it is. > > Here are two techniques I've explored: > > 1. Use LIMIT > SELECT * FROM myTable LIMIT 1 > > 2. Get a valid OID and then get the record. > SELECT MIN(oid) AS anOID FR

[SQL] Faster performance when using where cust_id = '123' vs cust_id = 123. Does 7.4 fix this??

2003-12-09 Thread David B
We have got used to the problem that queries of the format: select * from customer where cust_id = '123' are much much faster than select * from customer where cust_id = 123 (where cust_id is defined as bigint). a. Why is this. b. Will moving to v7.4 change this so we can avoid the whole '123'

Re: [SQL] Faster performance when using where cust_id = '123' vs cust_id = 123. Does 7.4 fix this??

2003-12-09 Thread Peter Eisentraut
David B wrote: > We have got used to the problem that queries of the format: > > select * > from customer > where cust_id = '123' are much much faster than > > select * > from customer > where cust_id = 123 > > (where cust_id is defined as bigint). > > a. Why is this. Because in the second case, t

Re: [SQL] Values like ''

2003-12-09 Thread Stephan Szabo
On Fri, 5 Dec 2003, Elielson Fontanezi wrote: > AND cronograma_evento.cd_local = '' Is cd_local an integer type? If so, '' no longer works as an integer (IIRC it used to mean 0). The exact error message and possibly schema information would be useful if that's not what's going on. -

Re: [SQL] Fetch a single record

2003-12-09 Thread Paul Thomas
On 05/12/2003 21:51 David Shadovitz wrote: I'm looking for the fastest way to fetch a single record from a table. I don't care what record it is. [snip] Have you also tried SELECT * from mytable limit 1 If you genuinely don't care what the record is (I assume you're justing testing that table i

Re: [SQL] [ADMIN] Field Size

2003-12-09 Thread Somasekhar Bangalore
There is no harm in having a field size of 1000 character provided u use the proper datatype. Don’t user char(1000). Try using varchar(1000).   For character data it is recommended to use the VARCHAR type, since PostgreSQL manages it very well.  On the contrary, if you use the CHAR dataty

[SQL] Field Size

2003-12-09 Thread Ganesan Kanavathy
Can anyone tell me, what harm would setting a field size to 1000 characters do to the size?   By increasing the size, will the database require more space? Or does it only consume space if there is data in the field only?   Regards, Ganesan  

Re: [SQL] [ADMIN] Field Size

2003-12-09 Thread Marc A. Leith
If you define the field as CHAR, 1000 bytes will be consumed. If you define the field as VARCHAR, on sufficient bytes to store the contents will be used. Marc --Original Message Text--- From: Ganesan Kanavathy Date: Mon, 8 Dec 2003 20:56:06 +0800 Clean Clean DocumentEmail MicrosoftI

Re: [SQL] Fetch a single record

2003-12-09 Thread greg
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > I'm looking for the fastest way to fetch a single record from a table. > I don't care what record it is. That's a strange request. If you really don't care what comes back, you don't even need to query a table: SELECT 1; If you perhaps want

Re: [SQL] How to specify the beginning of the month in Postgres SQL syntax?

2003-12-09 Thread Paul Thomas
On 07/12/2003 16:16 [EMAIL PROTECTED] wrote: Hello, I need to create a view in Postgres that has a where clause of the date < beginning of month. i.e.: SELECT supplier_number, Sum(amount) AS due FROM purchase_orders WHERE date < '2003-12-1' AND paid = 0 GROUP BY supplier_number ORDER BY supplier_n

Re: [SQL] How to specify the beginning of the month in Postgres SQL syntax?

2003-12-09 Thread sqllist
Hi Jeff, You can use WHERE date < to_date( to_char(current_date,'-MM') || '-01','-mm-dd') Thanx Denis - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, December 07, 2003 9:46 PM Subject: [SQL] How to specify the beginning of the month in Pos