Re: [SQL] Date/Time types

2002-09-27 Thread Josh Berkus
what the syntax you want for an extra-precision timestamp is. Assuming there is one at all, which there may not be ... I'd also advise against creating tables with reserved words (such as date ) as column names. It can cause you all kinds of headaches later on, -Josh Berkus

Re: [SQL] Passing array to PL/SQL and looping

2002-09-27 Thread Josh Berkus
declare an Array data type. Annoying, really. -Josh Berkus ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through

Re: [SQL] Null not equal to '' (empty)

2002-09-27 Thread Josh Berkus
BOOLEAN AS ' SELECT $1 IS NULL OR BTRIM($1) = ''; ' LANGUAGE 'sql' WITH (ISCACHABLE); CREATE FUNCTION is_empty( NUMERIC ) RETURNS BOOLEAN AS ' SELECT $1 IS NULL OR $1 = 0::NUMERIC; ' LANGUAGE 'sql' WITH (ISCACHABLE); etc. This will give you an all-purpose empty value detector. -Josh Berkus Aglio

[SQL] PGSQL-Performance mailing list.

2002-09-27 Thread Josh Berkus
5. query parsing for efficiency 6. etc. Please join me there! To subscribe, send an e-mail to: [EMAIL PROTECTED] ... with only the word subscribe in the body of the message. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast

Re: [SQL] Passing array to PL/SQL and looping

2002-09-26 Thread Josh Berkus
AS ' DECLARE id_array ALIAS for $1; count_it INT; BEGIN count_it := 1; WHILE id_array[count_it] LOOP count_it := count_it + 1; END LOOP; RETURN (count_it - 1); END;' LANGUAGE 'plpgsql'; returns the number of elements in the supplied array. -- Josh Berkus [EMAIL PROTECTED] Aglio

Re: [SQL] Timestamp Error - 7.2

2002-09-25 Thread Josh Berkus
if you still want help. Please: 1. Post table defintions. 2. Post your *actual* SQL statements which trigger the error, not example ones which you have nto actually tested. -Josh Berkus ---(end of broadcast)--- TIP 3: if posting/reading through Usenet

Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-24 Thread Josh Berkus
of not breaking backward compatibility. We could introduce the new version of now() in 7.4, encourage everyone to use it instead of other timestamp calls, and then in 7.5 change the behavior of current_timestamp for SQL92 compliance. -Josh Berkus ---(end of broadcast

Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-23 Thread Josh Berkus
that behaviour without breaking many people's applications. Ideally, since we get this question a lot, that a compile-time or execution-time switch to change the behavior of current_timestamp contextually would be nice. We just need someone who;s interested enough in writing one. -- -Josh Berkus

Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-23 Thread Josh Berkus
worth returning such stale time information? Then what *was* the reasoning behind the current behavior? -- -Josh Berkus __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED

Re: [SQL] Performance w/ multiple WHERE clauses

2002-09-23 Thread Josh Berkus
FREEZE ... between data updates, which will give you the best performance possible. But not if the data is actually going to be edited, even slightly. See the online manual entries about VACUUM for an explanation. -- -Josh Berkus Aglio Database Solutions San Francisco

Re: [SQL] Performance w/ multiple WHERE clauses

2002-09-20 Thread Josh Berkus
to raise the cost of seq_scans for parser estimates. 3) Test this all again when 7.3 comes out, as parser estimate improves all the time. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 5: Have you checked

Re: [SQL] help w/ constructing a SELECT

2002-09-20 Thread Josh Berkus
it? -Josh Berkus ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send unregister YourEmailAddressHere to [EMAIL PROTECTED])

Re: [SQL] help w/ constructing a SELECT

2002-09-19 Thread Josh Berkus
possibilities: 1. All contigs with one or more clones whose read = 'x' and those clones. 2. All contigs with one or more clones whose read = 'x' and all of those contig's clones 3. All contigs where all clones have read = 'x' Which do you want? -- -Josh Berkus Aglio Database Solutions San Francisco

