dbTalk Databases Forums  

can I define a hyperlink as a datatype

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss can I define a hyperlink as a datatype in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kumar S
 
Posts: n/a

Default can I define a hyperlink as a datatype - 09-14-2004 , 12:30 AM






Dear Group,
is there a way to define a hyperlink as a datatype.

I want to store hyperlink for an FTP site as my data
link. Is this possible or it is good to define it as
varchar.

Please suggest.
thanks
psk





__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail

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


Reply With Quote
  #2  
Old   
Josh Berkus
 
Posts: n/a

Default Re: can I define a hyperlink as a datatype - 09-14-2004 , 07:18 PM






Kumar,

Quote:
is there a way to define a hyperlink as a datatype.

I want to store hyperlink for an FTP site as my data
link. Is this possible or it is good to define it as
varchar.
You can just use TEXT. If you want to get really sophisticated, you can
define a DOMAIN to check for proper format.

--
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco

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



Reply With Quote
  #3  
Old   
Oliver Fromme
 
Posts: n/a

Default Re: can I define a hyperlink as a datatype - 09-15-2004 , 05:19 AM




Josh Berkus wrote:
Quote:
Kumar,
is there a way to define a hyperlink as a datatype.

I want to store hyperlink for an FTP site as my data
link. Is this possible or it is good to define it as
varchar.

You can just use TEXT. If you want to get really sophisticated, you can
define a DOMAIN to check for proper format.
Depending on the application, it might also be useful to
store the components of the URI in separate columns, i.e.
method, hostname, username/password, port number, path,
arguments and anchor (most of those are optional).

For example, http://www.freebsd.org/cgi/man.cgi?query=ls
would be stored like this: method = 'http', hostname =
"www.freebsd.org", username = NULL, password = NULL, port =
80, path = "/cgi/man.cgi", arguments = "query=ls", anchor =
NULL.

Then you can, for example, sort and select by hostname,
compare document URIs without regard to arguments and an-
chors, more easily search for specific path names, etc.

Of course, if the application handles the URIs as opaque
strings without being interested in their components, then
storing them as single TEXT values is sufficient.

(BTW, varchar(n) would be a bad idea, because they can get
pretty long. Earlier RFCs define a limit of 1023 chars,
however, that limit was lifted by later standards, IIRC.)

Best regards
Oliver

--
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"And believe me, as a C++ programmer, I don't hesitate to question
the decisions of language designers. After a decent amount of C++
exposure, Python's flaws seem ridiculously small." -- Ville Vainio

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

http://archives.postgresql.org



Reply With Quote
  #4  
Old   
Arthur van Dorp
 
Posts: n/a

Default Re: can I define a hyperlink as a datatype - 09-15-2004 , 09:46 AM



Quote:
You can just use TEXT. If you want to get really sophisticated,
you can define a DOMAIN to check for proper format.
Isn't TEXT a bit dangerous? If the links come from "outside" someone
could try to DDOS the database with huge strings until you run out of space.

Arthur


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



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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.