Unix Technical Forum

Re: [HACKERS] Best practices: MERGE

This is a discussion on Re: [HACKERS] Best practices: MERGE within the Pgsql Patches forums, part of the PostgreSQL category; --> On Tue, Mar 08, 2005 at 12:27:21PM +0800, Christopher Kings-Lynne wrote: > >Luckily, PG 8 is available for this. ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 11:08 PM
David Fetter
 
Posts: n/a
Default Re: [HACKERS] Best practices: MERGE

On Tue, Mar 08, 2005 at 12:27:21PM +0800, Christopher Kings-Lynne wrote:
> >Luckily, PG 8 is available for this. Do you have a short example?

>
> No, and I think it should be in the manual as an example.
>
> You will need to enter a loop that uses exception handling to detect
> unique_violation.


Pursuant to an IRC discussion to which Dennis Bjorklund and
Christopher Kings-Lynne made most of the contributions, please find
enclosed an example patch demonstrating an UPSERT-like capability.

Cheers,
D
--
David Fetter david@fetter.org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778

Remember to vote!


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 11:14 PM
Bruce Momjian
 
Posts: n/a
Default Re: [HACKERS] Best practices: MERGE


Patch applied. Thanks. Sorry for the delay in applying.

---------------------------------------------------------------------------


David Fetter wrote:
> On Tue, Mar 08, 2005 at 12:27:21PM +0800, Christopher Kings-Lynne wrote:
> > >Luckily, PG 8 is available for this. Do you have a short example?

> >
> > No, and I think it should be in the manual as an example.
> >
> > You will need to enter a loop that uses exception handling to detect
> > unique_violation.

>
> Pursuant to an IRC discussion to which Dennis Bjorklund and
> Christopher Kings-Lynne made most of the contributions, please find
> enclosed an example patch demonstrating an UPSERT-like capability.
>
> Cheers,
> D
> --
> David Fetter david@fetter.org http://fetter.org/
> phone: +1 510 893 6100 mobile: +1 415 235 3778
>
> Remember to vote!


[ Attachment, skipping... ]

>
> ---------------------------(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


--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 11:14 PM
Christopher Kings-Lynne
 
Posts: n/a
Default Re: [HACKERS] Best practices: MERGE

Is that broken?

http://momjian.postgresql.org/main/w...gml/build.html

Chris

Bruce Momjian wrote:
> Patch applied. Thanks. Sorry for the delay in applying.
>
> ---------------------------------------------------------------------------
>
>
> David Fetter wrote:
>
>>On Tue, Mar 08, 2005 at 12:27:21PM +0800, Christopher Kings-Lynne wrote:
>>
>>>>Luckily, PG 8 is available for this. Do you have a short example?
>>>
>>>No, and I think it should be in the manual as an example.
>>>
>>>You will need to enter a loop that uses exception handling to detect
>>>unique_violation.

>>
>>Pursuant to an IRC discussion to which Dennis Bjorklund and
>>Christopher Kings-Lynne made most of the contributions, please find
>>enclosed an example patch demonstrating an UPSERT-like capability.
>>
>>Cheers,
>>D
>>--
>>David Fetter david@fetter.org http://fetter.org/
>>phone: +1 510 893 6100 mobile: +1 415 235 3778
>>
>>Remember to vote!

>
>
> [ Attachment, skipping... ]
>
>
>>---------------------------(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

>
>


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-17-2008, 11:14 PM
Bruce Momjian
 
Posts: n/a
Default Re: [HACKERS] Best practices: MERGE


Thanks, fixed.

---------------------------------------------------------------------------

Christopher Kings-Lynne wrote:
> Is that broken?
>
> http://momjian.postgresql.org/main/w...gml/build.html
>
> Chris
>
> Bruce Momjian wrote:
> > Patch applied. Thanks. Sorry for the delay in applying.
> >
> > ---------------------------------------------------------------------------
> >
> >
> > David Fetter wrote:
> >
> >>On Tue, Mar 08, 2005 at 12:27:21PM +0800, Christopher Kings-Lynne wrote:
> >>
> >>>>Luckily, PG 8 is available for this. Do you have a short example?
> >>>
> >>>No, and I think it should be in the manual as an example.
> >>>
> >>>You will need to enter a loop that uses exception handling to detect
> >>>unique_violation.
> >>
> >>Pursuant to an IRC discussion to which Dennis Bjorklund and
> >>Christopher Kings-Lynne made most of the contributions, please find
> >>enclosed an example patch demonstrating an UPSERT-like capability.
> >>
> >>Cheers,
> >>D
> >>--
> >>David Fetter david@fetter.org http://fetter.org/
> >>phone: +1 510 893 6100 mobile: +1 415 235 3778
> >>
> >>Remember to vote!

> >
> >
> > [ Attachment, skipping... ]
> >
> >
> >>---------------------------(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

> >
> >

>


--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-17-2008, 11:57 PM
David Fetter
 
Posts: n/a
Default Re: [HACKERS] Best practices: MERGE

On Mon, Apr 18, 2005 at 11:55:44PM -0400, Bruce Momjian wrote:
>
> Thanks, fixed.


Could you apply this to the 8.0 docs, too? The exception handling
works in 8.0, and I know at least two places where it's in production


Cheers,
D
>
> ---------------------------------------------------------------------------
>
> Christopher Kings-Lynne wrote:
> > Is that broken?
> >
> > http://momjian.postgresql.org/main/w...gml/build.html
> >
> > Chris
> >
> > Bruce Momjian wrote:
> > > Patch applied. Thanks. Sorry for the delay in applying.
> > >
> > > ---------------------------------------------------------------------------
> > >
> > >
> > > David Fetter wrote:
> > >
> > >>On Tue, Mar 08, 2005 at 12:27:21PM +0800, Christopher Kings-Lynne wrote:
> > >>
> > >>>>Luckily, PG 8 is available for this. Do you have a short example?
> > >>>
> > >>>No, and I think it should be in the manual as an example.
> > >>>
> > >>>You will need to enter a loop that uses exception handling to detect
> > >>>unique_violation.
> > >>
> > >>Pursuant to an IRC discussion to which Dennis Bjorklund and
> > >>Christopher Kings-Lynne made most of the contributions, please find
> > >>enclosed an example patch demonstrating an UPSERT-like capability.
> > >>
> > >>Cheers,
> > >>D
> > >>--
> > >>David Fetter david@fetter.org http://fetter.org/
> > >>phone: +1 510 893 6100 mobile: +1 415 235 3778
> > >>
> > >>Remember to vote!
> > >
> > >
> > > [ Attachment, skipping... ]
> > >
> > >
> > >>---------------------------(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
> > >
> > >

> >

>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman@candle.pha.pa.us | (610) 359-1001
> + If your life is a hard drive, | 13 Roberts Road
> + Christ can be your backup. | Newtown Square, Pennsylvania 19073
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org


--
David Fetter david@fetter.org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778

Remember to vote!

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-17-2008, 11:57 PM
Neil Conway
 
Posts: n/a
Default Re: [HACKERS] Best practices: MERGE

On Tue, 2005-04-10 at 09:41 -0700, David Fetter wrote:
> Could you apply this to the 8.0 docs, too?


Applied, with fixes.

-Neil



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:28 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com