Re: [SQL] LIMIT within UNION?

2002-09-12 Thread Josh Berkus
. The outer query then re-sorts this result in zip order. This seems, to me, much more flexible than using a UNION query. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 6: Have you searched our list archives

Re: [SQL] writing a function to mimic mysql last_insert_id

2002-09-11 Thread Josh Berkus
Beth, I am wondering if I can get some input on the logic that I would need to code a function that would mimic mysql's last_insert_id().. Um, what about CURRVAL('sequence-name')? -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast

Re: [SQL] writing a function to mimic mysql last_insert_id

2002-09-11 Thread Josh Berkus
a replacement function, please post it on TechDocs! -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html

Re: [SQL] Hardware performance for large updates

2002-09-06 Thread Josh Berkus
that fdatasync works better than (the default) fsync for wal_sync_method. Yes, I am. Any particular reason why fdatasync works better? Thanks a lot! -Josh Berkus ---(end of broadcast)--- TIP 6: Have you searched our list archives? http

Re: [SQL] fumbling for join syntax

2002-09-05 Thread Josh Berkus
: select triv_a_r.login as user, SUM(CASE WHEN triv_a_r.ans = triv_q_r.ans THEN 1 ELSE 0 END) as score, sum(triv_a_r.tm)/1000 as time from triv_a_r LEFT OUTER JOIN triv_q_r ON (triv_a_r.tq_id = triv_q_r.id) group by triv_a_r.login order by score desc, time asc; Josh Berkus

[SQL] Hardware performance for large updates

2002-09-05 Thread Josh Berkus
(done as a function) takes 10-15 minutes. During this time, the CPU is never more than 31% busy, only 256mb of 512 is in use, and the disk channel is only 25% - 50% saturated.As such, is seems like we could run things faster. What does everybody suggest tweaking? -Josh Berkus

Re: [SQL] tree structures in sql - my point of view (with request of comment from joe celko)

2002-09-03 Thread Josh Berkus
, are harder to build GUI tools for, but are much, much faster for determining branch membership and branch parenthood. So which model you use depends on what you intend to do with the tree. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast

Re: [SQL] Why must the function that a trigger calls return opaque ???

2002-08-30 Thread Josh Berkus
/deleted row. If you want a function to return a value, don't use a trigger. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs

Re: [SQL] How to Select with more than one AND in a Where SQL Clause?

2002-08-30 Thread Josh Berkus
. This is not a PostgreSQL problem, it is a problem with whatever program you're using. Use different database tools, or access PostgreSQL directly through PSQL. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 1

Re: [SQL] union optimization in views

2002-08-29 Thread Josh Berkus
anything (of course I could have missed references). I'd take this up on PGSQL-HACKERS. The UNION VIEW optimization, last I checked, was stalled mainly because nobody wanted to work on it. Maybe you can? -- -Josh Berkus Aglio Database Solutions San Francisco ---(end

Re: [SQL] triggers and plpgsql question

2002-08-27 Thread Josh Berkus
. See the online documentation on writing triggers in C; that is the only way to get what you want. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[SQL] Calculation Error on Epoch?

2002-08-27 Thread Josh Berkus
Folks, I'm having a problem with: SELECT date_part('epoch','2002-08-28'::TIMESTAMP) Which is consistently returning an epoch timestamp that evaluates to 8.27.2002. Is this a known issue? A cross-platform problem? Suggestions? -Josh Berkus ---(end of broadcast

Re: [SQL] reverse() on strings

2002-08-26 Thread Josh Berkus
that if the function receives a NULL, it will output a NULL, and thus saves the parser the time running NULLs through the function. Also, remember to use this index, you'll have to call the exact same function in your queries. -- -Josh Berkus Aglio Database Solutions San Francisco

