Re: [SQL] Unique index VS unique constraint

2013-10-04 Thread Steve Grey
Unique indexes can be partial, i.e. defined with a where clause (that must be included in a query so that PostgreSQL knows to use that index) whereas unique constraints cannot. JORGE MALDONADO wrote I have search for information about the difference between unique index and unique constraint in

Re: [SQL] how can I replace all instances of a pattern

2013-03-26 Thread Steve Crawford
need to add a global flag: regexp_replace(column_name,'\W','','g') See examples under http://www.postgresql.org/docs/9.1/static/functions-matching.html#FUNCTIONS-POSIX-REGEXP Cheers, Steve

Re: [SQL] Split a string to rows?

2013-01-07 Thread Steve Crawford
On 01/07/2013 11:44 AM, Emi Lu wrote: Is there a function to split a string to different rows?... Have you looked at regexp_split_to_table? Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref

Re: [SQL] Simple Upgrade from PostgreSQL version 8.1.11 (With schemas)

2012-07-10 Thread Steve Crawford
to a newer version (anything past 8.3? 8.4) you can use the new upgrade tools moving forward to minimize downtime during the upgrade process but you will *always* need to test and evaluate before deploying. Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes

Re: [SQL] Simple way to get missing number

2012-04-24 Thread Steve Crawford
4 6 8 10 12 14 Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Simple way to get missing number

2012-04-24 Thread Steve Crawford
allnumbers not in (select anumber from fooo); They all give you the same result. The right choice will depend on the size of your table, how it is indexed, how fully it is populated and even on your version of PostgreSQL. (Apologies for the funky field/table naming.) Cheers, Steve -- Sent

Re: [SQL] how to concatenate in PostgreSQL

2012-03-27 Thread Steve Crawford
On 03/27/2012 07:48 AM, Rehan Saleem wrote: well i am quite sure its PostgreSQL forum and it is obvious, i am asking this to concatenate in plpgsql. *From:* Steve Crawford scrawf...@pinpointresearch.com *To:* pgsql-sql

Re: [SQL] how to concatenate in PostgreSQL

2012-03-26 Thread Steve Crawford
=' + 5 exec(sqi) where 5 is the userid from table1 thanks Cheers, Steve

Re: [SQL] Setting the process title, or can I?

2012-03-20 Thread Steve Crawford
that need a longer timeout you can change just for those statements. Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] querying a column w/ timestamp with timezone datatype

2012-01-30 Thread Steve Crawford
that exists due to SQL requirements but which is a somewhat nonsensical type, the use of which is not recommended): http://www.postgresql.org/docs/9.1/static/datatype-datetime.html#DATATYPE-TIMEZONES Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes

Re: [SQL] Update Mass Data in Field?

2012-01-26 Thread Steve Crawford
and includes the @ sign in the expression to avoid accidentally matching something like ...@theholyghost.org. You can always do a select of the emp_email alongside the replacement expression to be sure it will do what you want before actually updating your database. Cheers, Steve -- Sent via pgsql

Re: [SQL] date range to set of dates expansion

2012-01-19 Thread Steve Crawford
goodness. Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Unable To Modify Table

2012-01-12 Thread Steve Crawford
? Try updating the values in both tables within a transaction with constraints set to deferred: http://www.postgresql.org/docs/current/static/sql-set-constraints.html Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] internal format of timstamp?

2011-12-29 Thread Steve Crawford
, but suspect that your first step should be to check pg_config to see if the server from which you are attempting to recover data was compiled with --enable-integer-datetimes. Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

[SQL] plpgsql function executed multiple times for each return value

2011-10-08 Thread Steve Northamer
my questions are: 1) How do we cause the paymentcalc function to be executed only once? and 2) How do we call a table returning function with inputs from a table? Thank you very much! Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription

Re: [SQL] how to calculate differences of timestamps?

2011-09-27 Thread Steve Crawford
suffice for most cases. Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Mysterious column name

2011-08-09 Thread Steve Crawford
/9.0/static/rowtypes.html on composite data types and scroll to section 8.15.3. Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] why these results?

2011-08-01 Thread Steve Crawford
%'; count --- 98 (1 row) Shouldn't it be 99? That is out of 100 records there is one that has text in column col so the !~~* should return 99 rows. ?? -wes select count(*) from table where col is null; (null is neither equal nor not-equal to anything, even null) Cheers, Steve -- Sent via

