[SQL] pltcl problem

2000-12-07 Thread rocael
Hi all! I am using postgresql 7.0.2 and then installed tcl 8.2.3 (from dev.scriptics.com). I followed all the instructions to install tcl. Then I have configured again postgres using this flag, --with-tcl. everythings looks ok, I did a createlang pltcl mydb and it worked! then load some pltcl

[SQL] trying to pattern match to a value contained in a column

2000-12-07 Thread Beth Gatewood
Hi- I can't figure out how to do this I examine a table where I think that one attribute is an abbreviation of another attribute. So-If I had a table where I had LONG_NAME and ABBR as attributes. I want something like SELECT whatever FROM my_table WHERE long_name LIKE '%[the value of ABBR

RE: [SQL] trying to pattern match to a value contained in a column

2000-12-07 Thread Francis Solomon
Hi Beth, Try something like this ... Here's a simple table schema: CREATE TABLE abbrev ( abbr varchar(10), long_name varchar(50), primary key(abbr) ); Throw in some random data: INSERT INTO abbrev VALUES ('fs', 'fsolomon'); INSERT INTO abbrev VALUES ('bg', 'bgatewood'); INSERT INTO abbr

Re: [SQL] trying to pattern match to a value contained in a column

2000-12-07 Thread Beth Gatewood
Hi Francis- Thank you for your rapid and excellent response. This makes perfect sense...unfortunately it isn't working... I hope this isn't because I am using 6.3 (yes...I know it is very very old but this is currently where the data is!) here is the query: select * from av34s1 where chromat

[SQL] postmaster restart error

2000-12-07 Thread rocael
Hi all! I'm using postgresql7.0.2 I did ipcclean and then pg_ctl stop then I tried to start again the DB server as usual nohup postmaster -i > pgserver.log 2>&1 & I got this error: FATAL 2: Read("/usr/local/pgsql/data/pg_control") failed:2 Startup failed - abort. Somebody know what could be wrong

[SQL] restart postmaster error

2000-12-07 Thread rocael
Hi! I did as postgres user ipcclean then pg_ctl stop but then when I tried to start again the server as usual I couldn't, I just doesn't do anything. Somebody know whats going on? Thank you, Rocael. Get free email and a permanen

Re: [SQL] how to execute a C program via trigger ?

2000-12-07 Thread Jie Liang
Hi, Is any other SQL implicit cursor attribute in PL/plsql ?? when you say (in pl/plsql): select field into v_1 from atable where whatever; special variable FOUND can be used to tell return is null or not. this functions like SQL%FOUND or SQL%NOTFOUND in Oracle, however, when I do some DML(i

Re: [SQL] trying to pattern match to a value contained in a column

2000-12-07 Thread Joel Burton
> This makes perfect sense...unfortunately it isn't working... > > I hope this isn't because I am using 6.3 (yes...I know it is very very > old but this is currently where the data is!) > > here is the query: > > select * from av34s1 where chromat ~~ ('%' || sample || '%'); > > > ERROR: pars

Re: [SQL] trying to pattern match to a value contained in a column

2000-12-07 Thread Tom Lane
Beth Gatewood <[EMAIL PROTECTED]> writes: > I hope this isn't because I am using 6.3 (yes...I know it is very very > old but this is currently where the data is!) > here is the query: > select * from av34s1 where chromat ~~ ('%' || sample || '%'); > ERROR: parser: syntax error at or near "||" I

Re: [SQL] trying to pattern match to a value contained in a column

2000-12-07 Thread Ross J. Reedstrom
Beth - Both errors you describe are due to using 6.3. The first one might work if you parenthize the repeated use of ||, as so: select * from av34s1 where chromat ~~ (('%' || sample ) || '%'); Ross On Thu, Dec 07, 2000 at 01:45:00PM -0800, Beth Gatewood wrote: > Hi Francis- > > Thank you for

[SQL] FOREIGN KEY errors.

2000-12-07 Thread Joseph Shraibman
When trying to alter a table and add a foreign key, I am getting this error if the table has any data in it: playpen=# alter table message add FOREIGN KEY (pod,originator) REFERENCES usertable (podkey,userkey); NOTICE: ALTER TABLE ... ADD CONSTRAINT will create implicit trigger(s) for FOREIGN KE

[SQL] Unable to convert null timestamp to date. Bug?

2000-12-07 Thread Edmar Wiggers
Strange, this works: select * from users where last_visit > now() + 7; -- last_visit is nullable, of type timestamp But this doesn't select * from users where last_visit + 7 > now(); ERROR: Unable to convert null timestamp to date -- yes, there are users where last_visit IS NULL BTW

Re: [SQL] Unable to convert null timestamp to date. Bug?

2000-12-07 Thread Tom Lane
"Edmar Wiggers" <[EMAIL PROTECTED]> writes: > select * from users where last_visit + 7 > now(); > ERROR: Unable to convert null timestamp to date Yeah, someone who hadn't quite grokked the concept of NULL seems to have written a lot of the date.c code :-(. This is fixed for 7.1. If it's re

Re: [SQL] trying to pattern match to a value contained in a column

2000-12-07 Thread Peter Eisentraut
Beth Gatewood writes: > So-If I had a table where I had LONG_NAME and ABBR as attributes. > > I want something like > > SELECT whatever FROM my_table WHERE long_name LIKE '%[the value of ABBR > in that row]%'; SELECT whatever FROM my_table a, my_table b WHERE a.long_name like (b.abbr || '%'); -