Re: [SQL] What do I do with this error?

2001-03-18 Thread Tom Lane
"Josh Berkus" <[EMAIL PROTECTED]> writes: > Er, Tom, I'm using 7.1. > Pgsql does return a null as expected when going from the command line. > However, if I call the regular expression from within a PL/pgSQL > function, it bombs. Well, that's more interesting, but I still can't reproduce it ...

Re: [SQL] What do I do with this error?

2001-03-18 Thread Stephan Szabo
Using the below (with a few fixes, delcare->declare and adding the close quote and language type as plpgsql, and a table1 defined as id int, field1 varchar, field2 varchar, I get a NULL returned if I select test1(); I'm somewhere between beta4 and 5 though. On Sun, 18 Mar 2001, Josh Berkus wrote

Re: [SQL] What do I do with this error?

2001-03-18 Thread Josh Berkus
Tom, > Yes, I'd say so. 7.1 returns a NULL as expected ... Er, Tom, I'm using 7.1. Pgsql does return a null as expected when going from the command line. However, if I call the regular expression from within a PL/pgSQL function, it bombs. Therefore, please forward to pgsql-bugs: Bug Name: R

[SQL] hierarchical order equivalent

2001-03-18 Thread Grant Furick
Is there an equivalent way to do this Oracle query in Postgres? Select category_id, parent_category_id, category_name FROM Category START WITH category_id = 6 CONNECT BY PRIOR category_id = parent_category_id Order by category_name I am trying to build a hierarchy of inter-related categori

Re: [SQL] What do I do with this error?

2001-03-18 Thread Tom Lane
"Josh Berkus" <[EMAIL PROTECTED]> writes: > Never mind. It turns out that if you call try to feed a NULL to a > regular expression (e.g. Client_name ~* NULL) you get: > ERROR: regcomp failed with error empty (sub)expression > Good to know. I had expected that regular expressions, like oth

Re: [SQL] What do I do with this error?

2001-03-18 Thread Josh Berkus
Folks, Never mind. It turns out that if you call try to feed a NULL to a regular expression (e.g. Client_name ~* NULL) you get: ERROR: regcomp failed with error empty (sub)expression Good to know. I had expected that regular expressions, like other operators, would return NULL if NUL

Re: [SQL] update table sequence

2001-03-18 Thread Tom Lane
[EMAIL PROTECTED] (Egbert Ellenkamp) writes: > select setval('mytable_myrowid_seq',select max(myrowid) from mytable); That should work if you put in the required parentheses around the sub-select: select setval('mytable_myrowid_seq', (select max(myrowid) from mytable));

Re: [SQL] Select very slow...

2001-03-18 Thread David Olbersen
On Sun, 18 Mar 2001, Fernando Eduardo B. L. e Carvalho wrote: > select p.city,count(*) from sales s, person p where s.doc = p.doc > group by p.city; > >Anyone help-me? 1: VACUUM ANALYZE sales VACUUM ANALYZE person; 2: That 'count(*)' is going to be slow. Try counting a column that'

[SQL] Select very slow...

2001-03-18 Thread Fernando Eduardo B. L. e Carvalho
Table 1 create table person ( doc text primary key, etc city text ); 9 rows create table sales ( doc text, etc . ); 30 rows select p.city,coun