Re: [SQL] How to remove a set of characters in text-columns ?

2011-06-30 Thread Steve Crawford
be a more elegant way. Is there ? regards Look at regexp_replace() http://www.postgresql.org/docs/9.0/static/functions-string.html http://www.postgresql.org/docs/9.0/static/functions-matching.html#FUNCTIONS-POSIX-REGEXP Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql

Re: [SQL] self join

2011-05-16 Thread Steve Crawford
On 05/14/2011 07:36 PM, Jasen Betts wrote: use the NOT IN operator with a subquery to retch the disallowed values Hmmm, retch as a synonym for output? I've seen more than one case where that is an appropriate description. :) Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql

Re: [SQL] convert in GMT time zone without summer time

2011-05-03 Thread Steve Crawford
are using 8.4) a couple times. Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] convert in GMT time zone without summer time

2011-04-18 Thread Steve Crawford
zones: steve= select '2011-03-22 14:17:00 Europe/Berlin' at time zone 'UTC'; timezone - 2011-03-22 13:17:00 (1 row) steve= select '2011-04-22 14:17:00 Europe/Berlin' at time zone 'UTC'; timezone - 2011-04-22 12:17:00 Cheers, Steve -- Sent

Re: [SQL] Cumulative result with increment

2011-02-07 Thread Steve Crawford
for grouping as well as display. Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Question about PQexecParams

2010-09-22 Thread Steve
Original-Nachricht Datum: Sun, 12 Sep 2010 01:52:04 +0400 Von: Dmitriy Igrishin dmit...@gmail.com An: Steve stev...@gmx.net CC: pgsql-sql@postgresql.org Betreff: Re: [SQL] Question about PQexecParams Hey Steve, 2010/9/11 Steve stev...@gmx.net Hello list

Re: [SQL] Question regarding indices

2010-09-12 Thread Steve
Original-Nachricht Datum: Sat, 11 Sep 2010 11:08:00 -0400 Von: Lew no...@lewscanon.com An: pgsql-sql@postgresql.org Betreff: Re: [SQL] Question regarding indices On 09/11/2010 08:29 AM, Steve wrote: I have a small question about the order of values in a query. Assume I

[SQL] Question regarding indices

2010-09-11 Thread Steve
the SQL query with ordered data influence the speed of the query? // Steve -- GRATIS: Spider-Man 1-3 sowie 300 weitere Videos! Jetzt freischalten! http://portal.gmx.net/de/go/maxdome -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

[SQL] Question about PQexecParams

2010-09-11 Thread Steve
with this? // Steve -- GMX DSL SOMMER-SPECIAL: Surf Phone Flat 16.000 für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Question regarding indices

2010-09-11 Thread Steve
Original-Nachricht Datum: Sat, 11 Sep 2010 10:05:18 -0400 Von: Michael Gould mgo...@intermodalsoftwaresolutions.net An: Steve stev...@gmx.net Betreff: Re: [SQL] Question regarding indices Steve, Hello Michael, If I remember correctly the sort only works

Re: [SQL] Question regarding indices

2010-09-11 Thread Steve
Original-Nachricht Datum: Sat, 11 Sep 2010 11:04:16 -0400 Von: Tom Lane t...@sss.pgh.pa.us An: Steve stev...@gmx.net CC: pgsql-sql@postgresql.org Betreff: Re: [SQL] Question regarding indices Steve stev...@gmx.net writes: I have a small question about the order

Re: [SQL] What does PostgreSQL do when time goes backward?

2010-08-04 Thread Steve Wampler
something wrong there. I saw very bad clock performance on one Linux box I had (dual-single core AMD cpus, no VMs), even with NTP, until I changed the clocksource kernel parameter to hpet. Unfortunately (or fortunately) I no longer have that box. -- Steve Wampler -- swamp...@noao.edu The gods

[SQL] creating a versioning system for sets?

2010-04-20 Thread Steve Lefevre
I'm working on a web app for a quality control checklist. I already have a table set up, but I have a hunch that our model is sub-optimal and I could get some better performance.I'm hoping someone on this list can help me think clearly about how to express this efficiently in SQL. Each checklist

Re: [SQL] Table Design for Hierarchical Data

2010-04-06 Thread Steve Crawford
suited to flagging aggregates for suppression. Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] LIMIT 1; The Integer part only

