[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
Can any one help me 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 > An: Steve > Betreff: Re: [SQL] Question regarding indices > Steve, > Hello Michael, > If I remember correctly the sort only works on the final result set and so >

Re: [SQL] Question regarding indices

2010-09-11 Thread Steve
Original-Nachricht > Datum: Sat, 11 Sep 2010 11:04:16 -0400 > Von: Tom Lane > An: "Steve" > CC: pgsql-sql@postgresql.org > Betreff: Re: [SQL] Question regarding indices > "Steve" writes: > > I have a small question about the o

Re: [SQL] Question regarding indices

2010-09-12 Thread Steve
Original-Nachricht > Datum: Sat, 11 Sep 2010 11:08:00 -0400 > Von: Lew > 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

Re: [SQL] Question about PQexecParams

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

[SQL] Question on string value expression wildcarding

2000-08-24 Thread Steve Wampler
ion can be used to match only strings prefixed with "kp.dhs."? Thanks! -- Steve Wampler- SOLIS Project, National Solar Observatory [EMAIL PROTECTED]

[SQL] Using a postgres table to maintain unique id?

2000-11-13 Thread Steve Wampler
with "old" rows for this entry, and this avoid the need to run VACUUM ANALYZE periodically? Any tips on how to implement the trigger would be appreciated. (Is it possible to generate an int8 sequence value?) Thanks! -- Steve Wampler- SOLIS Project, National Solar Observatory [EMAIL PROTECTED]

Re: [SQL] Using a postgres table to maintain unique id?

2000-11-13 Thread Steve Wampler
lifetime of the project. The table would have a single row with a single column. Selecting that table cell would return the current value, but leave the value incremented in the table cell (it's ok if it increments the value before returning). -- Steve Wampler- SOLIS Project, National Solar Observatory [EMAIL PROTECTED]

Re: [SQL] Using a postgres table to maintain unique id?

2000-11-13 Thread Steve Wampler
avoid having to VACUUM ANALYZE this table, though, and it "feels" as though it is duplicating functionality already provided by postgres DB backends. I'll think about this solution - thanks! -- Steve Wampler- SOLIS Project, National Solar Observatory [EMAIL PROTECTED]

Re: [SQL] Using a postgres table to maintain unique id?

2000-11-14 Thread Steve Wampler
int4 *might* work, it doesn't handle the "worst-case" scenario (which is up around 15 billion values). Thanks to everyone for your comments and suggestions! -- Steve Wampler- SOLIS Project, National Solar Observatory [EMAIL PROTECTED]

[SQL] Selecting Most Recent Row

2000-12-13 Thread Steve Meynell
ost recent of these Batch Numbers.   --  Steve Meynell Candata Systems  

Re: [SQL] Selecting Most Recent Row

2000-12-13 Thread Steve Meynell
Joel, Thank you very much. I gave that a try and it worked perfectly. It definately was the distinct keyword I was missing. Thanks Again, Steve Joel Burton wrote: > > Will DateStamp being the date of insertion? If so, is it that you want > the record for the most recent

[SQL] Help Retrieving Latest Record

2001-02-16 Thread Steve Meynell
ld yield me: 15    Apples  July 20, 1999 Thank you in advance,   --  Steve Meynell Candata Systems  

[SQL] Help retrieving lastest record

2001-02-16 Thread Steve Meynell
    Oranges    June 7, 2000 I know this doesn't work but I need something like it. or something like select * from basket where max(date) and fruit='Apples'; This would yield me: 15    Apples  July 20, 1999 Thank you in advan

[SQL] Heres a good one...

2001-04-27 Thread Steve Meynell
Any Ideas? Thanks in Advance, Steve ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl

[SQL] Re: Heres a good one...

2001-04-30 Thread Steve Meynell
statement just didn't work. It said 'ERROR: parser: parse error at or near "select"' Steve Anuradha Ratnaweera wrote: > First, posting_date in journal can _NOT_ be of type char(4)! I guess it is > a "date". > > Try > > upd

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

2001-10-18 Thread Steve Frampton
entire table and just have the left-hand side of the property_id column remaining. Any ideas? Thank you in advance. - ---< LINUX: The choice of a GNU generation. >- Steve Frampton <[EMAIL PROTECTED]> http://www.LinuxNinja.com GNU Privacy Guard ID: D055EB

Re: [SQL] Granting database level permissions...

2001-10-23 Thread Steve Brett
have a look at pg_hba.conf in your data dir. it's all in there. Steve "Thomas Swan" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Is it possible to grant database level access to a user in PostgreSQL? > > I have creat

[SQL] list of tables ?

2002-07-11 Thread Steve Brett
can anyone point me in the right direction ? i need to list all the tables in a database. i've looked at pgadmin_tables which is empty and pga_schema whihc contains a sinlge row i don't want to parse ... is there an easier way t get a list of tables ? i'm on 7.2 t

Re: [SQL] list of tables ? -update to question ...

2002-07-11 Thread Steve Brett
sorry ... i didn't make myself clear ... i have of course come across \dt before ... what i meant was via sql as in 'select tablelist from ' Steve > -Original Message- > From: Stephane Schildknecht [mailto:[EMAIL PROTECTED]] > Sent: 11 July 2002 15:06 > To

Re: [SQL] list of tables ?

2002-07-11 Thread Steve Brett
thanks. Steve > -Original Message- > From: Achilleus Mantzios [mailto:[EMAIL PROTECTED]] > Sent: 11 July 2002 15:10 > To: Steve Brett > Cc: Pgsql-Sql (E-mail) > Subject: Re: [SQL] list of tables ? > > > On Thu, 11 Jul 2002, Steve Brett wrote: > > &

Re: [SQL] how do i import my sql query result to a file

2002-07-18 Thread Steve Brett
\? will get you a list of the commands in psql. Steve > -Original Message- > From: Joseph Syjuco [mailto:[EMAIL PROTECTED]] > Sent: 18 July 2002 22:47 > To: [EMAIL PROTECTED] > Subject: [SQL] how do i import my sql query result to a file > > > how do i imp

Re: [SQL] Ran out of connections

2002-12-04 Thread Steve Crawford
featuring connection pooling and persistence "out of the box." Oh, it's free/open-source as well. Of course you can also get pooling/persistence with enterprise Java solutions such as JBoss (www.jboss.org). Cheers, Steve On Wednesday 04 December 2002 2:08 pm, Mike Diehl wrote:

Re: [SQL] Ran out of connections

2002-12-04 Thread Steve Crawford
Doing anything unusual? Forking processes, opening multiple connections within a single CGI? Have you seen any evidence that a process that opens a connection is failing to complete normally? -Steve On Wednesday 04 December 2002 3:52 pm, Mike Diehl wrote: > On Wednesday 04 December 2002

Re: [SQL] Need help paging through record sets

2002-12-20 Thread Steve Crawford
item or get a duplicate. If you want to page through a small subset of a large file you can use cursors or temporary tables but you will have to be sure your connection persistence, session management and such can accomodate such an arrangement. Cheers, Steve On Friday 20 December 2002 12:

Re: [SQL] empty arrays

2003-01-02 Thread Steve Crawford
Caution! In 7.2.x your statement is interpreted by the parser to be a single element with an empty string which is converted to a zero. If you do this instead: create table test_table ( test_column integer[], another_column integer ); CREATE steve=# insert into test_table (another_column

Re: [SQL] index on to_char(created, 'YYYY') doesn't work

2003-01-15 Thread Steve Crawford
the index matches the where in your query - if you change your query to 2003 you will be back to a sequential scan). BTW, I tried to create an index on the to_char function and had no luck - seems like it should work but it doesn't on 7.2.3 or 7.3.1. Cheers, Steve On Wednesday 15 January 2

Re: [SQL] SQL to list databases?

2003-01-23 Thread Steve Crawford
psql -E causes psql to show it's "behind the scenes" queries to try: psql -lE (that's a lower case ell before the E) Cheers, Steve On Thursday 23 January 2003 10:56 am, Ben Siders wrote: > Is there a query that will return all the databases available, similar

