[GENERAL] PSQL woes

2000-08-09 Thread Joshua Adam Ginsberg
What I do is just invoke upper(text(field))... that converts the varchar to text, which the upper function can then use. -jag -- There's so much beauty in the world. Sometimes I feel like I'm seeing it all at once, and it's too much; my heart fills up like a balloon that's about to burst. And

[GENERAL] insert into table from select..

2000-08-09 Thread Dale Walker
Hi all, I'm having some trouble with the insert function and would appreciate anyones woords of wisdom... What I'm trying to do in a nutshell: 1. populate a 'working' table from a file (this is fine) 2. run sanity checks on the data (this is fine) 3. merge 'working' tabl

Re: [GENERAL] Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..

2000-08-09 Thread Philip Hallstrom
Yes... it is odd... especially since the following works fine: SELECT UPPER(field) FROM test; -philip On Wed, 9 Aug 2000, Lamar Owen wrote: > Philip Hallstrom wrote: > > CREATE INDEX test_idx ON test (UPPER(field)); > > > devloki=> create index foo on rolo_entry (UPPER(fname)); > > ERROR: D

Re: [GENERAL] Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..

2000-08-09 Thread Lamar Owen
Philip Hallstrom wrote: > CREATE INDEX test_idx ON test (UPPER(field)); > devloki=> create index foo on rolo_entry (UPPER(fname)); > ERROR: DefineIndex: function 'upper(varchar)' does not exist > devloki=> create index foo on rolo_entry (UPPER(varchar(fname))); > ERROR: parser: parse error at

Re: [GENERAL] Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..

2000-08-09 Thread Philip Hallstrom
I know... using your example below, try the following: CREATE INDEX test_idx ON test (UPPER(field)); On my system I get the following errors: devloki=> create index foo on rolo_entry (UPPER(fname)); ERROR: DefineIndex: function 'upper(varchar)' does not exist devloki=> create index foo on rolo

Re: [GENERAL] Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..

2000-08-09 Thread Prasanth A. Kumar
Mike Mascari <[EMAIL PROTECTED]> writes: > Philip Hallstrom wrote: > > > > Is there another function that will uppercase? Or is there some way to > > call the other UPPER function? Or something within plpgsql I don't know > > about. > > Thanks! > > -philip > > I don't understand this. UPPER()

Re: [GENERAL] Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..

2000-08-09 Thread Mike Mascari
Philip Hallstrom wrote: > > Is there another function that will uppercase? Or is there some way to > call the other UPPER function? Or something within plpgsql I don't know > about. > Thanks! > -philip I don't understand this. UPPER() is a built-in function: stocks=# create table test (field

Re: [GENERAL] Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..

2000-08-09 Thread Lamar Owen
Philip Hallstrom wrote: > Oh... Duh!!! Geesh... for some reason I figured it would call the > "built-in" UPPER, but obviously it won't. ha ha ha. *sigh* > My next question then is how to get around this? I could just rename my > function but it's nice to leave it UPPER since that is what it doe

[GENERAL] Re: Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..

2000-08-09 Thread Philip Hallstrom
In article <[EMAIL PROTECTED]>, Prasanth A. Kumar <[EMAIL PROTECTED]> wrote: >Philip Hallstrom <[EMAIL PROTECTED]> writes: > >> Hi - >> The following statements lock up my machine completely (I can >> ping, but can't telnet, nothing). This is FreeBSD 3.4-STABLE running >> 7.0.2. >> >> rolo_

Re: [GENERAL] Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..

2000-08-09 Thread Prasanth A. Kumar
Philip Hallstrom <[EMAIL PROTECTED]> writes: > Hi - > The following statements lock up my machine completely (I can > ping, but can't telnet, nothing). This is FreeBSD 3.4-STABLE running > 7.0.2. > > rolo_entry.fname is of type VARCHAR(30). > > devloki=> CREATE FUNCTION upper(VARCHAR) RE

[GENERAL] initdb fail

2000-08-09 Thread Paulo Henrique Rodrigues Pinheiro
Hi !!! "unknown type 'ame'" ? [postgres@sql pgsql]$ initdb --pgdata=`pwd` This database system will be initialized with username "postgres". This user will own all the data files and must also own the server process. Fixing permissions on pre-existing data dire

[GENERAL] Lock up on 7.0.2 involving CREATE FUNCTION/INDEX..

2000-08-09 Thread Philip Hallstrom
Hi - The following statements lock up my machine completely (I can ping, but can't telnet, nothing). This is FreeBSD 3.4-STABLE running 7.0.2. rolo_entry.fname is of type VARCHAR(30). devloki=> CREATE FUNCTION upper(VARCHAR) RETURNS TEXT AS ' devloki'> BEGIN devloki'> RETURN UPPER

[GENERAL] How to create an index using a function???

2000-08-09 Thread Philip Hallstrom
Hi - I have a table that has a varchar field (fname). I'd like to create an index on UPPER(fname), but am running into problems... What I don't understand is that I can do "SELECT UPPER(fname) FROM mytable" and it works just fine. I also tried creating a SQL function that did upper for

Re: [GENERAL] ORDERING alphabetically

2000-08-09 Thread bmccoy
On Wed, 9 Aug 2000, abe wrote: > Does anyone know how to get results from a query in alphabetical order > (for one field such as surname). I skimmed over the documentation and > no luck. Use the ORDER BY clause in your query: SELECT surname, firstname FROM names ORDER BY surname; Bret

Re: [GENERAL] ORDERING alphabetically

2000-08-09 Thread Mike Sears
SELECT * FROM table ORDER BY table; that seems to do the trick for me when I need to order things alphabeticly. Mike - Original Message - From: "abe" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, August 09, 2000 10:15 AM Subject: [GENERAL] ORDERING alphabetically > Hi th

[GENERAL] ORDERING alphabetically

2000-08-09 Thread abe
Hi there, Does anyone know how to get results from a query in alphabetical order (for one field such as surname). I skimmed over the documentation and no luck. The field type for surname is varchar - Maybe this is why order by didn't work. Thankyou, Abe