Re: [SQL] Line length in pl/pgsql function

2004-03-17 Thread David Olbersen
David Olbersen wrote: > *sigh* I'd rather have pilot error than having to wait for a patch :) Hmmm, that doesn't look right in retrospect. What I meant to say was THANK YOU TOM! -- David Olbersen iGuard Engineer St. Bernard Software 15015 Avenue of Sciences San Diego, C

Re: [SQL] Line length in pl/pgsql function

2004-03-17 Thread David Olbersen
; > at character 3419 psql:test_ratedby_category_lang.plsql:95: LINE 81: > -- none,everything = don't show the language... > psql:test_ratedby_category_lang.plsql:95: > ^ That would have been handy! -- David Olbersen iGuard Engineer St. Bernard Software 15015 Av

Re: [SQL] Line length in pl/pgsql function

2004-03-17 Thread David Olbersen
yslog output was different. I can attach both if that's helpful. Any more info needed? -- David Olbersen iGuard Engineer St. Bernard Software 15015 Avenue of Sciences San Diego, CA 92127 x2152 psql:test_ratedby_category_lang.plsql:1: ERROR: Relation 'ratedby_return_set' already

[SQL] Functional Indexes

2003-07-15 Thread David Olbersen
functional indexes, but that seems a bit silly to me. Any thoughts? -- David Olbersen iGuard Engineer St. Bernard Software 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 ---(end of broadcast)--- TIP 1:

Re: [SQL] Datatype conversion help

2003-07-08 Thread David Olbersen
Yasir, If this is a date you're playing with, simply use: to_char( , 'MM-DD-' ) to get what you want. -- David Olbersen iGuard Engineer St. Bernard Software 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 > -Original M

[SQL] (long) What's the problem?

2003-06-07 Thread David Olbersen
e load on this machine is zero when I attempt this, and no other processes are trying to use massive amounts of resources. This is a P3 550 with 512MB of RAM. I can provide more information if needed. Anybody have ideas about the problem? -- David Olbersen iGuard Engin

[SQL] (long) What's the problem?

2003-06-07 Thread David Olbersen
e load on this machine is zero when I attempt this, and no other processes are trying to use massive amounts of resources. This is a P3 550 with 512MB of RAM. I can provide more information if needed. Anybody have ideas about the problem? -- David Olbersen iGuard Engineer

Re: [SQL] Rows UPDATEd? (solved!)

2003-05-30 Thread David Olbersen
acking. -- David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 > -Original Message- > From: David Olbersen > Sent: Thursday, May 29, 2003 10:01 AM > To: [EMAIL PROTECTED] > Subject: [SQL] Rows UPDATEd? > > > >

[SQL] Rows UPDATEd?

2003-05-30 Thread David Olbersen
ansaction? For what it's worth, a Perl script is doing this using the Pg module. I didn't see anything in the Pg man page describing this. It does cover INSERT and DELETE by using "$cmdStatus = $result->cmdStatus", but not UPDATE. Any suggestions? --

[SQL] Help with LIKE

2003-03-20 Thread David Olbersen
omething instead of LIKE? Thoughts? -- David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] index/join madness

2001-05-23 Thread David Olbersen
On Wed, 23 May 2001, Michael Richards wrote: > Finally, I'm planning on moving this to 7.2 and converting all the > joins to use outer joins. Will there be a significant penalty in > performance running outer joins? Why are you planning on using outer joins? Yes there is a performance penalty be

Re: [SQL] is this proper sql?

2001-04-17 Thread David Olbersen
On Tue, 17 Apr 2001, clayton cottingham wrote: > now i personally dont think this is real sql > anyone? Nope, not real. Although that type of syntax would be handy IMHO. -- Dave ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] DROP TABLE in transaction

2001-04-12 Thread David Olbersen
On Thu, 12 Apr 2001, Peter Eisentraut wrote: > Because DROP TABLE removes the table file on disk, and you can't roll back > that. Actually, in 7.1 you can. ;-) Well I understand that it's being taken from the disk, but why does that action have to be done *right now*? Why can't it be postponed

[SQL] DROP TABLE in transaction

2001-04-12 Thread David Olbersen
Hello. I was wondering if anybody could explain to me why I can't roll back dropping a table. I would think that of all the events that should be rollback-able, dropping a table would be the first on the list. -- Dave ---(end of broadcast)--- TIP

[SQL] Self-Referencing

2001-03-28 Thread David Olbersen
Hello, I have a feeling this isn't going to make much sense, but I'm gonig to try anyway. What I'd like to do is be able to refer to an outer-SELECT from an inner-SELECT. I hope this makes sense. I need to be able to refer to the row that's being processed in a SELECT. I'm going to

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'

Re: [SQL] Optimization via explicit JOINs

