Unix Technical Forum

Re: Enums patch v2

This is a discussion on Re: Enums patch v2 within the Pgsql Patches forums, part of the PostgreSQL category; --> I am putting this in the patches queue so it is not lost. I believe Neil is working applying ...


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 10:35 AM
Bruce Momjian
 
Posts: n/a
Default Re: Enums patch v2


I am putting this in the patches queue so it is not lost. I believe
Neil is working applying this.

Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

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


Tom Dunstan wrote:
> Neil Conway wrote:
> > On Thu, 2007-02-01 at 22:50 -0500, Bruce Momjian wrote:
> >> Where are we on this?

> >
> > I can commit to reviewing this. The patch looked fairly solid on a quick
> > glance through, but I won't have the cycles to review it properly for a
> > week or two.

>
> I've brought this up to date with the operator family stuff now, and the
> attached patch once more applies cleanly against HEAD. Hopefully that'll
> make life a little easier when reviewing it. Thanks.
>
> I got sick of manually shifting the new OID values every time someone
> had added something new to the catalogs, so I moved all of my OIDs up to
> the 9000 range. Attached is a hacky bash script which can move them back
> to something sane. The idea is to run unused_oids first, see where the
> main block of unused OIDs starts, and then run shift_oids on the
> (unzipped) patch file before applying the patch. We discussed something
> similar a while ago, but no-one ever got around to implementing the script.
>
> I've attached the script and left the OIDs in my patch in the upper
> range rather than just running it myself before submitting the patch as
> I reckon that this might be a useful convention for authors of patches
> which add a non-trivial number of OIDs to the catalogs. If there's
> agreement then anyone can feel free to commit the script to CVS or put
> it on the wiki or whatever.
>
> Cheers
>
> Tom


[ application/x-gzip is not supported, skipping... ]

> #!/bin/sh
>
> start=$1
> end=$2
> new_start=$3
> filename=$4
>
> if [ -z "$filename" ] ; then
> echo Usage: $0 start-oid end-oid new-start-oid filename
> exit 1
> fi
>
> if [ ! -f $filename ] ; then
> echo $0: $filename is not a file
> exit 1
> fi
>
> if [ $end -le $start ] ; then
> echo $0: End of OID range must be greater than or equal to the start
> exit 1
> fi
>
> start_len=`echo -n $start | wc -c`
> end_len=`echo -n $end | wc -c`
>
> if [ $start_len -ne 4 -o $end_len -ne 4 ] ; then
> echo $0: Source OID range must have 4 digits
> exit 1
> fi
>
> let new_end=$new_start+$end-$start
> if [ $start -le $new_start -a $end -ge $new_start -o $new_start -le $start -a $new_end -ge $start ] ; then
> echo $0: OID ranges may not overlap
> exit 1
> fi
>
>
> i=$start
> j=$new_start
> while [ $i -le $end ] ; do
> #echo $i $j
> sed -i "s/$i/$j/g" $filename
> let i=i+1
> let j=j+1
> done


>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings


--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

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 05:32 PM.


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