2009-09-03 Thread Steve Crawford
the integer part of the number, which math function can do this for me? For example, I have 3.900 and I need only the 3 (the integer part), which math function to be used? floor(3.900) Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription

Re: [SQL] Month/year between two dates

2009-08-11 Thread Steve Crawford
')::date and date_trunc('month', date_to) = (int1::text || '-' || int2::text || '-1')::date ... Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] SQL report

2009-07-30 Thread Steve Crawford
. The latest status report will only need a simple join on the current table with a max size of 100,000 rather than a more complex query over a 100,000,000 record table. Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] it's not NULL, then what is it?

2009-06-30 Thread Steve Crawford
... canon=# select count(maf) from gallo.sds_seq_reg_shw canon-# where maf ISNULL; count --- 0 (1 row) I believe count will only count not-null anyway so this will always return zero. Try count(*) instead of count(maf). Here's an example: st...@[local]= select * from

Re: [SQL] How to count from a second table in an aggregate query?

2009-04-17 Thread Steve Midgley
Date: Wed, 15 Apr 2009 21:23:04 -0700 From: Steve Midgley scie...@misuse.org To: Erik Jones ejo...@engineyard.com Subject: Re: How to count from a second table in an aggregate query? Message-ID: 49e6b2a8.5040...@misuse.org Erik Jones wrote: On Apr 15, 2009, at 1:15 PM, Steve Midgley wrote

[SQL] How to count from a second table in an aggregate query?

2009-04-15 Thread Steve Midgley
id's in a single result set Thanks for any assistance on this! Steve /*SQL STARTS*/ drop table if exists contact_log; drop table if exists contact_property; create table contact_log(id serial NOT null, src_contact_id integer, log_type character varying(63), CONSTRAINT contact_log_pkey PRIMARY KEY

Re: [SQL] How to count from a second table in an aggregate query?

2009-04-15 Thread Steve Midgley
Erik Jones wrote: On Apr 15, 2009, at 1:15 PM, Steve Midgley wrote: I want to generate an analysis report that counts the values in two separate tables. I've been able to accomplish what I want with two separate queries that I then merge together in Excel. Essentially what I need

Re: [SQL] changing multiple pk's in one update

2009-04-14 Thread Steve Midgley
with two records in order to swap the positions of (say) item 2 and 3. Of course you can do this pretty easily inside a transaction, and you don't have to worry about the mess of moving PK's. Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription

Re: [SQL] Nested selects

2009-04-09 Thread Steve Midgley
about this: select round.*, stage.name from round left join stage on stage.id = round.stage_id ORDER BY round.score DESC; Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Can we load all database objects in memory?

2009-03-26 Thread Steve Midgley
should be cached into RAM by the OS at that point. Also, I don't know what the state of the art is regarding RAM disks these days, but for a read-only database, that seems like an option (10gb of ram disk for your read-only data and 6 gb of ram for OS and Pg). Steve -- Sent via pgsql-sql

Re: [SQL] Alter Table/Indexing

2009-03-25 Thread Steve Midgley
and rebuilding them manually later? Thanks for any insight on that (and I hope my question helps the OP as well - if this seems off topic let me know), Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql

Re: [SQL] Exclude fields from SELECT command

2009-03-17 Thread Steve Midgley
the column_name fields, building your column list, excepting the column_names you wish to exclude.. Best, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] Re: select count of all overlapping geometries and return 0 if none.

2009-03-13 Thread Steve Midgley
;Talahassee, FL 6;Frankfurt, GE Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Best practices for geo-spatial city name searches?

2009-02-25 Thread Steve Midgley
this helps. Feel free to contact me on-list or off, if you want to discuss more. Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] problem using twice custom comparision operator

2009-01-25 Thread Steve Midgley
that using the regex operators (like ~* would be the way to go). I thought I'd mention this other approach in case it was of interest and you haven't run across it before. Sincerely, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

[SQL] Re: some howto/theory book/tutorial on practical problem solving in SQL

2009-01-14 Thread Steve Midgley
go. I've forwarded this thread already to several people who work with related issues, and they're very interested in some solutions as well. So stay in touch as you work on this, please. Sincerely, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] How to excute dynamically a generated SQL command?

2009-01-05 Thread Steve Midgley
#, but I'd guess you can make it work. Might be simpler than all the escaping work.. Best, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Question on Escape-string