2001-03-09 Thread David Olbersen
On Fri, 9 Mar 2001, Stephan Szabo wrote: ->As a question, how many rows does ->select * from playlist p join songs s using (song_id) where ->p.waiting=TRUE; ->actually result in? Well it depends. Most of the time that playlist table is "empty" (no rows where waiting = TRUE), however users can (i

Re: [SQL] Optimization via explicit JOINs

2001-03-09 Thread David Olbersen
On Fri, 9 Mar 2001, Stephan Szabo wrote: -> Hmm, what were the two queries anyway? The "slower" query SELECT to_char( p.insertion_time, 'HH:MI AM MM/DD' ) as time_in, s.nameas title, a.nameas artist, s.length as le

Re: [SQL] Optimization via explicit JOINs

2001-03-09 Thread David Olbersen
On Fri, 9 Mar 2001, Stephan Szabo wrote: ->Not entirely. Those are only estimates, so they don't entirely line up ->with reality. Also, I notice the first estimates 14 rows and the second ->1, which is probably why the estimate is higher. In practice it probably ->won't be significantly diffe

[SQL] Optimization via explicit JOINs

2001-03-09 Thread David Olbersen
Greetings, I've been toying aroudn with postgres 7.1beta5's ability to control the planner via explicitely JOINing tables. I then (just for giggles) compare the difference in the EXPLAIN results. I'm no super-mondo-DBA or anything, but in my two attempts so far, the numbers I get out of

[SQL] explain EXPLAIN?

2001-03-08 Thread David Olbersen
Hello, I'm looking for a better tutorial of how EXPLAIN works. I know Mr. Tom Lane wrote a "quick & dirty explanation" and that "plan-reading is an art that deserves a tutorial, and I haven't had time to write one". In which case I'd like to know if there's any other tutorials/resources.

Re: [SQL] How do I use text script containing SQL?

2001-03-05 Thread David Olbersen
On Mon, 5 Mar 2001, Jeff S. wrote: ->I want to be able to use the file to create my table. ->I've tried psql -d databasename -e < filename.txt ->but that doesn't work. You're making it too dificult :-) 'psql -d databasename < filename.txt' should work just fine -- Dave ---

Re: [SQL] Two way encryption in PG???

2001-03-04 Thread David Olbersen
On Sun, 4 Mar 2001, Boulat Khakimov wrote: ->How do I encrypt/decrypt something in PG? Perhaps it'd be better to one-way encrypt something? Granted I don't know the details of your project, but allowing a way to "decrypt" something is rather insecure. -- Dave ---(end o

Re: [SQL] Temp Tables & Connection Pooling

2001-03-02 Thread David Olbersen
On Fri, 2 Mar 2001, Gerald Gutierrez wrote: ->Recently I wanted to implement Dijkstra's algorithm as a stored procedure, ->and finding that PL/PGSQL cannot return record sets, I thought about using ->a temporary table for the results. If tempoary tables are session-specific, ->however, then would

[SQL] Data Types

2001-02-16 Thread David Olbersen
Hello. I have a table in which I'm trying to store the length of a sound file. I decided to use the TIME data type. Was this correct? One of the operations I want to do is sum() all of my files lengths to get the total amount in terms of time, of sound that I have. I notice that sum() doesn't ta

Re: [SQL] SQL Join - MySQL/PostgreSQL difference?

2001-02-05 Thread David Olbersen
On Thu, 1 Feb 2001, Brice Ruth wrote: ->SELECT -> a.Number, -> a.Code, -> a.Text ->FROM -> b, -> a ->WHERE -> (b.Id = a.Id) AND These next two statements are very ambiguous. Make them explicit as you have with "(b.Id = a.Id)" and "(b.d_Id = 'key3')" Also, be sure that 'key3' is how what y

Re: [SQL] Change or get currentdb

2001-01-25 Thread David Olbersen
>From \? \c[onnect] [dbname|- [user]] connect to new database (currently '') so typing "\c" gives you the database you're currently connected to and "\c " would connect you to that database. On Thu, 25 Jan 2001, Sergiy Ovcharuk wrote: ->How can I change and/or get to know a c

[SQL] Don't want blank data

2001-01-25 Thread David Olbersen
Greetings, Is there a way to have postgresql always return a value for each row requested? To be more clear, if I were using a Perl SQL hybrid I would write something like SELECT computer_ip or 'unset' FROM computers; So that if computers.computer_ip is NULL or '' I will get 'unset' ba

[SQL] Please don't kill me!

2001-01-24 Thread David Olbersen
I have two statements that accomplish the same task and I'm trying to decide which to use. One uses a sub-select, and the other just does a few more joins. I expect that giving the SELECT statement's themseleves won't get me much help, so here is the output of the EXPLAIN query that I ran on both