Re: [SQL] Sequential select queries...??

2001-08-20 Thread Josh Berkus
eans that it is possible to get both your desired rowcounts out of a *single* query, using subselects. "SQL for Smarties" can help you learn to build this kind of query. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus

Re: [SQL] Simple SQL-syntax

2001-08-20 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] user defined function question

2001-08-20 Thread Josh Berkus
s. Browse through and you should find them. -Josh Berkus __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law fir

Re: [SQL] Simple SQL-syntax

2001-08-20 Thread Josh Berkus
message. -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] Simple SQL-syntax

2001-08-20 Thread Josh Berkus
total_of_items FROM (SELECT invoice_id, sum(item_amount) FROM invoice_items) iit WHERE iit.invoice_id = invoices.id; -Josh Berkus __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED]

Re: [SQL] Simple SQL-syntax

2001-08-20 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] Getting 'n-1'th record.

2001-08-21 Thread Josh Berkus
t record, simply reverse the ORDER BY and take the second record. e.g.: If you want the next-to-last (n-1) record from: SELECT * FROM syslog ORDER BY entrytime; Then ask for: SELECT * FROM syslog ORDER BY entrytime DESC LIMIT 1 OFFSET 1; Easy, no? -Josh Berkus __AGLIO DATA

Re: [SQL] Primary vs Unique Index

2001-08-21 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. San Francisc

[SQL] Should I worry?

2001-08-21 Thread Josh Berkus
Folks: Do I need to worry about this: pq_flush: send() failed: Broken pipe ... which appears in the log intermittently? __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED

Re: [SQL] Function returning an array

2001-08-23 Thread Josh Berkus
into 2 fields (e.g. 'element 1|element2') 2. Do the operation in your middleware, where you can use C, Java, Python or similar to pass arrays. -Josh Berkus __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete inform

[SQL] Performance on large functions

2001-08-27 Thread Josh Berkus
n anyone point me in the right direction, or should I be posting this to a different list? -Josh Berkus P.S. Postgres 7.1.2 running on SuSE Linux 7.2 on a Celeron 500/128mb RAM/IDE HDD. __AGLIO DATABASE SOLUTIONS___ Josh Berkus C

[SQL] Date/Time FAQ posted

2001-08-27 Thread Josh Berkus
for users porting from MS SQL Server or SyBase. Grazie! -Josh Berkus __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565

Re: [SQL] WHERE on an alias

2001-08-27 Thread Josh Berkus
me to upgrade ;-) -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 a

Re: [SQL] WHERE on an alias

2001-08-27 Thread Josh Berkus
bly at GROUP BY. -Josh P.S. I'm sure you don't mean for your e-mails to come across as antagonistic when you are asking for help. Can you please be careful of your phrasing? ______AGLIO DATABASE SOLUTIONS___ Josh Berkus Compl

Re: [SQL] WHERE on an alias

2001-08-27 Thread Josh Berkus
with a little nested subselect, but I'm having a lot of difficulty picturing what we're looking at. -Josh __AGLIO DATABASE SOLUTIONS_______ Josh Berkus Complete information technology [EMAIL PROTECTED] and data managemen

Re: [SQL] WHERE on an alias

2001-08-27 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] Performance on large functions

2001-08-27 Thread Josh Berkus
conversation and basically determined that the problem is 90% likely to be disk access time. Bummer 'cause I didn't want to add any hardware to this machine, but, well, there ya go. -Josh __AGLIO DATABASE SOLUTIONS___

Re: [SQL] getting the oid for a new tuple in a BEFORE trigger

2001-08-29 Thread Josh Berkus
me from someone else. I could suggest a couple of workarounds, if you gave a fuller description of exactly what you're trying to accomplish. -Josh Berkus P.S. Please do not cross-post to more than 2 lists at a time. The Postgres lists have been kept to a managable volum

Re: [SQL] Problem with sequences

