Question about varchar and text

Ask a Question related to PostgreSQL / PGSQL, Design and Development.

  1. #1

    Default Question about varchar and text

    What is the difference between varchar and text?
    I have heard that you can use text instead of varchar and this could speed
    up your tables.


    Robert Stewart
    Network Eng
    Governor's Office of Technology
    101 Cold Harbor
    Work # 502 564 9696
    Cell # 502 330 5991
    Email [email]RobertD.Stewart@ky.gov[/email]


    Stewart, Robert D Guest

  2. Similar Questions and Discussions

    1. varchar vs text
      Are there any differences between text and varchar? I found the following in the docs, which leads me to believe that there are no differences at...
    2. text and varchar
      Hello, sorry for the trivial question. Is there any difference between varchar and text types in practice? I couldn't find. Mage ...
    3. Making a varchar bigger
      Hello Group, I've run into a bit of a problem, I have a varchar(6) field that I now need to have as a varchar(12). I am relatively new to...
    4. VARCHAR or not ?
      Solaris 8 IDS 7.31 FD3 We have to create a table, that will contain a code, a short description and then a long description (up to 2000...
    5. varchar truncated at 255 characters
      i have a SP that builds a t-sql script. I use a varchar variable to build the script. I have declared the variable as varchar(8000). When I run...
  3. #2

    Default Re: Question about varchar and text

    I don't know about running faster, but I believe the only difference between
    the two in postgres is that a varchar has a limit on input. They are stored
    and indexed the same.

    On January 6, 2005 12:25 pm, Stewart, Robert D (COT) wrote:
    > What is the difference between varchar and text?
    > I have heard that you can use text instead of varchar and this could speed
    > up your tables.
    >
    >
    > Robert Stewart
    > Network Eng
    > Governor's Office of Technology
    > 101 Cold Harbor
    > Work # 502 564 9696
    > Cell # 502 330 5991
    > Email [email]RobertD.Stewart@ky.gov[/email]
    --
    Givex - [url]http://www.givex.com/[/url]
    Derik Barclay <dbarclay@givex.com>, Systems Software Engineer
    +1 416 350 9660
    +1 416 250 9661 (fax)

    ---------------------------(end of broadcast)---------------------------
    TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [email]majordomo@postgresql.org[/email])

    Derik Barclay Guest

  4. #3

    Default Re: Question about varchar and text

    Hi!

    Stewart, Robert D (COT) wrote:
    > What is the difference between varchar and text?
    >
    > I have heard that you can use text instead of varchar and this could
    speed up your tables.


    [url]http://www.postgresql.org/docs/7.4/interactive/datatype-character.html[/url]

    Quote: "Tip: There are no performance differences between these three
    types, apart from the increased storage size when using the blank-padded
    type."

    --
    Thomas Braad Toft

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

    [url]http://archives.postgresql.org[/url]

    Thomas Braad Toft Guest

  5. #4

    Default Re: Question about varchar and text

    Derik Barclay wrote:
    > I don't know about running faster, but I believe the only difference between
    > the two in postgres is that a varchar has a limit on input. They are stored
    > and indexed the same.
    There is a theory that text is faster than varchar, because postgresql
    doesn't have to check text. So it is one less thing for PostgreSQL to do
    before it provides the tuple.

    J


    >
    > On January 6, 2005 12:25 pm, Stewart, Robert D (COT) wrote:
    >
    >>What is the difference between varchar and text?
    >>I have heard that you can use text instead of varchar and this could speed
    >>up your tables.
    >>
    >>
    >>Robert Stewart
    >>Network Eng
    >>Governor's Office of Technology
    >>101 Cold Harbor
    >>Work # 502 564 9696
    >>Cell # 502 330 5991
    >>Email [email]RobertD.Stewart@ky.gov[/email]
    >
    >

    --
    Command Prompt, Inc., home of PostgreSQL Replication, and plPHP.
    Postgresql support, programming shared hosting and dedicated hosting.
    +1-503-667-4564 - [email]jd@commandprompt.com[/email] - [url]http://www.commandprompt.com[/url]
    Mammoth PostgreSQL Replicator. Integrated Replication for PostgreSQL


    ---------------------------(end of broadcast)---------------------------
    TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [email]majordomo@postgresql.org[/email])

    Joshua D. Drake Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139