Re: [SQL] getting ILIKE or ~* to use indexes....

2002-08-10 Thread Josh Berkus
search, meaning that you are searching for 'rajesh' anywhere in the field. No standard index can help you with that. Instead, you should look into Full Text Search tools. There's a simple one in /contrib in the Postgresql source, and an more robust one available from the OpenFTS project. -Josh

Re: [SQL] How to update record in a specified order

2002-08-09 Thread Josh Berkus
JLL, I want to update a field with a 'NEXTVAL', but I want the record updated in a specific order. Any simple way of doing this other than having to create a temp table? Please be more speciifc. What do you mean, specified order? -- -Josh Berkus Aglio Database Solutions San Francisco

Re: [SQL] How to update record in a specified order

2002-08-09 Thread Josh Berkus
''Done updating.''; END;' LANGUAGE 'plpgsql'; -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so

Re: [SQL] retrieving all rows from a tree in one select - how ?

2002-08-09 Thread Josh Berkus
Guys, Check out Joe Celko's two chapters on tree structures in the 2nd edition of SQL for Smarties. It's pretty comprehensive. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 6: Have you searched our list

Re: [SQL] [NOVICE] Aggregates and Indexes

2002-08-03 Thread Josh Berkus
. Further, I do not consult with the PostgreSQL global development team before mouthing off; my opinions are mine, not those of the postgresql project. Thus, the comment in so many of my e-mails of I am not a core developer. Capisce? -Josh Berkus ---(end of broadcast

Re: [SQL] Triggers for inserting on VIEWS

2002-08-03 Thread Josh Berkus
, which were a lot like triggers but are better tailored to deal with inserts and updates on VIEWs. See: http://www.us.postgresql.org/users-lounge/docs/7.2/postgres/rules.html -Josh Berkus ---(end of broadcast)--- TIP 3: if posting/reading through Usenet

[SQL] STATISTICS?

2002-08-03 Thread Josh Berkus
Folks, Can anyone point me to documentation on the new STATISTICS features of 7.2? I can't seem to find anything in the online docs, except the barest mention of ALTER TABLE SET STATISTICS (which doesn't explain what to do with the info). -Josh Berkus ---(end

Re: [SQL] STATISTICS?

2002-08-03 Thread Josh Berkus
Mallah, do you need http://www.postgresql.org/idocs/index.php?monitoring-stats.html ? Yes, thank you! That was exactly what I was looking for. -Josh Berkus ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send

Re: [SQL] [NOVICE] Aggregates and Indexes

2002-08-02 Thread Josh Berkus
; the second is probably the best long-term solution, but would require a great deal of innovation. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister

Re: [SQL] What about this?

2002-08-02 Thread Josh Berkus
Wei, Why can't postmaster run VACUUM ANALYZE automatically every once in a while? Since it is a very useful feature... Because such a practice is not appropriate for everyone's database installation, that's why. -- -Josh Berkus Aglio Database Solutions San Francisco

Re: [SQL] Add Primary Key to a Table

2002-08-02 Thread Josh Berkus
is supported with Postgres 7.2, but not with earlier versions. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED

Re: [SQL] COUNT DISTINCT?

2002-07-30 Thread Josh Berkus
Stephan, Would that be the same as: select count(distinct skip_date) from weekend_list where ... Yeah, that would be what I was looking for. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 4: Don't

[SQL] Abbr. for TIMESTAMP WITHOUT TIME ZONE?

2002-07-28 Thread Josh Berkus
Folks, Is there a postgresql-accepted abbreviation for TIMESTAMP WITHOUT TIME ZONE? I'm using that data type a lot, and it's getting kinda tedious to key in. I know that TIMESTAMP WITH TIME ZONE can be abbreviated timestamptz. Surely there's an equivalent for WITHOUT? -- -Josh Berkus

Re: [SQL] Trying to write a function...

2002-07-24 Thread Josh Berkus
as follows: CREATE FUNCTION f_addrtr (varchar(16),varchar(32)) RETURNS bool AS ' DECLARE index int4; BEGIN index := nextval(''s_routerid''); INSERT INTO t_routers VALUES (index, $1, $2); RETURN TRUE; END;' LANGUAGE 'plpgsql'; -- -Josh Berkus Aglio Database Solutions San Francisco

Re: [SQL] Case in-sensitive

2002-07-24 Thread Josh Berkus
pattern Though, keep in mind, lower(textfield) can be indexed, but ILIKE textfield cannot. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send

Re: [SQL] Scan SQL

2002-07-23 Thread Josh Berkus
? -Josh Berkus ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Misunderstanding about your article entitled: Episode 2:

2002-07-23 Thread Josh Berkus
?) then the uniqueness check will happen only at the *end* of a transaction, and a unique index on this kind of a column will be permitted. Currently, it raises an error preventing column re-ordering. -Josh Berkus ---(end of broadcast)--- TIP 1: subscribe