2001-08-30 Thread Josh Berkus
robably not going to find people on this list capable of diagnosing either problem. Try the pgsql-interfaces list instead. (http://postgresql.advancecreations.com/users-lounge/index.html) -Josh Berkus __AGLIO DATABASE SOLUTIONS_______ J

Re: [SQL] 2 tables, joins and same name...

2001-08-31 Thread Josh Berkus
, twice, to a third table. I don't believe that this structure has a particular name. It's very common. -Josh Berkus *= Bruce, what I mean by "too short" is that you only have about 80 pages of introduction to SQL, which makes it a good first intro but does not bridge the ga

Re: [SQL] 2 tables, joins and same name...

2001-08-31 Thread Josh Berkus
e as airport2 FROM desitination dest JOIN airport depart_air ON dest.airport_dep_id=depart_air.airport_id JOIN airport arrive_air ON dest.airport_arr_id=arrive_air.airport_id Got it? -Josh __AGLIO DATABASE SOLUTIONS_______

Re: [SQL] 2 tables, joins and same name...

2001-09-01 Thread Josh Berkus
hat'll make me friends at Stacy's Bookstore. "I'm not sure of the title, and I don't know the author or publisher, but it's about databases and it's pink." ;-P -Josh __AGLIO DATABASE SOLUTIONS___

Re: [SQL] INSERT Syntax

2001-09-03 Thread Josh Berkus
UES" syntax is only appropriate if you are inserting a set of constants with no SELECT statement involved. -Josh Berkus __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and d

Re: [SQL] More on the TO DO wishlist

2001-09-03 Thread Josh Berkus
fund nor write it myself, so that'll remain a "wish list" item until maybe Red Hat sees money in it. Speaking of which, does anyone know if RH has a seperate "wish list" for what us developer-types would like to see our of RHDB? -Josh __AGLIO DATABASE SOLUTIONS___

Re: [SQL] More on the TO DO wishlist

2001-09-03 Thread Josh Berkus
it into the server. You heard it here first! > Does this mean I'll be forced to learn Emacs? -Josh (Who uses Kedit, Pico, and Joe) __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL P

Re: [SQL] 2 tables, joins and same name...

2001-09-03 Thread Josh Berkus
#x27;ll ask ... -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law firms, small businessesfax 621-2

Re: [SQL] optimizing queries and indexes...

2001-09-09 Thread Josh Berkus
mns in alphabetical order (!?!). They then had to call me, and re-ordering the index columns cut the delay in single-row queries (especially DELETE queries) by 80%. > so, i am hopeful that there is some sort of postgresql performance > faq > for queries. Somebody wanna re-organize

Re: [SQL] optimizing queries and indexes...

2001-09-09 Thread Josh Berkus
s to the database, especially for a marginal query performance gain. To phrase it another way: Optimization problems cost you seconds. DB Design and normalization problems cost you *days*. -Josh Berkus __AGLIO DATABASE SOLUTIONS___

Re: [SQL] group by weirdness

2001-09-10 Thread Josh Berkus
) as mcount FROM ml WHERE ml.state <> 11 GROUP BY jid) ma1, (SELECT jid, COUNT(oid) as mcount FROM ml WHERE ml.state in (2,5) GROUP BY jid) ma2 WHERE j.fkey = 1 AND mj.jid = j.id AND ma1.jid = j.id AND ma2.jid = j.id GROUP BY j.id, j.created, ma1.mcount, m

Re: [SQL] referencing oid impozsible ?

2001-09-11 Thread Josh Berkus
ues perfect for attaching foriegn keys. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law firms, small businesses

Re: [SQL] ERROR: Cannot insert a duplicate key into a unique index

2001-09-12 Thread Josh Berkus
elp there. -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] SQL request change when upgrade from 7.0.2 to 7.1.3

2001-09-14 Thread Josh Berkus
BY statement as you appear to use it in that query is permitted and correct. I suspect that your problem is located somewhere else. For example, what interface tool are you using to send queries to the database? -Josh __AGLIO DATABASE SOLUTIONS___

Re: [SQL] SQL request change when upgrade from 7.0.2 to 7.1.3

2001-09-14 Thread Josh Berkus
Richard, I'm curious now. What happens if you remove the table qualifications, e.g.: ORDER BY type, nom; -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and

Re: [SQL] optimizing queries and indexes...

2001-09-16 Thread Josh Berkus
s/where clauses in the *exact* order of the indecies in SQL Server, it ignores them and does a table scan. This is especially deadly because table scans are about 1/2 as fast in SQL Server as they are in Postgres. -Josh __AGLIO DATABASE SOLUTIONS___

Re: [SQL] Out of free buffers... HELP!