Re: [SQL] bytea

2003-02-07 Thread Steve Crawford
plus the entire escaped version of the file before I can generate the query which causes me some other problems.) Any suggestions would be appreciated. Cheers, Steve On Wednesday 05 February 2003 2:25 am, Adrian Chong wrote: > Hi Christoph, > > Thanks for your reply. But what I want to

[SQL] Replacing a simple nested query?

2003-07-13 Thread Steve Wampler
ter way to obtain the same results? The inner select identifies a set of ids (2049 of them, to be exact) that are then used to locate records that have the same id (about 30-40K of those, including the aforementioned 2049). Thanks! -Steve -- Steve Wampler -- [EMAIL PROTECTED] Quantum mate

Re: [SQL] Replacing a simple nested query?

2003-07-14 Thread Steve Wampler
On Sun, 2003-07-13 at 14:50, Steve Wampler wrote: > I've got a simple nested query: > > select * from attributes where id in (select id from > attributes where (name='obsid') and (value='oid00066')); > > that performs abysmally. I've

Re: [SQL] Table Partitioning and Rules

2003-07-17 Thread Steve Crawford
in fact as each sub-table's file grows it will probably fragment on the disk much worse than a single growing file would which will, along with all the overhead of joining all the tables, make things worse. Review your structure carefully. Plan on $$$ for the hardware. Cheers, Steve On T

