[wp-hackers] Why URL in GUID?

Paul Menard codehooligans at codehooligans.com
Tue Oct 3 00:38:58 GMT 2006


Andy,

Sorry. I didn't mean to touch a nerve or open a can of worms.

I will say I have been guilty of developing a site on my laptop or  
under a development URL. When the time comes to migrate to a  
production system, I will generally export the full database and  
change all references (including the post->guid and various options  
to the new production URL. Was not really sure what the GUID column  
was used for, Though as the name implies and you presented, this is a  
unique value.

I've not delved into this issue much deeper than what I've written  
here to see how/what/where/why the guid is used the way it is. These  
are things on my agenda to investigate one of these days.

The only I have is if this value must be unique, why is it not a  
unique key in the database. More specific, why is it not 'the' unique  
key?

I'm sure this could get into some deep discussion so feel free to  
tell me to GRTFC (Go Read the F***ing Code).

P-


On Oct 2, 2006, at 7:16 PM, Andy Skelton wrote:

> On 10/2/06, Paul Menard <codehooligans at codehooligans.com> wrote:
>> One thing I've often wondered about is why the full URL is stored as
>> part of the Post guid field?
>
> GUID is not "a place to store a canonical URL" or any such thing.
> Changing the slug will invalidate the URL stored in the GUID, but the
> GUID must remain unchanged. Storing the URL there is a quick-n-dirty
> way to provide a string that will probably be Globally Unique.
>
> If anyone would like to propose another way to generate a reasonable
> GUID that is less confusing to db peekers, now's the time.
>
> Andy
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



More information about the wp-hackers mailing list