2009-01-03 Thread Steve Midgley
) NOT NULL, data bytea ); insert into test (filename, data) values (E'c:\\tmp\\tst.tif', '1234'); select replace(filename, E'\\', E''), data from test Does this do it? Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] Re: How to insert Images(bnp,png,etc) into Postgresql and how to retrive the inserted Imaged using C#.net

2008-12-18 Thread Steve Crawford
code there. Just feed it your images as input and all should be good. Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Best way to and from a one-to-many joined table?

2008-12-07 Thread Steve Midgley
)) AND (b.attribute = @secondAttr)); Also, any suggestions about how to figure out this on my own without bugging the list in the future would be great. Thanks for any insight! Steve p.s. I posting in the same thread, but if you think I should have started a new thread let me know for the future

Re: [SQL] Sequence and nextval problem

2008-11-25 Thread Steve Midgley
updates, then you're good to go. It's a very fast way to update all your tables to make sure the sequence #'s are all valid, without having to look up the max value on each one (which would also require that you shut off access to the table and for a much longer time). Hope that helps, Steve

Re: [SQL] grouping/clustering query

2008-10-23 Thread Steve Midgley
array? I may not be the best person to answer the actual SQL question, but I thought I'd clarify your requirements so the list members can have the best chance of answering. Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] many-to-many relationship

2008-10-09 Thread Steve Midgley
construct a rule or trigger to validate the foreign key data on insert/update but that's out of my skill area. Hi Steve, So in your solution the f_table column is just text which needs to be validated by a custom trigger? Hi, Yup - that's exactly what I'm suggesting. Storing the text value

Re: [SQL] many-to-many relationship

2008-10-07 Thread Steve Midgley
the foreign key data on insert/update but that's out of my skill area. Hope that helps a little, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Finding sequential records

2008-09-30 Thread Steve Midgley
At 09:50 PM 9/29/2008, Richard Broersma wrote: On Mon, Sep 29, 2008 at 7:48 PM, Steve Midgley [EMAIL PROTECTED] wrote: In my specific case it turns out I only had duplicates, but there could have been n-plicates, so your code is still correct for my use-case (though I didn't say

Re: [SQL] Finding sequential records

2008-09-29 Thread Steve Midgley
At 05:38 PM 9/26/2008, Oliveiros Cristina wrote: In-Reply-To: [EMAIL PROTECTED] References: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] Howdy, Steve. SELECT id FROM dummy a NATURAL JOIN ( SELECT fkey_id,name FROM dummy GROUP BY fkey_id,name HAVING COUNT(*) 1 AND SUM

[SQL] Finding sequential records

2008-09-26 Thread Steve Midgley
! Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Finding sequential records

2008-09-26 Thread Steve Midgley
advice on either of these solutions. I'm going to learn a lot here if someone can pound it into my head. Thanks, Steve It seems to be returning any records that have sequential id's regardless At 11:02 AM 9/26/2008, Richard Broersma wrote: On Fri, Sep 26, 2008 at 10:39 AM, Steve Midgley [EMAIL

Re: [SQL] surrogate vs natural primary keys

2008-09-19 Thread Steve Midgley
of course is prone to all kinds of different problems (like lazy developers who code around the OO validation checkers!). Thanks for giving such a great explanation as to the value of natural keys! You haven't won me over, but you did teach me something - which I appreciate. Best, Steve -- Sent

Re: [SQL] surrogate vs natural primary keys

2008-09-17 Thread Steve Midgley
just end up turning into fact tables! :) In summary: I've never heard someone say they've been bitten by using an arbitrary surrogate key system, but I myself have been bitten and have heard lots of stories of problems when using natural keys. I hope this helps some, Steve -- Sent via pgsql

[SQL] What is wrong with this PostgreSQL UPDATE statement??

2008-08-22 Thread Steve Johnson
Sorry for the fairly long post. I'm having a big problem trying to update one table from another in PostgreSQL 8.3.1. I have a lookup table called termgroup: # select * from termgroup; termgroupname | mindays | maxdays ---+-+- 1-30 days | 1 | 30 31-59

Re: [SQL] Join question

2008-08-15 Thread Steve Midgley
clause? I could be misunderstanding the whole thing though.. Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] DELETE with JOIN

2008-08-07 Thread Steve Midgley
a pure-sql solution in Pg as well but this method should work across any SQL platform, which seems like one of your requirements. Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Problem with ORDER BY and DISTINCT ON