Re: [SQL] Calc

2003-10-15 Thread Steve Crawford
an unknown amount"). If you have null values already and they should be interpreted as 0 just do this: select id, db, cr, (select sum(coalesce(cr,0)-coalesce(db,0)) from calc sub where sub.id <= calc.id) from calc; I assume no responsibility for potential lack of scalabilit

Re: [SQL] Calc

2003-10-16 Thread Steve Crawford
| > Visa > > | | 4.00 | middink > > 2003-10-08 | 18:17:40 | Payment - Thank You | > Cash > > | | 5.00 The id field only keeps the transactions in the correct order so you can sum the previous transactions. You

[SQL] Copying rows between tables?

2004-01-13 Thread Steve Wampler
records are archived into 'archive' tables. Occasionally there is a need to copy some of these old records into the 'active' table. Thanks for any pointers! Steve -- Steve Wampler -- [EMAIL PROTECTED] The gods that smiled on your birth are now laughing out loud. ---

Re: [SQL] User defined types -- Social Security number...

2004-03-01 Thread Steve Crawford
s, the first linked to a table of valid area numbers, the second error checked so "00" is not valid and so on or get even more fancy and error check against: http://www.ssa.gov/employer/highgroup.txt. It all depends on one's specific requirements. Google and you will find SSN inf

Re: [SQL] "=" operator vs. "IS"

2004-06-28 Thread Steve Crawford
l any more than you could determine whether or not they are over 18. The SQL spec and PostgreSQL properly use and enforce this interpretation of NULL. The correct way to ask your questions is ...where foo.bar is null... Cheers, Steve ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] locks and triggers. give me an advice please

2004-07-20 Thread Steve Crawford
t; and you might consider running "reindex table t1" after your mass update or if appropriate drop your indexes, load the data, then recreate them.) Re-establish triggers. commit; --end of transaction unlocks the table Cheers, Steve ---(end of broadcast)---

Re: [SQL] Cast NULL into Timestamp?

2004-12-10 Thread Steve Crawford
tinct. Is there anyway to cast this NULL into > a timestamp or any other workarounds? How about: insert into table temp (tempname) select distinct 'tempname' from some_other_relevant_table; Unless there's something you have left out in describing your setup t

[SQL] Looking up table names by REFERENCES

2005-01-25 Thread Steve Castellotti
c.oid and a.atttypid = t.oid ORDER BY a.attnum;     Surely there's a simple way I can trace REFERENCES in a particular column across tables?     Any help would be most appreciated, especially if I could be cc'd directly. Cheers Steve Castellotti