2001-09-19 Thread Josh Berkus
is limited (but I'm not as good as Bruce or Chris) -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law fir

Re: [SQL] How to enter lists into database.

2001-09-24 Thread Josh Berkus
gt; Thanks for any help, Can you be more explicit about what you are attempting? Perhpas yyou could give specific examples from you actual data. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [

Re: [SQL] Request for book reviews/comments

2001-09-24 Thread Josh Berkus
Folks, Also, any reviews on foriegn-language SQL or database books (in the appropriate language) would be appreciated. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED

Re: [SQL] Bug?: Update on ancestor for a row of a child

2001-09-24 Thread Josh Berkus
At least here, you can get a message to the actual database developers. Still, I understand your frustration. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and dat

Re: [SQL] How to enter lists into database:Example.

2001-09-24 Thread Josh Berkus
* search_attributes.attribute_value ) (the ~* allows searches on partial value matches) This will give you these results: 20 Mary Stuart 1600 Pensylvannia Ave. HairBrown 20 Mary Stuart 1600 Pensylvannia Ave. EyesHazel 20 Mary Stuart 1600 Pen

Re: [SQL] CHECK problem really OK now...

2001-09-24 Thread Josh Berkus
course, what they really want is for you to make a commitment to donate twice a year, every year. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management sol

Re: Query does not work: parse ERROR, Re: [SQL] How to enter lists into database: Problems with solution.

2001-09-26 Thread Josh Berkus
I've looked it over again and there's nothing missing. Is it possible, Frederick, that the comma after "matches" or "people_attributes" got cut off? -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berku

Re: [SQL] 7.0.3 and 7.1.3 different results?

2001-10-03 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 or

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

2001-10-18 Thread Josh Berkus
RCHAR ) RETURNS VARCHAR AS' SELECT SUBSTR($1, 1, ((STRPOS($1, ''-'') - 1)); END;' LANGUAGE 'SQL'; Then run: UPDATE main_table SET property_id = remove_propid_tail(property_id) WHERE property_id ~ '-'; -Josh __AGLIO DATABASE SOLUTIONS__

Re: [SQL] system maintained keys

2001-10-19 Thread Josh Berkus
L-SQL is for more 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 Berku

Re: [SQL] oid's in views.

2001-10-19 Thread Josh Berkus
g OIDs 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 f

Re: [SQL] oid's in views.

2001-10-19 Thread Josh Berkus
eys and using those. Some 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

Re: [SQL] Replication

2001-10-18 Thread Josh Berkus
on Postgres, but there are no definite plans. -Josh Berkus __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law f

Re: [SQL] oid's in views.

2001-10-22 Thread Josh Berkus
le, but does have a unique index. The usq is populated by a single sequence "universal_sq" which is shared between tables, thus allowing all tables usq uniqueness between them. This strategy has allowed me to write a number of functions which are table-agnostic, needing only

Re: [SQL] Auto Increment

2001-10-23 Thread Josh Berkus
tml section 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

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

2001-10-23 Thread Josh Berkus
illy", for example, I could: UPDATE table SET name = 'O\'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 backsl

Re: [SQL] oid's in views.

2001-10-24 Thread Josh Berkus
oresighted enough to supply. Unfortunately, that does mean that this solution 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 B

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 organizatio

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
UTIONS___ 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-25 Thread Josh Berkus
ead up on them in the postgreSQL docs. Also see my posts on pgsql-sql for the last week regarding primary keys. -Josh Berkus __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED]

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] an