2008-07-31 Thread Steve Midgley
At 03:51 PM 7/31/2008, Tom Lane wrote: Steve Midgley [EMAIL PROTECTED] writes: At 07:29 AM 7/16/2008, Tom Lane wrote: I think what is happening is that ORDER BY knows that and gets rid of the duplicate entries while DISTINCT ON fails to do so. Of course removing the duplicate from both

Re: [SQL] index for group by

2008-07-22 Thread Steve Midgley
procedure which grabs all the data from this data table, aggregates it and saves it to warehouse table. You could aggregate against your datetime stamp by N hours or days as well. If this idea is of interest you can write back to the list or off-list to me for more info. Steve -- Sent via pgsql-sql

[SQL] Problem with ORDER BY and DISTINCT ON

2008-07-16 Thread Steve Midgley
case above is breaking my tests and preventing me from implementing the idea. The code is generated by an application layer which is not really paying attention to whether or not the two CASE statements apply to the same field or not (sometimes they do sometimes they don't).. Thanks! Steve

Re: [SQL] Copyright and Paper walls (was: Rollback in Postgres)

2008-07-12 Thread Steve Midgley
if this list were to limit itself only to public domain and open copyright documentation for consideration. Just two more cents from the peanut gallery on a Saturday afternoon, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] When was my database created

2008-07-11 Thread Steve Crawford
was created. If you restored from a dump or otherwise recreated the database for any reason (version upgrade, machine migration, disaster recovery, etc.), the timestamps would represent the time of the restore, not the time of the creation of the original database. Cheers, Steve -- Sent via pgsql

Re: [SQL] PERSISTANT PREPARE (another point of view)

2008-07-11 Thread Steve Midgley
developers with a consistent set of interfaces to obtain data that are not tied to the data tables themselves. And allowing them to insert/update/manage tables via structured interfaces as well. Am I missing something? Best, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org

Re: [SQL] ANSI Standard

2008-06-26 Thread Steve Midgley
(or any other std) if you do not regularly test against a set of platforms, your solution will converge on supporting only the platforms you do regular test against. I hope that helps, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription

Re: [SQL] Sequential event query

2008-06-25 Thread Steve Crawford
Allan Kamau wrote: Hi Steve, Am having difficulties (there is a chance I could be the only one) trying to see how the results you've listed under I would want to get: section can be generated from the information you have provided in your implicit problem statement. Remember the events

Re: [SQL] Sequential event query

2008-06-25 Thread Steve Crawford
Steve Crawford wrote: Allan Kamau wrote: Hi Steve, Am having difficulties (there is a chance I could be the only one) trying to see how the results you've listed under I would want to get: section can be generated from the information you have provided in your implicit problem statement

[SQL] Sequential event query

2008-06-24 Thread Steve Crawford
it might be a day or two. I am looking for a query that will list any device having no variation in the recent events. Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Tsearch

2008-06-12 Thread Steve Midgley
and skin, where the following words do not appear between the words chicken and skin: beef, pork, cow, pig, etc.. Just some thoughts for you there. Best, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref

Re: [SQL] Different type of query

2008-06-11 Thread Steve Crawford
nutrient_data where nutrient_no=203; Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Different type of query

2008-06-11 Thread Steve Crawford
from nutrient_data where ndb_no = 13473 order by nutrient_value limit 5; Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Conceptual Design Question

2008-06-10 Thread Steve Midgley
! Best, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] design resource

2008-06-06 Thread Steve Midgley
with and without accents to make searching easier across keyboards/locales. I hope this helps too -- I think Craig has given you the lion's share of good advice for sure - and I definitely follow the practices more or less as he laid them out as well. Sincerely, Steve -- Sent via pgsql-sql

Re: [SQL] How long - Vacumm full - 10 million to 90,000

2008-05-29 Thread Steve Crawford
into yourtable SELECT * from xxx; DROP TABLE xxx; If you are so close to out-of-space on your disk that you don't have the room those 90,000 records will require, you may have to dump/restore using another machine. Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org

Re: [SQL] Extremely Low performance with ODBC

2008-05-28 Thread Steve Midgley
was done by my middleware connection wrapper to ODBC and none was done by ODBC itself. Once I got to that point, I was able to get some decent performance out of ODBC. I hope some of these ideas helps! Feel free to write back on or off list. Sincerely, Steve -- Sent via pgsql-sql mailing list