[SQL] Pagination with Output Variables?

2005-02-22 Thread Steve - DND
varchar(100), "EmailAddress" varchar(100)); Can a function return two type results? So that the first type would be just the total number of records, and the second type would be the resultset of customers? Thanks, Steve ---(end of broadcast)--

[SQL] Junk queries with variables?

2005-02-23 Thread Steve - DND
ear "amount" at character 1". What have I done wrong, or am I missing? Thanks, Steve ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [SQL] Junk queries with variables?

2005-02-24 Thread Steve - DND
for a one line statement. I'm looking for the ability to do multiple operations, basically using it for general DB queries that aren't really needed more than once. This again comes from my MSSQL background where you can go to town and just start writing out TS

Re: [SQL] Junk queries with variables?

2005-02-24 Thread Steve - DND
h. Do I need to create a different language for this? Right now I only have plpgsql available. Thanks, Steve ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] Junk queries with variables?

2005-02-28 Thread Steve Valaitis
#x27;m a little confused, is there no way around this, or are you saying I need to use CREATE LANGUAGE to define a new language to use? Currently the only language I have for the DB is plpgsql. Thanks, Steve ---(end of broadcast)--- TIP 2: y

Re: [SQL] Make COUNT(*) Faster?

2005-07-08 Thread Steve Wampler
ECT COUNT(*) and far faster to get to.) I assume this has been beaten well past death, but I don't see why it wouldn't be possible to keep pg_class.reltuples a bit more up-to-date instead of updating it only on vacuums. -- Steve Wampler -- [EMAIL PROTECTED] The gods that smiled on

Re: [SQL] Make COUNT(*) Faster?

2005-07-08 Thread Steve Wampler
tion of the table size or not (though it might in a table of 100 'true' rows - but the decision to ask for a true 'transaction' count (slow) or an approximate table size (fast) should be left to the user in either case). So, leave COUNT(*) alone. But it would be very handy

Re: [SQL] Make COUNT(*) Faster?

2005-07-08 Thread Steve Wampler
Tom Lane wrote: > Steve Wampler <[EMAIL PROTECTED]> writes: > >>So, leave COUNT(*) alone. But it would be very handy to have a >>way to get an approximate table size that is more accurate than is >>provided by a pg_class.reltuples that is only updated on vacuums. &g

Re: [SQL] Make COUNT(*) Faster?

2005-07-08 Thread Steve Wampler
Creating a "fast but WRONG COUNT(*)" which prevented getting the exact > answer that the present implementation provides would be a severe > misfeature. Agreed - note that I did not suggest replacing the current COUNT(*) with an inexact version, but wanted (and now have) a quick way t

[SQL] Problem with "NOT IN (subquery)

2005-11-12 Thread Steve SAUTETNER
Hi, I have a table named "famille" whose structure and content is : famille_code | famille_mere_famille_code | famille_libelle | famille_niveau --+---+---+- --- 00 | | Mhre | 0 I0

Re: [SQL] plsql / time statement

2006-02-28 Thread Steve Crawford
Daniel Caune wrote: Hi, Is there any option to set so that psql provides the execution time of each SQL statement executed? \timing (either as a manual command or as a default in your .psqlrc file). Cheers, Steve ---(end of broadcast

Re: [SQL] how to solve this problem

2006-04-13 Thread Steve Crawford
3 + 8*vinc4...2^19*vinc20. Whether or not this is useful depends on what you are trying to do. Cheers, Steve ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

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] SQL report

2009-07-30 Thread Steve Crawford
is moved from the "current" to the "historical" table and the new one added to the "current" table. 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,0

Re: [SQL] Month/year between two dates

2009-08-11 Thread Steve Crawford
nt1::text || '-' || int2::text || '-1')::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] LIMIT 1; The Integer part only

2009-09-03 Thread Steve Crawford
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] Table Design for Hierarchical Data

