PostgreSQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesPostgreSQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old April 6th, 2008, 06:08 AM
lakinder lakinder is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 1 lakinder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 15 sec
Reputation Power: 0
Insert_or_update and update_or_insert procedures

uhahaha a week with no answer!
postgres community sucks...

Reply With Quote
  #2  
Old April 10th, 2008, 06:35 PM
pgFrank's Avatar
pgFrank pgFrank is offline
So help me Codd
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2008
Location: Brazil
Posts: 129 pgFrank User rank is Sergeant (500 - 2000 Reputation Level)pgFrank User rank is Sergeant (500 - 2000 Reputation Level)pgFrank User rank is Sergeant (500 - 2000 Reputation Level)pgFrank User rank is Sergeant (500 - 2000 Reputation Level)pgFrank User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 17 h 45 m 18 sec
Reputation Power: 18
Quote:
Originally Posted by lakinder
uhahaha a week with no answer!
postgres community sucks...
Yeah, right.

Code:
UPDATE yourtable SET yourcolumn= yourcolumn +1 WHERE id = $id;
IF NOT FOUND THEN
  INSERT INTO yourtable (id, yourcolumn) VALUES ($id, 1);
END IF;

Not 100% save, therefor you need a stored procedure. But that's something you can write yourself. Right?
__________________
PostgreSQL-manual

Reply With Quote
  #3  
Old April 11th, 2008, 01:31 AM
shammat shammat is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 963 shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 15 h 15 m 49 sec
Reputation Power: 57
Quote:
Originally Posted by lakinder
uhahaha a week with no answer!
postgres community sucks...
I can't even see a question
Dumb posters suck

(btw: this forum is not the Postgres community. The PG mailing list is probably the best contact you can get to "the community")
Comments on this post
pgFrank agrees: I was too shy to tell him this...

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesPostgreSQL Help > Insert_or_update and update_or_insert procedures


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway