Re: [SQL] Continuous inserts...

2000-08-22 Thread Tom Lane
Jan Wieck <[EMAIL PROTECTED]> writes: > I haven't looked at the code, but pg_class only has a boolean > telling if a class has rules or not. Could it be that adding > more rules (or dropping just a few instead of all) doesn't > update the pg_class tuple, thus the syscache for

Re: [SQL] Continuous inserts...

2000-08-22 Thread Jan Wieck
Stephan Szabo wrote: > Wierd, I've not seen that behavior really, although I've never > done time sensitive stuff. It might be the time before the > shared cache updates? Not sure really. If you do the rule > inline with your inserts (rather than a second transaction) > does it still wait?

Re: [SQL] Null function parameters

2000-08-22 Thread Tom Lane
"Graham Vickrage" <[EMAIL PROTECTED]> writes: > However my understanding was that if the default value is SQL NULL then any > values passed into the function that are null would be treated as 'NULL'. Not sure what you think you meant by that, but a null is a null. If you declared the table colum

Re: [SQL] Time Help

2000-08-22 Thread Brian C. Doyle
In Conclusion: 7.0.2 by default outputs the time span as 00:00:00 no matter what format you put in. There is no need to convert it! Thanks to Mark for all your help!! At 11:03 AM 8/22/00 -0400, Mark Volpe wrote: >SELECT '0:00:00'::time + '@ 2 hours 10 mins 6 secs'::timespan; > > ?column? >---

[SQL] Null function parameters

2000-08-22 Thread Graham Vickrage
Hi All, I am trying to create a function that takes an int as its param and insert the value into a table. The problem occurs when the value passed is NULL, the error message returned is - Execute failed ERROR: ExecAppend: Fail to add null value in not null attribute type However my understand

Re: [SQL] Continuous inserts...

2000-08-22 Thread Stephan Szabo
Wierd, I've not seen that behavior really, although I've never done time sensitive stuff. It might be the time before the shared cache updates? Not sure really. If you do the rule inline with your inserts (rather than a second transaction) does it still wait? Stephan Szabo [EMAIL PROTECTED] O

Re: [SQL] tip: weird parse error for pl/pgsql

2000-08-22 Thread Tom Lane
Keith Wong <[EMAIL PROTECTED]> writes: > It seems that pl/pgsql has a problem parsing Window style > new line characters. Ah-hah, good catch! I have fixed this bug for 7.1. If you want to patch your local copy, the critical changes are: *** src/pl/plpgsql/src/scan.l.orig Thu Jun 22 19:0

Re: [SQL] Time Help

2000-08-22 Thread Mark Volpe
SELECT '0:00:00'::time + '@ 2 hours 10 mins 6 secs'::timespan; ?column? -- 02:10:06 Mark "Brian C. Doyle" wrote: > > Mark, > > On your 7.0 box would you do: > > SELECT '0:00:00'::time + '@ 2 hours 10 mins 6 secs':timespan; > > For me and see if it will convert it! Need to decide

Re: [SQL] Time Help

2000-08-22 Thread Mark Volpe
I tried it on a box with postgres 6.5.3 and I got the result you did. On postgres 7.0 I get 02:10:06 for both results. You should upgrade to 7.0 - it is _much_ better. Mark "Brian C. Doyle" wrote: > > Mark, > > I tried that and had to change it to: > > SELECT '0:00:00'::timespan + '02:10:06':

Re: [SQL] using INTERSECT and UNION in IN clause

2000-08-22 Thread Tom Lane
Alex Guryanow <[EMAIL PROTECTED]> writes: > Is it possible to use INTERSECT and UNION keywords in subqueries? No, not at the moment. This is one of many things we hope to fix when we redesign querytrees (currently planned for 7.2 cycle). regards, tom lane

Re: [SQL] Time Help

2000-08-22 Thread Mark Volpe
I'm not sure at all what you are asking, but I'm thinking you're trying to convert a "timespan" to a "time". Try adding it to a time like this: SELECT '0:00:00'::time + '02:10:06'::timespan; Mark "Brian C. Doyle" wrote: > > Hello all, > > I have a query result of @ 2 hours 10 mins 6 secs and I

Re: [SQL] Time Help

2000-08-22 Thread Brian C. Doyle
Mark, I tried that and had to change it to: SELECT '0:00:00'::timespan + '02:10:06'::timespan; To get any response. the response i got was @ 2 hours 10 mins 6 secs Still in the wrong format If is use : SELECT '0:00:00'::time + '02:10:06'::timespan; It get No such function 'time_timespan'

[SQL] Time Help

2000-08-22 Thread Brian C. Doyle
Hello all, I have a query result of @ 2 hours 10 mins 6 secs and I would like to change that to 02:10:06. Currently the field is listed as "timespan" This allows me to input date as 02:10:06 or 4h 10m 6s or even 2hrs 10 min 6 sec which are all the formats that I will be entering the time for

[SQL] tip: weird parse error for pl/pgsql

2000-08-22 Thread Keith Wong
Hi everyone, After fiddling for about a day to work out why my pl/pgsql stored procedures weren't working I finally discovered why. It seems that pl/pgsql has a problem parsing Window style new line characters. I was writing my stored procedures using a Windows app, and then running them on my

[SQL] using INTERSECT and UNION in IN clause

2000-08-22 Thread Alex Guryanow
Hi, postgresql 7.0.2. Why by executing the following query select * from magazine where id in ( select mag_id from dict where word = 'akademie' intersect select mag_id from dict where word = 'der' intersect select mag_id from dict where word = 'klasse' ) I receive the followin

Re: [SQL] Continuous inserts...

2000-08-22 Thread Joerg Hessdoerfer
Hi! At 08:18 18.08.00 -0700, you wrote: [...] >I didn't try with vacuum, I just did a table lock and that >seemed to still hang the inserts with two tables, so I figured >maximum safety was adding the third table. If it works with two >that's much cooler. Was this with real data or just a smal

[SQL] Re: Beginner problems with functions

2000-08-22 Thread Andreas Tille
On Mon, 21 Aug 2000, Stephan Szabo wrote: > I haven't thought of an elegant way to do it, although you could > fake some of it with a table of the appropriate structure with a sequence. > It's really ugly, but the pl/sql(tcl/perl/etc...) function gets the > next value of the sequence and inserts