Home > Archive > PostgreSQL Discussion > March 2006 > updategram in pg









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author updategram in pg
SunWuKung

2006-03-29, 3:27 am

Is there a way to store update/insert logic in the data instead of=20
writing db or application procedures to do that?

I am looking for something along the lines of MS updategrams like this:

<ROOT xmlns:updg=3D"urn:schemas-microsoft-com:xml-updategram">
<updg:sync>
<updg:before></updg:before>
<updg:after updg:returnid=3D"x y" >
<HumanResources.Shift updg:at-identity=3D"x" Name=3D"Day-Evening"
StartTime=3D"1900-01-01 11:00:00.000"
EndTime=3D"1900-01-01 19:00:00.000"
ModifiedDate=3D"2004-01-01 00:00:00.000" />
<HumanResources.Shift updg:at-identity=3D"y" Name=3D"Evening-Night"
StartTime=3D"1900-01-01 19:00:00.000"
EndTime=3D"1900-01-01 03:00:00.000"
ModifiedDate=3D"2004-01-01 00:00:00.000" />
</updg:after>
</updg:sync>
</ROOT>

Thanks for the help.
Bal=E1zs
Jim Nasby

2006-03-31, 8:25 pm

No, but you should be able to build something similar using a
language that understands XML. You could then pass something like
this to the database:

SELECT updategram.update('big-ole XML string');

If you wanted to get even more fancy, you could create a daemon that
would accept connections as if it was a postmaster and handle in-line
XML requests however MS does.

If you decide to go this route please consider starting a project on
pgFoundry, as I'm sure others would find this useful.

On Mar 29, 2006, at 2:08 AM, SunWuKung wrote:

> Is there a way to store update/insert logic in the data instead of
> writing db or application procedures to do that?
>
> I am looking for something along the lines of MS updategrams like
> this:
>
> <ROOT xmlns:updg="urn:schemas-microsoft-com:xml-updategram">
> <updg:sync>
> <updg:before></updg:before>
> <updg:after updg:returnid="x y" >
> <HumanResources.Shift updg:at-identity="x" Name="Day-Evening"
> StartTime="1900-01-01 11:00:00.000"
> EndTime="1900-01-01 19:00:00.000"
> ModifiedDate="2004-01-01 00:00:00.000" />
> <HumanResources.Shift updg:at-identity="y" Name="Evening-Night"
> StartTime="1900-01-01 19:00:00.000"
> EndTime="1900-01-01 03:00:00.000"
> ModifiedDate="2004-01-01 00:00:00.000" />
> </updg:after>
> </updg:sync>
> </ROOT>
>
> Thanks for the help.
> Balázs
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>


--
Jim C. Nasby, Database Architect decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"



---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com