Re: [SQL] Extremely Low performance with ODBC

2008-05-28 Thread Steve Midgley
for the solution mill, hopefully! Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Extremely Low performance with ODBC

2008-05-23 Thread Steve Crawford
very poor performance on large tables. EXPLAIN will not reveal this. You might want to set the server to log all transactions and see what the app is really doing at the server level. Cheers, Steve

Re: [SQL] numbering rows on import from file

2008-05-02 Thread Steve Crawford
just need consecutive row-numbering on output (not in the table) and if the row numbering doesn't need to match the same record each time, you can create a temporary sequence and select nextval('tempsequence'), from yourtable. Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql

Re: [SQL] export CSV file through Java JDBC

2008-04-15 Thread Steve Midgley
might not work b/c two different child shells are run: system.exec(export PGPASSWORD=pass1234); system.exec(psql my command here); I think you want something more like this psuedo code: system.set_environment(PGPASSWORD)=pass1234; system.exec(psql my command here); I hope this helps, Steve

Re: [SQL] Create on insert a unique random number

2008-03-19 Thread Steve Midgley
finds your input and mine useful in coming up with a final answer to his issue. Thanks for taking the time to consider the issue and I'll look forward to any additional ideas or comments you have on this too! Sincerely, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org

Re: [SQL] Create on insert a unique random number

2008-03-18 Thread Steve Midgley
your sparse index space and generating lots of misses. Hope that helps, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Create on insert a unique random number

2008-03-18 Thread Steve Midgley
At 12:36 PM 3/18/2008, D'Arcy J.M. Cain wrote: On Tue, 18 Mar 2008 12:23:35 -0700 Steve Midgley [EMAIL PROTECTED] wrote: 1) Create a second field (as someone recommend on this list) that is an MD5 of your primary key. Use that as your accessor index from the web I strongly disagree

Re: [SQL] Counting days ...

2008-03-14 Thread Steve Crawford
Aarni Ruuhimäki wrote: Thanks Steve, I'm not sure if I quite grasped this. It gives a bit funny results: SELECT sum ((date_smaller(res_end_day, '2007-12-31'::date) - date_larger(res_start_day, '2006-12-31'::date)) * group_size) AS days_in_period, c.country_name AS country FROM product_res

Re: [SQL] Counting days ...

2008-03-13 Thread Steve Crawford
, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Counting days ...

2008-03-13 Thread Steve Crawford
dates but move the start base back one day so anyone starting prior to Feb 1 gets the extra day added. Cheers, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Insert problem

2008-03-10 Thread Steve Midgley
a little! Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] works but ...

2008-03-10 Thread Steve Midgley
if you reset that key, then your table will start issuing keys at that new number. Another way to be more safe is to +5 your sequence, so that even if a few inserts slip in, you're still ahead of the game.. Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes

Re: [SQL] using copy from in function

2008-03-05 Thread Steve Midgley
just works a little cleaner / fewer unexpected surprises. Like I said, I don't know if this is your issue (and Vista), but it's been my experience with WinXP and file paths in Postgresql. Best, Steve -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] Documenting a DB schema

2008-03-04 Thread Steve Crawford
. Is there an alternative? You mean like: COMMENT ON mytable IS 'This is my table. Mine, mine, mine'; You can also comment columns, databases, functions, schemas, domains, etc. Cheers, Steve

Re: [SQL] SQL standards in Mysql

2008-02-27 Thread Steve Crawford
. This often means that the product has severely limited its use of appropriate PostgreSQL features in order to remain compatible with the other backends. Cheers, Steve ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [SQL] Usage of UUID with 8.3 (Windows)

2008-02-12 Thread Steve Midgley
? Not sure how to make WinAPI calls from PG - perhaps someone on list has experience or references for that: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rpc/rpc/uuidcreate.asp HTH, Steve ---(end of broadcast)--- TIP 2: Don't 'kill

[SQL] Columns view? (Finding column names for a table)

2008-02-06 Thread Steve Midgley
nicer. Any assistance is appreciated! Thanks, Steve ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate

Re: [SQL] accounting schema

2008-02-06 Thread Steve Midgley
of course. I'll readily admit my limited experience, and I'm sure others on this list have far better information. I hope this gets you started anyway. Sincerely, Steve ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

  1   2   >