2010-04-06 Thread Steve Crawford
is that the multi-table scenario will be better 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

[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 h

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 that

Re: [SQL] Cumulative result with increment

2011-02-07 Thread Steve Crawford
27; else 'night' end as shiftname This can be used 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] convert in GMT time zone without summer time

2011-04-18 Thread Steve Crawford
RT_TO_UTC( '2011-03-22 14:17:00+01'::timestamptz ,'CET'),'-mm-dd hh24:MI:SS') AS winter, to_char(CONVERT_TO_UTC( '2011-04-22 14:17:00+02'::timestamptz ,'CET'),'-mm-dd hh24:MI:SS') AS summer; If you can use the correct time zone name, ever

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

2011-05-03 Thread Steve Crawford
nes but it would be well worth your time to carefully read http://www.postgresql.org/docs/8.4/interactive/datatype-datetime.html (IIRC, you 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] 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 -- Sen

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

2011-06-30 Thread Steve Crawford
string ''. There might 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 vi

Re: [SQL] why these results?

2011-08-01 Thread Steve Crawford
~~* '%text%'; 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

Re: [SQL] Mysterious column "name"

2011-08-09 Thread Steve Crawford
http://www.postgresql.org/docs/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] how to calculate differences of timestamps?

2011-09-27 Thread Steve Crawford
ndexes though an index on ts will probably 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

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

2011-10-08 Thread Steve Northamer
get "invalid reference to FROM-clause entry for table apps". So 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 pgs

Re: [SQL] internal format of timstamp?

2011-12-29 Thread Steve Crawford
spect 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:

Re: [SQL] compare table names

2012-01-09 Thread Steve Crawford
with extra work to properly handle the first 10-days of each year. Alternately, you could have a separate table that just tracks the creation dates of the temporary tables and be free from any requirement to have dates be part of the table names. Cheers, Steve -- Sent via pgsql-sql mailing li

Re: [SQL] Unable To Modify Table

2012-01-12 Thread Steve Crawford
raint? 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:

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

2012-01-19 Thread Steve Crawford
much other 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] Update Mass Data in Field?

2012-01-26 Thread Steve Crawford
ression match and regexp_replace to ensure that the pattern is anchored at the end of the field 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 express

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

2012-01-30 Thread Steve Crawford
you are thinking about a *time* with time zone (a type 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 mailin

Re: [SQL] time interval math

2012-02-08 Thread Steve Crawford
g intervals across DST boundaries, have changed over time. IIRC most of those changes were pre-8.3 but haven't looked recently. 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] Setting the process title, or can I?

2012-03-20 Thread Steve Crawford
statements 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] how to concatenate in PostgreSQL

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

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 *To:* pgsql-sql@postgresql.org *Sent:* Monday

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
eries(1,15) as allnumbers where 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 fi

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

2012-07-10 Thread Steve Crawford
u get 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

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] how can I replace all instances of a pattern

2013-03-26 Thread Steve Crawford
t I cannot find any function that will replace all instances of a string AND can base it on a regular expression pattern. Is there a better way to do this in 9.1? You were on the right track with regexp_replace but you 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] 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 constrain

[SQL] Aggregating both tables in a join?

2007-01-11 Thread Steve Sabljak
of legs in the flight table, using a trigger, but it doesn't seem relationally 'clean'. Kind Regards, Steve Sabljak ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] COPY FROM query

2007-02-12 Thread Steve Midgley
uctions on the command line: dir "/temp" Feeding Windows API calls with forward slashes seems to work with everything I've tried so far, so using them in Postgres seems perfectly smart, and reasonable.. Hope that helps, Steve At 11:03 AM 2/12/2007, [EMAIL PROTECTED] wrote: D

Re: [SQL] Change the Default Database

2007-02-27 Thread Steve Midgley
server, specifying which database you want to talk with - from what I can tell, Pg doesn't let you operate across databases, as MS SQL does - one connection = one database). I'm not nearly as expert as others on the list, so any corrections to the above analysis would be welcome. Si

