Re: [SQL] Isnumeric function?

2004-09-10 Thread Achilleus Mantzios
O Theo Galanakis Sep 10, 2004 : Josh, I agree with the machete technique, unfortunately The structure is inplace and a work-around was required. I created the Index you specified, however it chooses to run a seq scan on the column rather than a Index scan. How can you force it to

Re: [SQL] Isnumeric function?

2004-09-10 Thread Greg Stark
Theo Galanakis [EMAIL PROTECTED] writes: I created the Index you specified, however it chooses to run a seq scan on the column rather than a Index scan. How can you force it to use that Index.. CREATE INDEX idx_content_numeric ON botched_table(content) WHERE content ~ '^[0-9]{1,9}$';

Re: [SQL] Isnumeric function?

2004-09-10 Thread Greg Stark
Greg Stark [EMAIL PROTECTED] writes: Theo Galanakis [EMAIL PROTECTED] writes: I created the Index you specified, however it chooses to run a seq scan on the column rather than a Index scan. How can you force it to use that Index.. CREATE INDEX idx_content_numeric ON

Re: [SQL] Isnumeric function?

2004-09-10 Thread Tom Lane
Greg Stark [EMAIL PROTECTED] writes: That's all well and good. But when I tried to make a version of your situation that used a function I found it doesn't work so well with functional indexes: ... I can't figure out why this is happening. You're using 7.3 or older?

Re: [SQL] Isnumeric function?

2004-09-10 Thread Greg Stark
Tom Lane [EMAIL PROTECTED] writes: Greg Stark [EMAIL PROTECTED] writes: That's all well and good. But when I tried to make a version of your situation that used a function I found it doesn't work so well with functional indexes: ... I can't figure out why this is happening. You're

Re: [SQL] aggregate function stddev

2004-09-10 Thread Bruce Momjian
Is this a TODO? --- Josh Berkus wrote: Kemin, Just noticed that the postgres stddev is the stddev_sample formula. There are two different ways to calculate this value. Their difference is very small with large

[SQL] HOW TO HANDLE ZEROS IN DATE FIELD?

2004-09-10 Thread James M Doherty
I have a project that is taking input from another system. I have certain columns defined as 'Date' Columns. On input I will get '00' in this field which causes the insert to fail. I have read the docs on default and it is unclear to me if this will work. Does anyone have experience in

[SQL] SQL99 with recursive question

2004-09-10 Thread Thomas Wegner
Hello, i think i am to stupid to use the with recursive SQL! I have a table: create table tree ( id_tree integer, parent_id integer ... ); In PostgreSQL i use the great connectby() function and in Oracle i simple use select * from tree start with id_tree = 0 connect by parent_id=prior

[SQL] PL/pgSQL Function Problem

2004-09-10 Thread the inquirer
I am trying to create a function that creates a user and adds a row to a table. It produces no warnings or errors when I create the function but when I attempt to execute it I get a syntax error. I do not understand why this is happening. Any help would be greatly appreciated. SELECT

Re: [SQL] HOW TO HANDLE ZEROS IN DATE FIELD?

2004-09-10 Thread Michael Glaesemann
On Sep 3, 2004, at 11:36 PM, James M Doherty wrote: I have a project that is taking input from another system. I have certain columns defined as 'Date' Columns. On input I will get '00' in this field which causes the insert to fail. I have read the docs on default and it is unclear to me