Re: [SQL] Editor for pgsql

2002-07-22 Thread Josh Berkus
/pgSQL. I even double-quote without thinking about it. You might want to send an e-mail to ActiveState suggesting that they could take on SQL script dialects (SQL, T-SQL, PL/SQL, PL/pgSQL and 4GL) as a new ActiveState IDE. Make sure they know you're willing to pay for development software. -Josh

Re: [SQL] Editor for pgsql

2002-07-22 Thread Josh Berkus
(or Emacs, for that matter). They're certainly powerful tools, but I can never set aside the 2 weeks of downtime required to get up to speed in either text editor. So Kate and Joe are my friends.grin -- -Josh Berkus Aglio Database Solutions San Francisco ---(end

Re: [SQL] Editor for pgsql

2002-07-22 Thread Josh Berkus
the time. I tried to install Tora, but the build blew up since I don't have Oracle installed. Any tips? -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Indexing UNIONs

2002-07-18 Thread Josh Berkus
Bruno, My suggestion: SELECT t3.id, coalesce(t1.name, t2.name), t1.abbreviation, coalesce(t1.juris_id, t2.juris_id) from (t3 left join t1 using (id)) left join t2 using (id); Cool! I didn't think of that. I'll give it a try. -Josh ---(end of

Re: [SQL] Indexing UNIONs

2002-07-17 Thread Josh Berkus
the right table. Yeah, I'm doing that in some places. It just doesn't work for all queries. COALESCE() is my friend. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http

Re: [SQL] Indexing UNIONs

2002-07-16 Thread Josh Berkus
Bruno, It wouldn't have to be a dummy table. You could have both sets of data in the same table. Per my original e-mail, this is not an option. Basically, the two tables have nothing in commmon *except* that events can be scheduled against either table. Otherwise, the two tables have

Re: [SQL] A SQL Training

2002-07-16 Thread Josh Berkus
tree structure (based on Joe Celko's work) in PostgreSQL. Until then, buy a copy of SQL for Smarties, 2nd ed. by Joe Celko. He has two chapters on tree structure. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast

Re: datatype matrix (was: Re: [SQL] Sorry..)

2002-07-16 Thread Josh Berkus
about a volunteer to write one? -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html

Re: [SQL] Indexing UNIONs

2002-07-16 Thread Josh Berkus
. Thus, I need to relate (in views and queries) each Event to the Union of Cases and Trial Groups. I just can't figure out how to do so without the database discarding the indexes on Cases in the process and things slowing to a crawl. -- -Josh Berkus Aglio Database Solutions San Francisco

[SQL] Indexing UNIONs

2002-07-15 Thread Josh Berkus
, suggestions? And no, putting the data from both tables into one is not an option for various schema reasons. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 6: Have you searched our list archives? http

Re: [SQL] Sorry..

2002-07-15 Thread Josh Berkus
to text or vice versa. I'd suggest making the explicit cast of numeric to text be the exact equivalent of: SELECT btrim(to_char(numeric, '999,999,999,999.99')) or similar. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast

Re: [SQL] Indexing UNIONs

2002-07-15 Thread Josh Berkus
, no filtering within subqueries, etc.) that index usage would be reasonable to implement. However, I can't program it myself, so I'll have to just stick to whining and pitiful pleading blink puppy-dog eyes, sniffle -- -Josh Berkus Aglio Database Solutions San Francisco ---(end

Re: [SQL] config postgresql.conf??

2002-07-12 Thread Josh Berkus
Jie, What parameter I should change in order to make postmaster taking CPU as much as possible? Maybe I should ask: how can I make big tables equijoin faster? I have a serveral tables that contain more 2.5 million records, I need to equijoin those tables often. There are several good

[SQL] BETWEEN bug?

2002-07-10 Thread Josh Berkus
'::TIMESTAMP; ?column? -- t (1 row) The above behaviour does not seem logical; is this a SQL spec thing, or a bug? -- -Josh Berkus ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send

Re: [SQL] BETWEEN bug?

2002-07-10 Thread Josh Berkus
on. Thanks. Thought it was something like that. Thank you guys, though, OVERLAPS is asymmetric. -- -Josh Berkus __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data

Re: [SQL] BETWEEN bug?

2002-07-10 Thread Josh Berkus
Stephan, Thanks. Thought it was something like that. Thank you guys, though, OVERLAPS is asymmetric. Err ... I meant symmetric. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 6: Have you searched

Re: [SQL] PLPGSQL language documentation

2002-07-09 Thread Josh Berkus
programming to be invaluable in helping me develop an organized approach toward manageing a database using functions. However, the rest of the book is Oracle stuff not supported by Postgres, so you decide if it's worth the $50. -- -Josh Berkus __AGLIO DATABASE

Re: [SQL] transaction in plpgsql

2002-06-27 Thread Josh Berkus
have to support nested transactions ... which we currently don't. Nested transactions and MVCC are somewhat of a tangle to reconcile, and we don't expect a solution until Postgres 8.0 (if then). -Josh Berkus ---(end of broadcast)--- TIP 6: Have you

Re: [SQL] Limiting database size

2002-06-26 Thread Josh Berkus
Eric, I like the idea of putting it on a hard disk or partition of fixed size and waiting for the DB to simply crash. hahaha Yeah. grin It's what MS SQL Server does, though. As I said, I think the whole concept of limiting database size in MB is fundamentally flawed. I mean, what's

Re: [SQL] Can somebody help me to optimize this huge query?

2002-06-24 Thread Josh Berkus
the whole thing happen in RAM. FInally, how big are these tables? If we're talking 200mb of data, and you're using IDE drives, you'll need a hardware upgrade -- like a UW SCSI RAID array. DIsk I/O has a *big* impact on database efficiency. -- -Josh Berkus __AGLIO DATABASE

Re: [SQL] Request for builtin function: Double_quote

2002-06-24 Thread Josh Berkus
Tom, Done; I also added its sister function quote_ident. See the devel docs at http://candle.pha.pa.us/main/writings/pgsql/sgml/functions-string.html Tante Grazie. -- -Josh Berkus ---(end of broadcast)--- TIP 6: Have you searched our

Re: [SQL] SQL Challenge: Skip Weekends

2002-06-21 Thread Josh Berkus
Jean-Luc, date := now - day_of_the_week interval := interval + day_of_the_week date := date + int( interval/5)x7 + ( interval mod 5) Merci, merci, merci! -Josh ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an

Re: [SQL] SQL Challenge: Skip Weekends

2002-06-21 Thread Josh Berkus
and Jean-Luc's, and see which works better/faster. And report back. -Josh Berkus ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] skip weekends

2002-06-21 Thread Josh Berkus
Rudi, Nice reply Josh. I wouldn't call your solution 'ugly' at all. Actually I posed te question, and Joe Conway offered the solution. I'll be testing and reporting back. It's an excellent example of a real world need for Postgresql functions. I've also been looking at other functions at

Re: [SQL] is it easy to change the create sequence algorithm?

2002-06-21 Thread Josh Berkus
Kevin, I see in the docs that when I create a column that is of type SERIAL, the engine automatically creates the sequence for me, named TABLE_COLUMN_seq. That's great until the table name + column name lengths are 27 chars, then it starts chopping, and you guessed it, I have multiple

Re: [SQL] SQL performance issue with PostgreSQL compared to

2002-06-20 Thread Josh Berkus
only index plain normal column iscachable functions. No, you're correct. I meant just to index on the bytes field. -- -Josh Berkus ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs

Re: [SQL] how to sort a birthday list ?

2002-06-20 Thread Josh Berkus
EXTRACT( YEAR FROM AGE(dateofbirth) ) EXTRACT( YEAR FROM AGE( CURRENT_DATE+60, dateofbirth ) ) ORDER BY their_age, person_name As an example. -- -Josh Berkus ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL

[SQL] SQL Challenge: Skip Weekends

2002-06-20 Thread Josh Berkus
of the week of our starting date. My head hurts trying to figure this one out. -- -Josh Berkus ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Request for builtin function: Double_quote

2002-06-18 Thread Josh Berkus
passed to it, including quote marks. Useful for nesting quotes, such as in the EXECUTEing dynamic queries. example result quote_literal('O''Reilly') 'O''Reilly' -Josh Berkus -Josh Berkus ---(end of broadcast)--- TIP 1

Re: [SQL] date_part

2002-06-18 Thread Josh Berkus
Rudi, select to_char(date_column, 'Month'); See similar under Formatting Function in the docs. -- -Josh Berkus ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL

Re: [SQL] ON DELETE CASCADE question

2002-06-14 Thread Josh Berkus
Wei, Does ON DELETE CASCADE attribute you specify in CREATE TABLE statement actually create triggers for every foreign key it refers to? Yes. Two triggers for each key, I think. -Josh ---(end of broadcast)--- TIP 4: Don't 'kill -9' the

Re: [SQL] Another postgres 'file not found' error

2002-06-13 Thread Josh Berkus
management errors. Regardless, you'd better shutdown Postgres and defer all work on the database until you've diagnosed your hardware/configuration problem. I hope you have a previous backup, as you may find that you need to revert to an earlier backup to restore your data. -Josh Berkus

Re: [SQL] Another postgres 'file not found' error

2002-06-13 Thread Josh Berkus
it. It's also possible that one or more of the accessory applications you are using is playing fast and loose with the filesystem, and in the process damaging some of the Postgres files. -- -Josh Berkus ---(end of broadcast)--- TIP 6: Have you

[SQL] Isn't there a better way?

2002-06-13 Thread Josh Berkus
aggregated view twice. It seems like there must be a more efficient way to build this query, but I can't think of one. Suggestions? -Josh Berkus P.S. This is based on Joe Celko's Linear Nested Model of tree construction. ---(end of broadcast

Re: [SQL] serial column vs. explicit sequence question

2002-06-13 Thread Josh Berkus
value for the N rows in the detail table. Hey, what about CURRVAL('sequence_name')? -- -Josh Berkus ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html

Re: [SQL] SQL FUNCTION return type on INSERT

2001-11-03 Thread Josh Berkus
Eddy, What value should I RETURN for a SQL FUNCTION that contains an INSERT statement? OPAQUE. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management

[SQL] Book reviews are up

2001-11-03 Thread Josh Berkus
. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law firms, small businessesfax 621-2533 and non

Re: [SQL] Strange Problem As Type Casting

2001-11-03 Thread Josh Berkus
No quotes for numbers. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law firms, small businessesfax 621-2533

Re: [SQL] transposing data for a view

2001-11-01 Thread Josh Berkus
this solution to get around this limitation? No, you need to upgrade. What's the obstacle to using 7.1.3, anyway? -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data

Re: [SQL] transposing data for a view

2001-11-01 Thread Josh Berkus
! Disregard my commentary about the second view. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law firms, small

Re: [SQL] transposing data for a view

2001-10-31 Thread Josh Berkus
FROM volumes WHERE region = 'C') cv ON scan.scanid = cv.scanid ORDER BY scanid; This approach can be adapted to include aggregates and the like. -Josh Berkus __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information

Re: [SQL] Connecting to different DataBase In PlPgsql Function

2001-10-26 Thread Josh Berkus
Bhuvan, How can we connect to different database using plpgsql function? Can we? No, you can't. -Josh ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] Diferent databases on same query...

2001-10-26 Thread Josh Berkus
Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law firms, small businessesfax 621-2533 and non-profit organizations. San Francisco ---(end

Re: [SQL] GUID in postgres

2001-10-26 Thread Josh Berkus
__AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law firms, small businessesfax 621-2533 and non-profit

Re: [SQL] GUID in postgres

2001-10-26 Thread Josh Berkus
SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law firms, small businessesfax 621-2533 and non-profit organizations. San Francisco

Re: [SQL] oid's in views.

2001-10-24 Thread Josh Berkus
is not portable to other RDBMSs, but as PostgreSQL grows in market share, that's less of a concern. -Josh Berkus __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management

Re: [SQL] GUID in postgres

2001-10-24 Thread Josh Berkus
Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law firms, small businessesfax 621-2533 and non-profit organizations. San Francisco

Re: [SQL] Auto Increment

2001-10-23 Thread Josh Berkus
3.1.1 I can't imagine how it would be more clear. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law firms, small

Re: [SQL] can't update 'c:\windows'

2001-10-23 Thread Josh Berkus
\'Reilly'; Since you want to save an actual backslash, do this: UPDATE table SET field = 'C:\\windows'; In your interface code, you may which to add a function that doubles your backslashes. -Josh Berkus __AGLIO DATABASE SOLUTIONS___

Re: [SQL] oid's in views.

2001-10-22 Thread Josh Berkus
all tables usq uniqueness between them. This strategy has allowed me to write a number of functions which are table-agnostic, needing only the usq to do their job (such as a function that creates modification hisotry). -Josh Berkus __AGLIO DATABASE SOLUTIONS___

Re: [SQL] Index of a table is not used (in any case)

2001-10-22 Thread Josh Berkus
__AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law firms, small businessesfax 621-2533 and non-profit organizations

Re: [SQL] system maintained keys

2001-10-19 Thread Josh Berkus
advanced SQL issues. Yes, you can do this easily, Please see: http://www.postgresql.org/idocs/index.php?datatype.html#DATATYPE-NUMERIC Look at secion 3.1.1 on the page. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete

Re: [SQL] oid's in views.

2001-10-19 Thread Josh Berkus
as an index, and you've just found one more! -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law firms, small

Re: [SQL] oid's in views.

2001-10-19 Thread Josh Berkus
Trigger types require referencing the OID, but that's about it. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293

Re: [SQL] Doing a regexp-based search/replace?

2001-10-18 Thread Josh Berkus
)); END;' LANGUAGE 'SQL'; Then run: UPDATE main_table SET property_id = remove_propid_tail(property_id) WHERE property_id ~ '-'; -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL

[SQL] Performance problems - Indexes and VACUUM

2001-10-17 Thread Josh Berkus
then does anyone have any suggestions? -Josh Berkus __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law firms, small

Re: [SQL] Variables.

2001-10-17 Thread Josh Berkus
, so if you hire your own programmer, you can do anything you want. -Josh Berkus __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565

<    1   2   3   4   5   6   7   >