[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
ast Stop quoting your integers. It should be WHERE user_id = 1346 No quotes for numbers. -Josh __AGLIO DATABASE SOLUTIONS_______ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions

Re: [SQL] GUID in postgres

2001-10-26 Thread Josh Berkus
what happens if you swap out the network card? -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law firms, small bus

Re: [SQL] transposing data for a view

2001-10-31 Thread Josh Berkus
d LEFT OUTER JOIN (SELECT scanid, volume as C_volume 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_______

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

2001-10-22 Thread Josh Berkus
ers of records. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law firms, small businessesfax 621-2

Re: [SQL] GUID in postgres

2001-10-26 Thread Josh Berkus
;3" work just as well, and don't have the 12-byte overhead of a MAC address. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415

Re: [SQL] transposing data for a view

2001-11-01 Thread Josh Berkus
rojects to create roll-ups; it's the "best" SQL92 approach to the "pivot table" problem. However, it will not work in 7.0.3. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information tec

Re: [SQL] transposing data for a view

2001-11-01 Thread Josh Berkus
y to > restructure 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

Re: [SQL] transposing data for a view

2001-11-01 Thread Josh Berkus
Yes, you're right. Sorry! Disregard my commentary about the second view. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions

Re: [SQL] A simple join question that may stump you

2001-09-27 Thread Josh Berkus
A are unique. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law firms, small bu

Re: [SQL] LEFT OUTER JOIN problem

2001-09-27 Thread Josh Berkus
e2.table1_id) LEFT OUTER JOIN table3 ON (table2.id = table3.table2_id); -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 f

Re: [SQL] simple question!

2001-09-28 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

[SQL] Holiday Calculations?

2001-09-18 Thread Josh Berkus
L would be terrific). Thanks! -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law firms, small businessesfa

Re: [SQL] Checking for table existence

2001-09-17 Thread Josh Berkus
RETURN FALSE; ELSE RETURN TRUE; END IF; END;' LANGUAGE 'plpgsql'; ... then you build your function around this: CREATE FUNCTION my_function ( ... ... IF NOT table_exists(''my_table'') THEN CREATE TAB

Re: [SQL] Out of free buffers... HELP!

2001-09-20 Thread Josh Berkus
list is gonna do it, y'know? -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law firms, small businesses

Re: [SQL] select is fast, update based on same where clause is slow

2001-09-21 Thread Josh Berkus
le in the FROM clause, while in Postgres such repetition is prohibited. This is mainly due to the fact that UPDATE ... FROM is not well-defined in the SQL 92 standard. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete inf

Re: Q on "Re: [SQL] select is fast, update based on same where clause is slow "

2001-09-21 Thread Josh Berkus
Josh -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-profi

[SQL] Request for book reviews/comments

2001-09-23 Thread Josh Berkus
SE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law firms, small businessesfax 621-2533 and non-p

Re: [SQL] Stored prosedure last run

2001-09-19 Thread Josh Berkus
osh __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 organiz

Re: [SQL] SQL-Programmer tool and field%type support

2001-10-08 Thread Josh Berkus
upported in PL/pgSQL, but not in Postgres SQL. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law firms, small b

Re: [SQL] [NOVICE] Loading current_user and current_timestamp using COPY

2001-10-10 Thread Josh Berkus
aven't seen any answers on the SQL list. I can think of several workarounds, depending on what kind of a user interface you're using, such as having a linked batches table. -Josh Berkus __AGLIO DATABASE SOLUTIONS_______ Josh Berk

Re: [SQL] referencial conlumn contraints and inheritance

2001-10-14 Thread Josh Berkus
of the application. However, keep in mind that a lot of people (the Postgres core team included) do not agree with me about inheritance and its limitations. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information te

Re: [SQL] 7.0.3 and 7.1.3 different results?

2001-10-03 Thread Josh Berkus
Joel, > A query such as "select sum(pages) from job_documents where > delivery_type='print'" returned 0 in version 7.0.3 if there were no > rows > matching the query. In 7.1.3 the result is NULL if no rows match the > query. Why the change? Which result is "correct" according to the > SQL > stand

Re: [SQL] Quotes and spaces

2001-10-05 Thread Josh Berkus
x27;; > EXECUTE query; > ... > END; > ... I'm pretty sure your quotes are correct. However, I believe "query" is a reserved word. Try using a different variable name. -Josh __AGLIO DATABASE SOLUTIONS___

Re: [SQL] SQL CONSTRAINTS - Constraining time values from two attributes on a table.

2001-10-05 Thread Josh Berkus
lue that ensures it is allways after another attribute value called > departure_time (declared as TIME). > Any know how this constraint would be written?? Easy: CONSTRAINT arr_dep_time CHECK ( arrival_time > departure_time ) __AGLIO DATABASE SOLUTIONS_______

Re: [SQL] MEDIAN as custom aggregate?

2001-10-16 Thread Josh Berkus
BASE 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 Fran

Re: [SQL] PgAdmin

