Re: [SQL] case insensitive search

2000-07-03 Thread Mitch Vincent
SELECT whatever FROM wherever WHERE lower(yourfield) = 'this'; You can do it with a case inseneitive regex search but they can't use indexes and can become very slow on large tables.. SELECT whatever FROM wherever WHERE yourfield ~* 'this'; lower() does leak a bit of memory from what I've hear

[SQL] maintain number in variable

2000-07-03 Thread Andrey
Can I maintain id in variable such as: CREATE FUNCTION function1() RETURNS int4AS '   $var = select nextval(''shipment_gen'');   select $var;'LANGUAGE 'sql'   Andrey

Re: [SQL] Need Help With Dates.

2000-07-03 Thread Thomas Lockhart
> I just migrated a database from MySQL to postgreSQL and am having trouble > wit postgres' dates. > MySQL dealt with dates very well, but i don't see the same sort of > functionality in postgres. ?? > The database is an archive of imformation, and i would like to do a cron'd > select for an int

[SQL] Need Help With Dates.

2000-07-03 Thread John
Hello. I just migrated a database from MySQL to postgreSQL and am having trouble wit postgres' dates. MySQL dealt with dates very well, but i don't see the same sort of functionality in postgres. The database is an archive of imformation, and i would like to do a cron'd select for an interval ba

Re: Antw: [SQL] plpgsql function gets wierd with Null parameters

2000-07-03 Thread Tom Lane
"Gerhard Dieringer" <[EMAIL PROTECTED]> writes: > It's a known bug of plpgsql that if one arg is NULL, all other args > are also assumed to be NULL. I think (hope) this will be fixed in a > future version. 7.1. It is already fixed in current development sources. BTW it's not actually plpgsql's

[SQL]

2000-07-03 Thread emils

Re: [SQL] trigger or something else?

2000-07-03 Thread Grant Finnemore
> I suppose you can use view for your need. For example: > ... > Unfortunately this way suits for select only, not for 'insert into b' > and 'update b' statement. > Except that you can use rules to update/insert data into tables when an insert/update is done on the view. See the docs for detai

Re: [SQL] Hash Join not using hashed index?

2000-07-03 Thread Ang Chin Han
On Wed, Jun 28, 2000 at 03:00:04AM -0400, Tom Lane wrote: > Hash joins don't have anything to do with hash indexes. > A hash join is a join that makes use of a temporary hashtable > built on-the-fly *in memory* for that join. Oh, I see. > The planner could choose to use an indexscan on a hash i

[SQL] extracting a table description

2000-07-03 Thread David Craig
Hi All,   I am trying to get a table description via the web.  I have tried using desc tablename but although the desc command appears to be a reserved word, it doesn't appear to be supported.   Does anyone know how I can extract the table description (column names)?   Thanks in advance Davi

Re: [SQL] trigger or something else?

2000-07-03 Thread Anatoly K. Lasareff
> "EK" == Emils Klotins <[EMAIL PROTECTED]> writes: EK> Hello, EK> I have a table that has to have several fields with different names, EK> but equal content. Sounds stupid, but it is because I have 2 EK> different programs querying the same table for user information and EK> each of

[SQL] plpgsql function gets wierd with Null parameters

2000-07-03 Thread Skeets and Kim Norquist
When I call the following plpgsql function with the last two parameters as Null, the first parameter loses it's value: ma=> select createFund('fred', null, null); createfund (1 row) However it works fine when I give values to the last two params: ma=>

[SQL] Backup of BLOBS

2000-07-03 Thread Brian Powell
Greetings, I have a database that will be quite large that must be backed up nightly. I would like to use pg_dump; however, the problem is that we store binary data as well. Is there a way to backup this up without having to write a program to do it? Thanks, Brian

[SQL] SQL stored procedures and JDBC problem

2000-07-03 Thread Nitin Bahadur
I need a SQL stored procedure to return arrays. as OUT parameters in If i declare the array as a "table", then i cannot do table[i] := some_value. If i declare it as a VARRAY. then i need to initialialize all my VARRAY elements using a costructor which is painful ( a simple for loop does not do i

Re: [SQL] Hash Join not using hashed index?

2000-07-03 Thread Ang Chin Han
On Wed, Jun 28, 2000 at 10:56:17AM -0400, Tom Lane wrote: > Ang Chin Han <[EMAIL PROTECTED]> writes: > If it was like that then a hash index wouldn't have been applicable > anyway; hashes are only good for strict equality checks. If you want > something that can do ordering checks you need a btre

[SQL] SPI documantation

2000-07-03 Thread Adam Walczykiewicz
Where can I get more information about programming  in SPI. (more than in PostgreSQL documentation). Thanks for any help Adam