RE: [SQL] Create table in functions

2000-08-24 Thread Hiroshi Inoue
-Original Message- From: Tom Lane "Hiroshi Inoue" [EMAIL PROTECTED] writes: Hmm,Andreas's original function seems to contain other statements. If the function contains DML statements for the table Temp_Num_Table, it wouldn't work properly. i.e 1st call would work but 2nd call

Re: [SQL] Null function parameters

2000-08-24 Thread Anatoly K. Lasareff
"TL" == Tom Lane [EMAIL PROTECTED] writes: TL [EMAIL PROTECTED] (Anatoly K. Lasareff) writes: I'afraid no. My question is: if I pass one null argument into function then all other argumens, which are not null, became null inside function body. TL Yes --- and not only that, but the

Re: [SQL] Create table in functions

2000-08-24 Thread hlefebvre
Andreas Tille wrote: What does this mean? The ERROR is caused by the Create Table statement (when I removed it from my complex function it worked well). So why doesn't this work and what copy function fails here?? Maybe you can create your table using a select into statement : something

[SQL] Is there a way to tell if db has changed?

2000-08-24 Thread Ingram, Bryan
It would seem about that the only currently viable technique for creating a standby database in case of a primary database failure is to ship output from pg_dump(all) to an awaiting postgres instance and reload them. I'm currently working on a few scripts to accomplish this which use cron

[SQL] Question on string value expression wildcarding

2000-08-24 Thread Steve Wampler
I have LIKE expressions: (a) name LIKE 'kp.dhs.%' (b) name LIKE 'kp.dhs%' where the name column contains strings prefixed with "kp.dhs.". I'm using postgresql 7.0.2. Expression (a) fails to match any names while (b) matches all strings prefixed with "kp.dhs",

Re: [SQL] weird structure

2000-08-24 Thread Ryan Williams
Does it have to be in one row? Otherwise, assuming that person_data.d_person_id references person.a_id and person_data.d_attribute_id references person_attribute.a_id: select a.a_name from person p, person_data d, person_attribute a where p.p_name = 'UserYou'reLookingFor' AND p.p_id =

Re: [SQL] Question on string value expression wildcarding

2000-08-24 Thread Stephan Szabo
Do you have any odd locale settings or anything and what's the table definition for the table in question? It seems to do what I expect under my 7.0.2 system: create table kp (name text); insert into kp values ('kp.dhs.a'); insert into kp values ('kp.dhs.'); insert into kp values ('kp.dhs,d');

[SQL] Dynamic SQL

2000-08-24 Thread BouSaada Nabil
Hi, Is it possible to execute a dynamic sql query in pl/pgsql like the oracle feature for PL/SQL: EXECUTE IMMEDIATE 'UPDATE my_table SET col1=val1 '; Thanks. _ Get Your Private, Free E-mail from MSN Hotmail at

[SQL] Regular expression query

2000-08-24 Thread Rodger Donaldson
I have a large group of records which were entered with trailing garbage, in the form of superfluous \n. The main problem this has caused, other than the obvious one, is that the record in question is being used as a primary key, so some duplicates have slipped through. I assumed a simple

Re: [SQL] weird structure

2000-08-24 Thread Yury Don
[EMAIL PROTECTED] wrote: Hi, Consider the following tables/fields: table "person": fields "p_id", "p_name". table "person_attribute": fields "a_id", "a_name". table "person_data": fields "d_person_id", "d_attribute_id", "d_value". Also consider that a person may not have data related

[SQL] Re: [GENERAL] Getting the result of a query using COUNT(*)

2000-08-24 Thread Yury Don
Jackson Ching wrote: Hi, I'm using JSDK 2.0 and IBM JDK 1.3 on RedHat Linux 6.2 As i test my servlet, I got errors saying count(*) column not found in a query like this SELECT COUNT(*) FROM MyTable in my rs.getint("COUNT(*)"); in oracle it works

Re: [SQL] Regular expression query

2000-08-24 Thread Tom Lane
Rodger Donaldson [EMAIL PROTECTED] writes: SELECT url FROM sites WHERE url ~ url || '\\s+' While this concatenation works with the LIKE directive (ie LIKE url || '%'), postgresql barfs on it in a regexp with the error: ERROR: Unable to identify an operator '||' for types 'bool' and

[SQL] sorting in UNICODE table

2000-08-24 Thread Alex Guryanow
Hi, I'm use postgresql-7.0.2. It's compiled with unicode support (./configure --enable-multibyte=UNICODE ...) I have a table which contains both latin and non-latin letters. All they are in UTF-8 encoding. When I try to sort the rows ( SELECT * FROM my_table ORDER BY sort_field ) I receive