[SQL] GiST index question: performance

2007-03-05 Thread Steve Midgley
): ~5 Any thoughts or ideas? Thank you, Steve p.s. I could use a GIS system alongside of Postgres but performance and efficiency are key to this system, and it seems to me that raw GiST indexed SQL queries are going to be fastest and create the lowest load on the server?

Re: [SQL] GiST index question: performance

2007-03-05 Thread Steve Midgley
your time. I'll certainly repost to the list with whatever I uncover. I really do appreciate the help you've provided. Sincerely, Steve At 12:21 PM 3/5/2007, you wrote: On Mon, 5 Mar 2007, Steve Midgley wrote: Hi, First off, can I say how much I love GiST? It's already solv

Re: [SQL] GiST index question: performance

2007-03-06 Thread Steve Midgley
do appreciate any education or insight here. Are C code "patches" or functions more of a risk to server stability/reliability than higher level code? Or am I speaking gibberish? Thanks, Steve At 01:01 AM 3/6/2007, Peter Eisentraut wrote: Steve Midgley wrote: > my ISP that m

Re: [SQL] A form of inheritance with PostgreSQL

2007-03-09 Thread Steve Midgley
some people try to store the data in this table too, but I think that's a mistake personally). If I understand what you're trying to do, you can use this design pattern in your application language to implement an inheritance scheme without any special database features (i.e. in a SQL

Re: [SQL] log file permissions?

2007-03-16 Thread Steve Crawford
tgres has no control over those permissions. You will have to look at your syslog daemon configuration. Cheers, Steve ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] Issue with copying data from a text file.

2007-03-21 Thread Steve Midgley
invoking CSV parsing rules (friendly hint to core devs!) :) Let us all know if that works! Steve At 03:14 AM 3/20/2007, you wrote: Date: Tue, 20 Mar 2007 11:25:38 +0900 From: Paul Lambert <[EMAIL PROTECTED]> To: pgsql-sql@postgresql.org Subject: Issue with copying data from a text file. Mes

Re: [SQL] [pgsql-sql] Daily digest v1.2492 (19 messages)

2007-04-03 Thread Steve Midgley
the fields looking right. Doing a bulk update with a join across several tables is so much faster than looping through them with a wrapper in Java (or other lang) you won't believe it. I hope this helps and is on-topic for you. Steve At 09:38 AM 4/3/2007, [EMAIL PROTECTED] wrote: Dat

Re: [SQL] Question on interval

2007-04-20 Thread Steve Crawford
ger is a column in a table though, so it is more like convert >> integer tbl.theInteger to INTERVAL 'tbl.theInteger seconds". >> >> Thanks! >> >> >> Wei > > select (10||' sec')::interval; Or, if you prefer: select 10*'1 second'::

[SQL] Selecting rows with "static" ordering

2007-04-26 Thread Steve Midgley
e query? Basically right now I'm issuing 5 queries to the backend to ensure ordering but this horribly inefficient. Any input or advice would be appreciated, Steve ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate

Re: [SQL] subtract a day from the NOW function

2007-06-07 Thread Steve Crawford
?column? - 2007-03-11 00:00:00 Especially note that truncating a timestamptz preserves the timezone info so you will very likely need to address issues on the days that Daylight Saving starts or ends: select date_trunc('day',current_timestamp); date_tru

Re: [SQL] subtract a day from the NOW function

2007-06-07 Thread Steve Crawford
Michael Glaesemann wrote: > > On Jun 7, 2007, at 13:58 , Steve Crawford wrote: > >> Beware in the "or something like that category" that PostgreSQL >> considers "1 day" to be "24 hours" > > Actually, recent versions of PostgreSQL take i

[SQL] Increment a sequence by more than one

2007-08-03 Thread Steve Midgley
ique. This is going to be a really slow way to get a large number of id's of course and just seems plain wrongheaded in many ways. Any insights? All help is appreciated and input on a better way to solve the problem completely is of course welcome as well. Sincerely, Steve

  1   2   >