Re: [GENERAL] Simple SQL INSERT to avoid duplication failed: why?

2013-05-06 Thread Merlin Moncure
On Mon, May 6, 2013 at 11:19 AM, Carlo Stonebanks wrote: > > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Jasen Betts > Sent: May 4, 2013 7:44 PM > To: pgsql-general@postgresql.org > Subject:

Re: [GENERAL] Simple SQL INSERT to avoid duplication failed: why?

2013-05-06 Thread Carlo Stonebanks
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Jasen Betts Sent: May 4, 2013 7:44 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] Simple SQL INSERT to avoid duplication failed: why? On 2013-05-01, Carlo

Re: [GENERAL] Simple SQL INSERT to avoid duplication failed: why?

2013-05-04 Thread Jasen Betts
On 2013-05-01, Carlo Stonebanks wrote: > There are no client poolers (unless pgtcl has one I don't know about) so > this is unlikely. > > The trigger is an interesting idea to try if it happens again - I can't keep > it for long as it is for a massive cache (used to deflect calls to a web > servi

Re: [GENERAL] Simple SQL INSERT to avoid duplication failed: why?

2013-05-01 Thread Gavin Flower
-Original Message- From: Merlin Moncure [mailto:mmonc...@gmail.com] Sent: May 1, 2013 11:37 AM To: Carlo Stonebanks Cc: Steven Schlansker; pgsql-general@postgresql.org Subject: Re: [GENERAL] Simple SQL INSERT to avoid duplication failed: why? On Wed, May 1, 2013 at 7:16 AM, Carlo Stonebank

Re: [GENERAL] Simple SQL INSERT to avoid duplication failed: why?

2013-05-01 Thread Steven Schlansker
On May 1, 2013, at 9:36 AM, "Carlo Stonebanks" wrote: > I have to ask myself, is it more likely that I have discovered some PG > anomaly in 9.0 that no one has ever noticed, or that the client has > accidentally launched the process twice and doesn't know it? Given my (admittedly limited) exper

Re: [GENERAL] Simple SQL INSERT to avoid duplication failed: why?

2013-05-01 Thread Carlo Stonebanks
, 2013 11:37 AM To: Carlo Stonebanks Cc: Steven Schlansker; pgsql-general@postgresql.org Subject: Re: [GENERAL] Simple SQL INSERT to avoid duplication failed: why? On Wed, May 1, 2013 at 7:16 AM, Carlo Stonebanks wrote: > Very good to know, Steve. We're on 9.0 right now but I will > i

Re: [GENERAL] Simple SQL INSERT to avoid duplication failed: why?

2013-05-01 Thread Merlin Moncure
On Wed, May 1, 2013 at 7:16 AM, Carlo Stonebanks wrote: > Very good to know, Steve. We're on 9.0 right now but I will investigate as > all the work is for unattended automatic processes which are continuously > streaming data from multiple resources and need to resolve these collisions > by themse

Re: [GENERAL] Simple SQL INSERT to avoid duplication failed: why?

2013-05-01 Thread Carlo Stonebanks
al-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Steven Schlansker Sent: April 30, 2013 7:10 PM To: Carlo Stonebanks Cc: 'Tom Lane'; pgsql-general@postgresql.org Subject: Re: [GENERAL] Simple SQL INSERT to avoid duplication failed: why? On Apr 30, 2013, at

Re: [GENERAL] Simple SQL INSERT to avoid duplication failed: why?

2013-04-30 Thread Tom Lane
"Carlo Stonebanks" writes: > The only way I can see this happening is that an > acache_mdx_logic_address_validation sneaks in before the insert and after > the NOT EXISTS... SELECT. And for that to occur, the client must be mistaken > and something else MUST be running and inserting into > acache_

Re: [GENERAL] Simple SQL INSERT to avoid duplication failed: why?

2013-04-30 Thread Steven Schlansker
On Apr 30, 2013, at 4:00 PM, "Carlo Stonebanks" wrote: > Hi Tom, > >>> There's nothing obviously wrong with that, which means the issue is in > something you didn't show us. Care to assemble a self-contained example? > << > > Unfortunately, it happens erratically and very, very rarely so I c

Re: [GENERAL] Simple SQL INSERT to avoid duplication failed: why?

2013-04-30 Thread Carlo Stonebanks
Hi Tom, >> There's nothing obviously wrong with that, which means the issue is in something you didn't show us. Care to assemble a self-contained example? << Unfortunately, it happens erratically and very, very rarely so I can't give you something that will fail. I expected an occasional failure

Re: [GENERAL] Simple SQL INSERT to avoid duplication failed: why?

2013-04-25 Thread Tom Lane
"Carlo Stonebanks" writes: > Ok, I tried to be clever and I wrote code to avoid inserting duplicate data. > The calling function has a try-catch to recover from this, but I am curious > as to why it failed: There's nothing obviously wrong with that, which means the issue is in something you didn'

[GENERAL] Simple SQL INSERT to avoid duplication failed: why?

2013-04-25 Thread Carlo Stonebanks
Ok, I tried to be clever and I wrote code to avoid inserting duplicate data. The calling function has a try-catch to recover from this, but I am curious as to why it failed: INSERT INTO mdx_lib.acache_mdx_logic_address_validation ( address, postal_code, address_id

Re: [GENERAL] simple SQL question

2007-06-25 Thread Rich Shepard
On Mon, 25 Jun 2007, Joshua wrote: I have a column with the following values (example below) 5673 4731 4462 5422 756 3060 Are these numbers that will be used in calculations, or are they strings? I want the column to display the numbers as follows: 56.73 47.31 44.62 54.22 7.56 30.60

Re: {Spam} [GENERAL] simple SQL question

2007-06-25 Thread Dimitri Fontaine
Le lundi 25 juin 2007, Joshua a écrit : > I have been playing around with string functions but cannot seem to > figure out a quick solution. Does anyone have any suggestions? > > Please let me know. What about: pgloader=# select a::float / 100 from (values(5673), (4731), (4462), (5422), (756), (

[GENERAL] simple SQL question

2007-06-25 Thread Joshua
I have a column with the following values (example below) 5673 4731 4462 5422 756 3060 I want the column to display the numbers as follows: 56.73 47.31 44.62 54.22 7.56 30.60 I have been playing around with string functions but cannot seem to figure out a quick solution. Does anyone have any

Re: [GENERAL] Simple SQL

2003-10-24 Thread Alvaro Herrera
On Fri, Oct 24, 2003 at 07:25:44AM +0200, Pavel Stehule wrote: > Not > > SELECT 1 as a, a*2; > ERROR: column "a" does not exist But you can try SELECT a, a*a FROM (select 1 as a); > On Tue, 21 Oct 2003, Bob Messenger wrote: > > > Is it possible to do something like: > > > > select 1 as a

[GENERAL] Simple SQL

2003-10-23 Thread Bob Messenger
Is it possible to do something like: select 1 as a, a*a; in postgres? ---(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