2001-09-25 Thread Josh Berkus
This is in the pgadmin installation instructions. -Josh Berkus __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions (415) 565-7293 for law f

Re: [SQL] How to enter lists into database: Problems with solution.

2001-09-26 Thread Josh Berkus
re-arrange the query slightly, you can turn it into a view. The trick is to have the search_id as an output column rather than a WHERE clause item in the sub-selects. Have fun! -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Comp

[SQL] Indexing behavior

2001-10-02 Thread Josh Berkus
ely by the PostgreSQL engine. Otherwise, such indexes are useless and may even slow down queries. Feedback? Answers? -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED]

Re: [SQL] Loading current_user and current_timestamp using COPY

2001-10-09 Thread Josh Berkus
ateTimestamp columns are last. 2.2. Set the defaults on those columns to current_user and current-timestamp. 2.3. COPY all columns except those two. They should populate according to the defaults (I hope). -Josh __AGLIO DATABASE SOLUTIONS___

Re: [SQL] to_date/to timestamp going to BC

2001-10-04 Thread Josh Berkus
Karel, > .. well, I add it to my TODO for 7.3 (I plan rewrite several things > in to_* functions). How about a to_char function for INTERVAL? Please, oh please? -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Co

Re: [SQL]maximum parameters limit to function & manipulating array in plpgsql

2001-10-04 Thread Josh Berkus
ally, you can declare an array as a parameter of a function, but that's it. You cannnot have array variables or retuurn types. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology

Re: [SQL] SQL Syntax / Logic question

2001-10-04 Thread Josh Berkus
possible that any particular person went to more than one school, add: GROUP BY frienda, friendb Simple, neh? -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data man

[SQL] Beginner's List

2001-10-04 Thread Josh Berkus
1 beginner question per day. But I can't figure out how to do this without subscribing to pgsql-beginner and suffering a deluge of 100's of e-mails. Can anyone suggest something? -Josh Berkus __AGLIO DATABASE SOLUTIONS___ Jo

[SQL] MEDIAN as custom aggregate?

2001-10-12 Thread Josh Berkus
he Mean and the Median you can do all kinds of interesting statistical analysis. -Josh Berkus __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solutions

Re: [SQL] MEDIAN as custom aggregate?

2001-10-12 Thread Josh Berkus
1 OFFSET middlerec('pageviews')) med GROUP BY site, median_views; Where middlerec is a custom function that counts the records and returns the middle one. -Josh __AGLIO DATABASE SOLUTIONS_______ Josh Berkus Complete informat

Re: [SQL] Alias Join Table

2001-10-04 Thread Josh Berkus
Keith, There are a number of posts and papers on tree structures , both in the SQL list archives, and on Roberto Mello's resources at techdocs.postgresql.org. -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Com

Re: [SQL] SQL reference card

2001-10-15 Thread Josh Berkus
Failing that, you can write your own and post it to Techdocs.postgresql.org. That's what open source is all about! -Josh __AGLIO DATABASE SOLUTIONS_______ Josh Berkus Complete information technology [EMAIL PROTECTED]

Re: [SQL] problem w/plpgsql proc

2001-10-15 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

Re: [SQL] Cenceptual help needed - periodic events

2001-10-15 Thread Josh Berkus
e fly by a complex view. So it depends on the number and complexity of the rules you will be applying. If the rules are very complex and/or require procedural logic, you probably want to generate and store records. Otherwise, no. -Josh __AGLIO DATABASE SOLUTIONS____

[SQL] EXECUTE ... INTO?

2001-10-15 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

[SQL] Performance problems - Indexes and VACUUM

2001-10-16 Thread Josh Berkus
uppose that this can be dealt with, but until then does anyone have any suggestions? -Josh Berkus __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete information technology [EMAIL PROTECTED] and data management solution

Re: [SQL] Variables.

2001-10-17 Thread Josh Berkus
ourse, it is an Open-Source project, 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 mana

Re: [SQL] Performance problems - Indexes and VACUUM

2001-10-17 Thread Josh Berkus
Tom, > I don't believe a single word of that explanation ... whatever is > going > on here, that ain't it. A new table is going to have a new OID, and > so will its indexes; there is no way that Postgres will confuse it > with > the old one, even if bits of the old one were still hanging around

<    1   2   3   4   5   6   7   8   9   >