Re: [SQL] strange corruption?

2012-12-27 Thread Scott Marlowe
On Thu, Dec 27, 2012 at 7:27 AM, John Fabiani jo...@jfcomputer.com wrote: Hi, I have the following statement in a function. UPDATE orderseq SET orderseq_number = (orderseq_number + 1) WHERE (orderseq_name='InvcNumber'); All it does is update a single record by incrementing a

Re: [SQL] deciding on one of multiple results returned

2012-12-21 Thread Scott Marlowe
On Fri, Dec 21, 2012 at 10:28 AM, Wes James compte...@gmail.com wrote: David and Seth Thanks. That helped. When I have select distinct on (revf3) f1, f2, f3, revers(f3) as revf3 from table order by revf3 Is there a way to return just f1, f2, f3 in my results and forget revf3 (so it

Re: [SQL] complex query

2012-10-27 Thread Scott Marlowe
On Sat, Oct 27, 2012 at 6:01 PM, Mark Fenbers mark.fenb...@noaa.gov wrote: I have a query: SELECT id, SUM(col1), SUM(col2) FROM mytable WHERE condition1 = true GROUP BY id; This gives me 3 columns, but what I want is 5 columns where the next two columns -- SUM(col3), SUM(col4) -- have a

Re: [SQL] complex query

2012-10-27 Thread Scott Marlowe
On Sat, Oct 27, 2012 at 7:56 PM, Mark Fenbers mark.fenb...@noaa.gov wrote: I'd do somethings like: select * from ( select id, sum(col1), sum(col2) from tablename group by yada ) as a [full, left, right, outer] join ( select id, sum(col3), sum(col4) from tablename group by bada

Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Scott Marlowe
:20 Scott Marlowe wrote: You do realize you're missing four years of bug fixes right? On Πεμ 14 Ιουν 2012 11:39:35 Achilleas Mantzios wrote: Unfortunately the remote installations are neither physically accessible nor by TCP/IP accesible (comms are done via UUCP and administration via minicom

Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Scott Marlowe
Well, I'd see about finding a way to upgrade to 8.3.19. 8.3.3 has know data eating bugs. On Fri, Jun 15, 2012 at 9:32 AM, Achilleas Mantzios ach...@matrix.gatewaynet.com wrote: On Παρ 15 Ιουν 2012 18:03:26 Scott Marlowe wrote: Not talking about going to something after 8.3.19, just updating

Re: [SQL] order by different on mac vs linux

2012-05-16 Thread Scott Marlowe
On Wed, May 16, 2012 at 7:58 PM, Wes James compte...@gmail.com wrote: On Wed, May 16, 2012 at 5:00 PM, Samuel Gendler sgend...@ideasculptor.com wrote: On Wed, May 16, 2012 at 3:46 PM, Wes James compte...@gmail.com wrote: On Mon, May 14, 2012 at 5:00 PM, Tom Lane t...@sss.pgh.pa.us

Re: [SQL] order by different on mac vs linux

2012-05-15 Thread Scott Marlowe
On Tue, May 15, 2012 at 10:06 AM, Wes James compte...@gmail.com wrote: On Mon, May 14, 2012 at 5:00 PM, Tom Lane t...@sss.pgh.pa.us wrote: Wes James compte...@gmail.com writes: Why is there a different order on the different platforms. This is not exactly unusual.  You should first check to

Re: [SQL] Current transaction is aborted, commands ignored until end of transaction block

2011-12-30 Thread Scott Marlowe
On Fri, Dec 30, 2011 at 6:19 PM, Samuel Gendler sgend...@ideasculptor.com wrote: On Fri, Dec 30, 2011 at 4:03 PM, Scott Marlowe scott.marl...@gmail.com wrote: On Fri, Dec 30, 2011 at 4:19 PM, Tom Lane t...@sss.pgh.pa.us wrote: Jan Bakuwel jan.baku...@greenpeace.org writes: Why-o-why have

Re: [SQL] Correlating Asterisk CDRs

2011-12-07 Thread Scott Marlowe
2011/12/7 Raj Mathur (राज माथुर) r...@linux-delhi.org:                                                             QUERY PLAN -  Limit  

Re: [SQL] updating a sequence

2011-11-15 Thread Scott Marlowe
On Tue, Nov 15, 2011 at 5:33 PM, Samuel Gendler sgend...@ideasculptor.com wrote: On Tue, Nov 15, 2011 at 4:28 PM, John Fabiani jo...@jfcomputer.com wrote: On Tuesday, November 15, 2011 08:33:54 am Richard Broersma wrote: On Tue, Nov 15, 2011 at 8:06 AM, John Fabiani jo...@jfcomputer.com

Re: [SQL] updating a sequence

2011-11-15 Thread Scott Marlowe
On Tue, Nov 15, 2011 at 8:46 PM, Scott Marlowe scott.marl...@gmail.com wrote: On Tue, Nov 15, 2011 at 5:33 PM, Samuel Gendler sgend...@ideasculptor.com wrote: On Tue, Nov 15, 2011 at 4:28 PM, John Fabiani jo...@jfcomputer.com wrote: On Tuesday, November 15, 2011 08:33:54 am Richard Broersma

Re: [SQL] How to write query to access another odbc source

2011-10-19 Thread Scott Marlowe
On Wed, Oct 19, 2011 at 9:19 AM, Rich rhd...@gmail.com wrote: I have a mumps database with an ODBC connection so I can write queries from this database.  How can I write a sql in Postgresql to access this database to use in my Postgresql reports? dblink lets one pg server access another via

Re: [SQL] Want some basic compare of data type on PostgreSQL and MySQL

2011-09-01 Thread Scott Marlowe
On Thu, Sep 1, 2011 at 7:32 AM, Leif Biberg Kristensen l...@solumslekt.org wrote: On Thursday 1. September 2011 11.16.23 Scott Marlowe wrote: The postgresql type text is a varchar with no precision that can hold up to about a gig or so of text.  Not that i recommend putting a gig of text

Re: [SQL] Add one column to another

2011-08-25 Thread Scott Marlowe
On Thu, Aug 25, 2011 at 8:52 AM, Oliveiros d'Azevedo Cristina oliveiros.crist...@marktest.pt wrote: Something like this...? SELECT first_name,surname, email1 || ';' || email2 FROM t_your_table; If there's any nulls in email1 or email2 they'll need special handling with coalesce. -- Sent via

Re: [SQL] (pgsql8.4) DATA Corruption

2011-08-19 Thread Scott Marlowe
On Fri, Aug 19, 2011 at 1:08 PM, Mikola Rose mr...@power-soft.com wrote: Happy Friday people! I was wondering if anyone had any suggestions on how to resolve this issue...  I am moving otrs to another server and during the backup process I am running into this error pg_dump: dumping

Re: [SQL] Max column number.

2011-07-13 Thread Scott Marlowe
On Wed, Jul 13, 2011 at 9:45 AM, Miguel Angel Conte diaf...@gmail.com wrote: Hi, Thanks for your interest. This app load scv files which change every day (sometimes the columns too). The sizes of these files are in avg 15MB. So, We load something like 100MB each day. We tried to find a better

Re: [SQL] Max column number.

2011-07-12 Thread Scott Marlowe
On Tue, Jul 12, 2011 at 12:08 PM, Miguel Angel Conte diaf...@gmail.com wrote: Unfortunately It's an inherited data model and I can't make any change for now... Thanks for your answer! when you can change it, look at hstore -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make

Re: [SQL] what is similar to like operator in mysql for postgresql

2011-07-10 Thread Scott Marlowe
On Sun, Jul 10, 2011 at 1:35 PM, hatem gamal elzanaty ha...@softpro.bz wrote: hi all, can you tell me what is similar to like operator in mysql for postgresql hatem gamal In postgresql ilike is like mysql's case insensitive like. like in postgres is case sensitive. -- Sent via pgsql-sql

Re: [SQL] To find process that lock a table

2011-06-06 Thread Scott Marlowe
On Mon, Jun 6, 2011 at 5:16 PM, manuel antonio ochoa manuel8aalf...@gmail.com wrote: Hello , do you know how to find a process that is locking a table  ? I try to run a vacuum analyze  , an it take a state of waiting , I canceled it after 20 minutes , then I try to run an analyze  and the

Re: [SQL] Function to total reset a schema

2011-05-29 Thread Scott Marlowe
On Sun, May 29, 2011 at 1:38 AM, Surfing onlinesurf...@gmail.com wrote: Hi all, I need to write a function that totally empty a schema. So I have written a TRUNCATE statement for each table and set to 0 each sequence. Btw, it could be good to execute a vacuum statement on each table, but

Re: [SQL] Sorting Issue

2011-05-10 Thread Scott Marlowe
On Tue, May 10, 2011 at 11:45 AM, Samuel Gendler sgend...@ideasculptor.com wrote: On Tue, May 10, 2011 at 9:47 AM, Tom Lane t...@sss.pgh.pa.us wrote: Ozer, Pam po...@automotive.com writes: Isn't this the English standard for collation?  Or is this a non-c locale as mentioned below?  Is

Re: [SQL] Automating PostgreSql table partition using triggers

2011-01-27 Thread Scott Marlowe
On Thu, Jan 27, 2011 at 10:50 AM, Amitabh Kant amitabhk...@gmail.com wrote: Hi I am trying to write a function which is being called from a trigger used for partitioning a large table. The partitioning is to happen based on an integer field (testing_id). A simplified structure of what I am

Re: [SQL] Compare the resulta of a count sql into bash

2011-01-26 Thread Scott Marlowe
On Wed, Jan 26, 2011 at 10:07 AM, manuel antonio ochoa manuel8aalf...@gmail.com wrote: Hello, I have the next : COUNTONE=`/var/lib/pgsql/bin/./psql -U 'Thor'   -d princlocal -p 5432 -h 192.170.1.82  -c select count(*) from monterrey.${NOMBRETB}` COUNTTWO=`/var/lib/pgsql/bin/./psql -U 'Thor' 

Re: [SQL] Benchmarking

2011-01-25 Thread Scott Marlowe
On Tue, Jan 25, 2011 at 10:39 AM, manuel antonio ochoa manuel8aalf...@gmail.com wrote: hello do you know a tool to benchmark my dbase  and the basic test that I need to do ? I found a pgbench !!! ... pgbench can be used as a generic testing tool by giving it a new set of sql statements

Re: [SQL] check files .backup

2011-01-24 Thread Scott Marlowe
On Mon, Jan 24, 2011 at 5:18 PM, manuel antonio ochoa manuel8aalf...@gmail.com wrote: Do you know if exist a  function to check my file.backup created by pgdump. I run backups like this in bash: if (pg_dump yadayada); then echo backup succeeded. else echo backup failed. fi; in a

Re: [SQL] Database consistency after a power shortage

2010-12-15 Thread Scott Marlowe
On Wed, Dec 15, 2010 at 8:12 AM, Alberto blob2...@gmail.com wrote: My question is regarding a potential situation: I have a program that inserts values on 3 tables linked to each other. My program is used in a POS. In this specific case, the program has to update the tables header_invoice,

Re: [SQL] Need magic for inserting in 2 tables

2010-10-03 Thread Scott Marlowe
On Sun, Oct 3, 2010 at 4:14 PM, Andreas maps...@gmx.net wrote: insert into staff ( company_fk, ..., department_fk ) select  company_fk, ..., department_fk from     departments,   companies,   company_2_project  AS c2p where  company_id      =   c2p.company_fk    and c2p.project_fk    =   42  

Re: [SQL] Need magic for inserting in 2 tables

2010-10-03 Thread Scott Marlowe
On Sun, Oct 3, 2010 at 6:47 PM, Andreas maps...@gmx.net wrote: How can a script use what RETURNING dumps out? I tried a bit but got nowhere. The same way it would use the output of a select, it's a record set. So it's x rows by y columns. -- To understand recursion, one must first understand

Re: [SQL] Need magic for inserting in 2 tables

2010-10-03 Thread Scott Marlowe
On Sun, Oct 3, 2010 at 8:31 PM, Andreas maps...@gmx.net wrote: insert into t1_t2 ( fk_1, fk_2 )    insert into table_1 ( txt )    values ( 'A' ), ( 'B' ), ( 'C' )    returning id_1, 42; The inner insert works and dumps the inserted ids along with the constant which is needed in the outer

Re: [SQL] PostGres Tables in ArcSDE and ArcCatalog.

2010-08-31 Thread Scott Marlowe
On Mon, Aug 30, 2010 at 1:31 PM, Michael Andrew Babb ba...@uw.edu wrote: Hi All, If I execute a make table query along the lines of “select * into SF30001_test from SF30001” I can interact with the table in ArcCatalog just fine. what do \z SF30001 \z SF30001_test say about the permissions on

Re: [SQL] Question about POSIX Regular Expressions performance on large dataset.

2010-08-17 Thread Scott Marlowe
On Tue, Aug 17, 2010 at 8:21 PM, Jose Ildefonso Camargo Tolosa ildefonso.cama...@gmail.com wrote: Hi! I'm analyzing the possibility of using PostgreSQL to store a huge amount of data (around 1000M records, or so), and these, even though are short (each record just have a timestamp, and a

Re: [SQL] Question about POSIX Regular Expressions performance on large dataset.

2010-08-17 Thread Scott Marlowe
You can do something similar on the same machine if you can come up with a common way to partition your data. Then you split your 1B rows up into chunks of 10M or so and put each on a table and hit the right table. You can use partitioning / table inheritance if you want to, or just know the

Re: [SQL] Round integer division

2010-06-25 Thread Scott Marlowe
On Fri, Jun 25, 2010 at 6:53 PM, Lee Hachadoorian lee.hachadoor...@gmail.com wrote: Is it documented anywhere that floating-point numbers round scientifically, that is 0.5 rounds to the nearest even number? Compare: SELECT round(2.5::real), round(2.5::numeric), round(3.5::real),

Re: [SQL] oracle to postgres migration question

2010-06-16 Thread Scott Marlowe
On Wed, Jun 16, 2010 at 1:42 PM, Chris Browne cbbro...@acm.org wrote: sfr...@snowman.net (Stephen Frost) writes: People who are trying to parse psql's output directly should realize they probably are going about it the wrong way. :) There's a set of people I need to tell that to... If you're

Re: [SQL] oracle to postgres migration question

2010-06-15 Thread Scott Marlowe
On Tue, Jun 15, 2010 at 1:09 PM, Joshua Gooding jgood...@ttitech.net wrote: Hello, I'm looking for the postgres equivalent of oracles: set numwidth command.  Is there an equivalent? Psql uses dynamic formatting for such things. Not sure there's really a big need for it. Can you give an

Re: [SQL] oracle to postgres migration question

2010-06-15 Thread Scott Marlowe
On Tue, Jun 15, 2010 at 2:19 PM, Stephen Frost sfr...@snowman.net wrote: * Bruce Momjian (br...@momjian.us) wrote: Joshua Gooding wrote: Hello, I'm looking for the postgres equivalent of oracles: set numwidth command.  Is there an equivalent? If we knew what it did, we might be able to

Re: [SQL] import ignoring duplicates

2010-05-17 Thread Scott Marlowe
On Sun, May 16, 2010 at 12:38 PM, Mark Fenbers mark.fenb...@noaa.gov wrote: I am using psql's \copy command to add records to a database from a file.  The file has over 100,000 lines.  Occasionally, there is a duplicate, and the import ceases and an internal rollback is performed.  In other

Re: [SQL] advice on query joining 10 tables

2010-05-10 Thread Scott Marlowe
On Mon, May 10, 2010 at 12:40 PM, Gerardo Herzig gher...@fmed.uba.ar wrote: Hi all. Im triyng to see if i can improve the performance of a query (mainly a 10 table join) 1) Besides of triyng to use indexes, there is some rules of thumb to follow? log long running queries for later analysis?

Re: [SQL] advice on query joining 10 tables

2010-05-10 Thread Scott Marlowe
On Mon, May 10, 2010 at 2:38 PM, Gerardo Herzig gher...@fmed.uba.ar wrote: Scott Marlowe wrote: On Mon, May 10, 2010 at 12:40 PM, Gerardo Herzig gher...@fmed.uba.ar wrote: Hi all. Im triyng to see if i can improve the performance of a query (mainly a 10 table join) 1) Besides of triyng

Re: [SQL] Problem with insert related to different schemas

2010-04-21 Thread Scott Marlowe
On Wed, Apr 21, 2010 at 7:25 AM, Gonzalo Aguilar Delgado gagui...@aguilardelgado.com wrote: Hi Tom, This is a select query.  I don't think that's the right error message. Yes, but IS the correct error message. The query being complained of appears to be a generated foreign key checking

Re: [SQL] Problem with insert related to different schemas

2010-04-20 Thread Scott Marlowe
On Tue, Apr 20, 2010 at 10:32 AM, Gonzalo Aguilar Delgado gagui...@aguilardelgado.com wrote: Hi Everyone, I've come along with a problem that appeared with latest version of Postgresql 8.4.2. I'm trying to insert a row in the analysis schema: This is an insert query: Yes it is...

Re: [SQL] Table Design for Hierarchical Data

2010-04-07 Thread Scott Marlowe
On Tue, Apr 6, 2010 at 11:43 PM, silly sad s...@bankir.ru wrote: P.S. almost foget, do not try any oracle-like tree-jouns or special types or such a crap. your problem as plain as to store a pair of integers (or numerics (i prefer)) Since it's an identifier and not really a numeric per se,

Re: [SQL] Rename Index - Deadlock

2010-03-16 Thread Scott Marlowe
On Tue, Mar 16, 2010 at 3:45 AM, Thomas Kenner thomas.ken...@gmail.com wrote: Hi, Each day I'm recreating the index my_index of the table my_table. Therefore I create a new index my_index_new, drop the old index my_index, and rename the new index: ALTER INDEX my_index_new RENAME TO my_index;

Re: [SQL] Issue with insert

2010-02-27 Thread Scott Marlowe
On Sat, Feb 27, 2010 at 10:14 AM, Michael Gould mgo...@intermodalsoftwaresolutions.net wrote: I'm having a issue with a insert INSERT INTO  iss.citystateinfo (  citystateinfoid,  citystate,  zipcode,  cityname,  statecode ) VALUES (  '31344342-3439-4135-2d32-3044462d3433',  'Orange

Re: [SQL] Fwd: Help required on query performance

2010-01-31 Thread Scott Marlowe
On Sun, Jan 31, 2010 at 5:50 PM, Dave Clements dclement...@gmail.com wrote: Hello, I have this query in my system which takes around 2.5 seconds to run. I have diagnosed that the problem is actually a hashjoin on perm and s_ast_role tables. Is there a way I can avoid that join? I just want to

Re: [SQL] Fwd: Help required on query performance

2010-01-31 Thread Scott Marlowe
On Sun, Jan 31, 2010 at 6:02 PM, Dave Clements dclement...@gmail.com wrote: Hi, following the output from explain analyze. Without doing any heavy analysis, it looks like your row estimates are way off. Have you cranked up stats target and re-analyzed yet? -- Sent via pgsql-sql mailing list

Re: [SQL] Fwd: Help required on query performance

2010-01-31 Thread Scott Marlowe
On Sun, Jan 31, 2010 at 6:09 PM, Dave Clements dclement...@gmail.com wrote: I did the re-analyze serveral times, using the command: ANALYZE tablename; Is there any other command as well or another way to do that? It's important that the stats target get increased as well, it looks like

Re: [SQL] Fwd: Help required on query performance

2010-01-31 Thread Scott Marlowe
On Sun, Jan 31, 2010 at 9:25 PM, Dave Clements dclement...@gmail.com wrote: After the analyze I am getting the time 3.20 ms but there is not HashJoin there. Still all of them are NestLoops. But that is fine. Now the only problem is the sequence scan on sq_sch_idx table. I have a query like

Re: [SQL] Partitioning by letter question

2010-01-30 Thread Scott Marlowe
On Sat, Jan 30, 2010 at 7:11 AM, John Lister john.lister...@kickstone.co.uk wrote: john.lister...@kickstone.com wrote: . Hi, I was wondering if this was possible. I'm trying to partition a table, . which is straightforward enough thanks to the great documentation, but i have a question:

Re: [SQL] Partitioning by letter question

2010-01-29 Thread Scott Marlowe
On Fri, Jan 29, 2010 at 3:24 PM, John Lister john.lister...@kickstone.com wrote: Hi, I was wondering if this was possible. I'm trying to partition a table, which is straightforward enough thanks to the great documentation, but i have a question: If I partition using something like a

Re: [SQL] CHECK constraint removing brackets

2010-01-11 Thread Scott Marlowe
On Mon, Jan 11, 2010 at 12:49 PM, Andy Shellam andy-li...@networkmail.eu wrote: With the above in mind, I decided on the following check to enforce this: (state = 'Unconfirmed'::client.order_state AND invoice_id = NULL) OR (state != 'Unconfirmed'::client.order_state AND invoice_id != NULL)

Re: [SQL] 8.4.1 distinct query WITHOUT order by

2009-12-22 Thread Scott Marlowe
On Tue, Dec 22, 2009 at 12:11 AM, msi77 ms...@yandex.ru wrote: What are the ramifications of renaming the table (containing 8000 rows) and creating a view of the same name? View does not admit ORDER BY clause, at least, Standard does not. Postgres certainly allows it, but I don't think it

Re: [SQL] 8.4.1 distinct query WITHOUT order by

2009-12-21 Thread Scott Marlowe
On Mon, Dec 21, 2009 at 3:38 PM, Thomas Kellerer spam_ea...@gmx.net wrote: Gary Chambers wrote on 21.12.2009 23:15: The current maintainer is unsure about being able to do the right thing and recompile the code after fixing the query. Why not simply add the necessary GROUP BY? Yeah, if

Re: [SQL] 8.4.1 distinct query WITHOUT order by

2009-12-21 Thread Scott Marlowe
On Mon, Dec 21, 2009 at 8:45 PM, Gary Chambers gwch...@gmail.com wrote: Yeah, if you're code base is that fragile, bandaging it up by jumping through hoops in pgsql is just putting off the inevitable when it (the code base) has to get recompiled someday anyway. I appreciate (and agree with)

Re: [SQL] 8.4.1 distinct query WITHOUT order by

2009-12-21 Thread Scott Marlowe
On Mon, Dec 21, 2009 at 10:18 PM, Scott Marlowe scott.marl...@gmail.com wrote: On Mon, Dec 21, 2009 at 8:45 PM, Gary Chambers gwch...@gmail.com wrote: Yeah, if you're code base is that fragile, bandaging it up by jumping through hoops in pgsql is just putting off the inevitable when

Re: [SQL] need nelp with aggregate functions

2009-11-18 Thread Scott Marlowe
On Wed, Nov 18, 2009 at 9:55 AM, Another Trad anothert...@gmail.com wrote: The DB structure is in attachment. I with the number of clients and the number of computers that have processors with manufacturer = INTEL and speed = 2GB I am trying: select count(c) as qtd_client, count(cm) as

Re: [SQL] Foreign key columns

2009-11-05 Thread Scott Marlowe
On Thu, Nov 5, 2009 at 2:08 PM, Svenne Krap svenne.li...@krap.dk wrote: Hi. Is there a simple way to get foreign key data... for example I found a view, that does what I want ... It delivers   fk_table   |     fk_column      |     pk_table      | pk_column |           constraint_name

Re: [SQL] DDL problems: Referential issue?

2009-11-04 Thread Scott Marlowe
On Wed, Nov 4, 2009 at 11:03 AM, Leif Biberg Kristensen l...@solumslekt.org wrote: PostgreSQL 8.3.8 on Gentoo Linux. I've got a junction table: CREATE TABLE participants (    person_fk INTEGER REFERENCES persons (person_id),    event_fk INTEGER REFERENCES events (event_id) ON DELETE

Re: [SQL] DDL problems: Referential issue?

2009-11-04 Thread Scott Marlowe
On Wed, Nov 4, 2009 at 11:36 AM, Leif Biberg Kristensen l...@solumslekt.org wrote: On Wednesday 4. November 2009 19.24.29 Scott Marlowe wrote: You're referencing a single column, which does not have a unique key on it.  Being part of a two column unique PK index doesn't count, as you could

Re: [SQL] DDL problems: Referential issue?

2009-11-04 Thread Scott Marlowe
On Wed, Nov 4, 2009 at 11:53 AM, Leif Biberg Kristensen l...@solumslekt.org wrote: On Wednesday 4. November 2009 19.37.41 Scott Marlowe wrote: On Wed, Nov 4, 2009 at 11:36 AM, Leif Biberg Kristensen l...@solumslekt.org wrote: I'd missed that particular syntax. This table is now without

Re: [SQL] Speed up UPDATE query?

2009-10-31 Thread Scott Marlowe
On Thu, Oct 29, 2009 at 11:50 AM, Lee Hachadoorian lee.hachadoor...@gmail.com wrote: I'm trying to update several tables (all child tables of the same parent), and as the number of records increases, the length of time it takes to run the update is shooting up exponentially. I have imported

Re: [SQL] question about timestamp with tz

2009-10-22 Thread Scott Marlowe
On Thu, Oct 22, 2009 at 2:41 PM, the6campbells the6campbe...@gmail.com wrote: Question.. is there a way that I can get Postgres to return the tz as supplied on the insert statement PostgreSQL converts the timezone to GMT and stores it with no offset, then adds an offset based on the TZ of the

Re: [SQL] reading last inserted record withoud any autoincrement field

2009-10-05 Thread Scott Marlowe
On Sun, Oct 4, 2009 at 1:34 PM, Rob Sargent robjsarg...@gmail.com wrote: Osvaldo Kussama wrote: 2009/10/4 mohammad qoreishy m_qorei...@yahoo.com How can get last inserted record in a table without any autoincrement filed? I need to  frequently fetch the last inserted record. If I must use

Re: [SQL] Can i customize null-padding for outer joins?

2009-10-01 Thread Scott Marlowe
On Thu, Oct 1, 2009 at 12:19 AM, Shruthi A shruthi.i...@gmail.com wrote: Hello, I have a query where I full-outer-join 2 tables, and all the columns other than the join column are numerical columns. For my further calculations i need to pad the unmatched tuples with 0 (zero) instead of NULL

Re: [SQL] Working slow

2009-09-21 Thread Scott Marlowe
On Mon, Sep 21, 2009 at 7:58 AM, Judith Altamirano jaltamir...@lux.com.mx wrote: hello every body, I'm having a data base in a point of sale that is getting frozen, I already have run a vacuum -z -d to reindex the data base and nothing happens.. Some suggestions to speed the process, Do you

Re: [SQL] How to simulate (run) the function

2009-09-04 Thread Scott Marlowe
On Fri, Sep 4, 2009 at 8:43 PM, bilal ghayyadbilmar...@yahoo.com wrote: Hello; I have an SQL function and I need to know how to simulate it (calling it and pass for it the argument and see what the value it returns), HOW? Can I do this from the pgAdminIII GUI or from the CLI? This method

Re: [SQL] Odd sort behaviour

2009-09-01 Thread Scott Marlowe
On Tue, Sep 1, 2009 at 3:01 PM, Rob Sargentrobjsarg...@gmail.com wrote: Since when does . sort as nothing at all Since you set your locale equal to something like en_US instead of C -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription:

Re: [SQL] Call Procedure From Trigger Function

2009-08-19 Thread Scott Marlowe
On Wed, Aug 19, 2009 at 3:53 PM, Doug Pisarekd...@strata-group.com wrote: I am in the process of coverting an Oracle 10.2.0.3 database to Postgresql 8.3. I have a number of triggers in Oracle that make a call to packages. I know I will need to re-write the Oracle packages to postgres functions.

Re: [SQL] De-duplicating rows

2009-07-17 Thread Scott Marlowe
On Thu, Jul 16, 2009 at 9:07 PM, Christophex...@thebuild.com wrote: The Subject: is somewhat imprecise, but here's what I'm trying to do.  For some reason, my brain is locking up over it. I'm moving a 7.2 (yes) database to 8.4.  In the table in question, the structure is along the lines of:

Re: [SQL] Request new version to support on commit drop for create temp table ... as select ?

2009-07-14 Thread Scott Marlowe
On Tue, Jul 14, 2009 at 10:47 AM, Tom Lanet...@sss.pgh.pa.us wrote: Emi Lu em...@encs.concordia.ca writes: I googled to find that on commit drop does not support: (a) create temp table as select * from table1 where 12; http://archives.postgresql.org/pgsql-sql/2005-09/msg00153.php Ah, the

Re: [SQL] Best way to simulate Booleans

2009-07-07 Thread Scott Marlowe
On Mon, Jul 6, 2009 at 7:22 PM, Peter Headlandpheadl...@actuate.com wrote: I know, I know, PostgreSQL has Booleans that work very nicely. Unfortunately, I have to create a schema that will work on Oracle as well as PostgreSQL, by which I mean that a single set of Java/JDBC code has to work

Re: [SQL] Sequences

2009-07-04 Thread Scott Marlowe
Easiest way is with pg_dump -s -t tablename dbname On Sat, Jul 4, 2009 at 6:35 AM, Jasmin Dizdarevicjasmin.dizdare...@gmail.com wrote: Nice Information. Does somebody know how to get the complete create-statement of an existing table/view? 2009/7/3 Chris Browne cbbro...@acm.org Andre Rothe

Re: [SQL] Assigning data-entry tasks to multiple concurrent clients

2009-06-01 Thread Scott Marlowe
On Sun, May 31, 2009 at 9:54 PM, Jamie Tufnell die...@googlemail.com wrote: BEGIN; SELECT * FROM records WHERE in_edit_queue AND id NOT IN (   SELECT record_id FROM locked_records   WHERE locked_since now() + interval '5 minutes') LIMIT 1; INSERT INTO locked_records (record_id,

Re: [SQL] Avoiding will create implicit index NOTICE

2009-06-01 Thread Scott Marlowe
On Mon, Jun 1, 2009 at 1:32 PM, Bryce Nesbitt bry...@obviously.com wrote: I'm looking for a good way to avoid triggering the will create implicit index NOTICE that Postgres (all versions) puts out.  This ends up spamming cron scripts for no good reason: = create table junk_six (foo int,

Re: [SQL] Distinct oddity

2009-05-08 Thread Scott Marlowe
On Fri, May 8, 2009 at 3:28 AM, Maximilian Tyrtania maximilian.tyrta...@onlinehome.de wrote: am 07.05.2009 20:54 Uhr schrieb Scott Marlowe unter scott.marl...@gmail.com: On Thu, May 7, 2009 at 2:21 AM, Maximilian Tyrtania maximilian.tyrta...@onlinehome.de wrote: Hi there, does this look

Re: [SQL] Distinct oddity

2009-05-07 Thread Scott Marlowe
On Thu, May 7, 2009 at 2:21 AM, Maximilian Tyrtania maximilian.tyrta...@onlinehome.de wrote: Hi there, does this look right? FAKDB=# select count(distinct(f.land)) from firmen f where f.typlist='Redaktion';  count ---  1975 (1 row) FAKDB=# select count(distinct(f.land||'1')) from

Re: [SQL] Query with Parameters and Wildcards

2009-04-26 Thread Scott Marlowe
On Sun, Apr 26, 2009 at 6:21 PM, landsharkdaddy ld...@landsharksoftware.com wrote: I have a query that works on SQL Server to return customers that contain the string entered by the user by accepting parameters and using the LIKE keyword. I would like to move this to postgreSQL but I'm just

[SQL] Re: [GENERAL] Frequently unable connecting to db server doesn't listen

2009-04-19 Thread Scott Marlowe
On Sun, Apr 19, 2009 at 8:10 PM, Net Tree Inc. nettree...@gmail.com wrote: If this e-mail address is not intend use for asking questions using e-mail suscription, please ignore it.  I could not find any official PostgreSQL support forum for me to post ask questions. Appreciated if you could

Re: [SQL] Postgres entering zombie state once a week in production evnvironment

2009-04-14 Thread Scott Marlowe
On Tue, Apr 14, 2009 at 12:25 AM, Bryce Nesbitt bry...@obviously.com wrote: We have a medium scale installation of Postgres 8.3 that is freezing about once a week.  I'm looking for any hints on how to diagnose the situation, as nothing is logged. The system is matched pair of Sunfire servers,

Re: [SQL] Postgres entering zombie state once a week in production evnvironment

2009-04-14 Thread Scott Marlowe
On Tue, Apr 14, 2009 at 2:59 PM, Bryce Nesbitt bry...@obviously.com wrote: Scott Marlowe wrote: What does pg_locks say during this time?  Specifically about locks that aren't granted? I don't know, yet.  Though these events go for 15-30 minutes before postgres restart, and no deadlocks

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

2009-04-10 Thread Scott Marlowe
2009/4/7 Stuart McGraw smcg2...@frii.com: Hello all, I have a table with a primary key column that contains sequential numbers. Sometimes I need to shift them all up or down by a fixed amount.  For example, if I have four rows with primary keys, 2, 3, 4, 5, I might want to shift them down

Re: [SQL] How would I get rid of trailing blank line?

2009-04-02 Thread Scott Marlowe
On Thu, Apr 2, 2009 at 3:33 PM, Tena Sakai tsa...@gallo.ucsf.edu wrote: Hi Everybody, I am using postgres 8.3.4 on linux. I often use a line like:   psql -tf query.sql mydatabase query.out -t option gets rid of the heading and count report at the bottom.  There is a blank line at the

Re: [SQL] Add: Special sort querstion

2009-04-01 Thread Scott Marlowe
On Fri, Mar 27, 2009 at 6:10 AM, Dominik Piekarski d.piekar...@vivawasser.de wrote: Oh, actually every row of the same id-range has the same start_lat/start_lng coordinates as the predecessors end_lat/end_lng coordinates. But the question remains the same. Is there a way to do something like

Re: [SQL] alter table on a large db

2009-03-19 Thread Scott Marlowe
On Thu, Mar 19, 2009 at 1:57 AM, Zdravko Balorda zdravko.balo...@siix.com wrote: Hi, I need to make some ALTER TABLEs. It takes about 30min to copy this quite large databse, bat several ours to run a bunch of ALTER TABLE statements. Is there any way to make it faster? I wonder what could

Re: [SQL] counts of groupings by date year-month

2009-02-27 Thread Scott Marlowe
On Fri, Feb 27, 2009 at 2:02 PM, Carol Cheung cache...@consumercontact.com wrote: Hi, I have a table called temp  access_date | active | status -++  2009-02-01  | t      |     15  2009-02-01  | f      |     16  2009-02-02  | f      |     17  2009-02-01  | t    

Re: [SQL] Is this possible?

2009-02-17 Thread Scott Marlowe
On Mon, Feb 16, 2009 at 7:36 PM, johnf jfabi...@yolo.com wrote: Hi, I'm not to sure this is possible. I need to replace a primary key (pkid) with the value of a different field. I have pkid = 200 attendid = 301 I need the pkid = 301 But there may or may not be a pkid that already exist

Re: [SQL] Grass Root Protectionism

2009-02-07 Thread Scott Marlowe
Oh, and might I ask what you've done for pgsql, Mr. hiding behind an anonymous email address at yahoo? -- 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] some howto/theory book/tutorial on practical problem solving in SQL

2009-01-11 Thread Scott Marlowe
On Sun, Jan 11, 2009 at 9:32 AM, Ivan Sergio Borgonovo m...@webthatworks.it wrote: My current problem is how to manage discounts in SQL, inside transactions. Specifically how to delete promotions if they are overlapping, considering I have to display discounted prices on a 1M article DB and I

Re: [SQL] How much the max image size can be inserted into Postgresql

2008-12-24 Thread Scott Marlowe
On Wed, Dec 24, 2008 at 7:00 AM, venkat ven.tammin...@gmail.com wrote: Dear All, I want to insert image which is more than 1 GB.is it possible to store that same size or we can store more than that.Please let me know . Wow. The need for transactional semantics and storage of 1Gig file size

Re: [SQL] index compatible date_trunc in postgres?

2008-12-18 Thread Scott Marlowe
On Thu, Dec 18, 2008 at 10:46 PM, Bryce Nesbitt bry...@obviously.com wrote: I've got a legacy app that does 8.3 incompatible date searches like so: explain select count(*) from contexts where publication_date like '2006%'; explain select count(*) from contexts where publication_date like

Re: [SQL] Best way to restrict detail rows?

2008-12-08 Thread Scott Marlowe
On Mon, Dec 8, 2008 at 1:56 PM, Christopher Maier [EMAIL PROTECTED] wrote: I have a master-detail kind of situation, as illustrated here: CREATE TABLE master( id SERIAL PRIMARY KEY, foo TEXT ); CREATE TABLE detail( id SERIAL PRIMARY KEY master BIGINT NOT NULL

Re: [SQL] Best way to restrict detail rows?

2008-12-08 Thread Scott Marlowe
On Mon, Dec 8, 2008 at 2:28 PM, Scott Marlowe [EMAIL PROTECTED] wrote: On Mon, Dec 8, 2008 at 1:56 PM, Christopher Maier [EMAIL PROTECTED] wrote: I have a master-detail kind of situation, as illustrated here: CREATE TABLE master( id SERIAL PRIMARY KEY, foo TEXT ); CREATE

Re: [SQL] Best way to restrict detail rows?

2008-12-08 Thread Scott Marlowe
On Mon, Dec 8, 2008 at 2:31 PM, Richard Broersma [EMAIL PROTECTED] wrote: One Idea that popped into my head that may-or-may-not work would be to add a constraint trigger that checks if all of the detail records have the same xmin as the order table record. Yes, it's not as simple as I first

Re: [SQL] adding order by to a group by query

2008-12-06 Thread Scott Marlowe
On Sat, Dec 6, 2008 at 10:31 AM, Louis-David Mitterrand [EMAIL PROTECTED] wrote: On Sat, Dec 06, 2008 at 06:26:06PM +0100, Andreas Kretschmer wrote: Louis-David Mitterrand [EMAIL PROTECTED] schrieb: But if I append this order by pt.type_fr = 'comédien'; I get this error:

Re: [SQL] Sequence and nextval problem

2008-11-24 Thread Scott Marlowe
On Mon, Nov 24, 2008 at 12:12 PM, Tk421 [EMAIL PROTECTED] wrote: Hello everybody. I've got an vb aplication that uses an Access database. I'm trying to convert the database to postgres. The conversion was done ok, but i've got a little problem that i don't know how to solve. Let's see if

Re: [SQL] BULK COLLECT

2008-11-21 Thread Scott Marlowe
2008/11/21 Paul Dam [EMAIL PROTECTED]: Hoi, Is there an equivalent in PL/pgSQL for BULK COLLECT in PL/SQL of Oracle? I'm not that familiar with BULK COLLECT in oracle. What does it do? -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription:

Re: [SQL] Measuring degredation of CLUSTER INDEX operation

2008-11-10 Thread Scott Marlowe
On Mon, Nov 10, 2008 at 12:54 PM, Bryce Nesbitt [EMAIL PROTECTED] wrote: I've got a table for which CLUSTER tablename USING index makes an order of magnitude difference. Are there ways to determine how unclustered this table becomes over time, so I can schedule downtime to recluster? I could

Re: [SQL]

2008-11-05 Thread Scott Marlowe
On Wed, Nov 5, 2008 at 9:21 AM, Hemant Patel [EMAIL PROTECTED] wrote: Let Say I have the array of primary key of some table say XYZ. For e.g. (555,222,333,111) When I query for these results I will get the result like in the order of (111,222,333,555) . So now I need to process in the

Re: [SQL] Date Index

2008-10-30 Thread Scott Marlowe
On Thu, Oct 30, 2008 at 2:49 PM, Ryan Hansen [EMAIL PROTECTED] wrote: Hey all, I'm apparently too lazy to figure this out on my own so maybe one of you can just make it easy on me. J I want to index a timestamp field but I only want the index to include the -mm-dd portion of the

  1   2   3   4   >