Re: Function args: TEXT -vs- VARCHAR? - Mailing list pgsql-sql

From Luca Vernini
Subject Re: Function args: TEXT -vs- VARCHAR?
Date
Msg-id CAHZ=uVAOB9H9jS2BGnu9jDKosxapKY2_M+arf+-kC1fwCSgvfg@mail.gmail.com
Whole thread Raw
In response to Function args: TEXT -vs- VARCHAR?  (skinner@britvault.co.uk (Craig R. Skinner))
Responses Re: Function args: TEXT -vs- VARCHAR?  (skinner@britvault.co.uk (Craig R. Skinner))
List pgsql-sql
I like to have constraint, so I usually use character varying.
Anyway, there is no performance difference:
http://www.postgresql.org/docs/9.2/static/datatype-character.html

So use character varying just if you can, or if you must limit the input.

2013/11/12 Craig R. Skinner <skinner@britvault.co.uk>:
> When writing (9.2) PostgreSQL functions, is it preferable to have text
> or character varying args?
>
> The tables the functions are updating/inserting into have character
> varying columns.
>
> I've used both in various places & want to unify.
>
> Using character varying with an over length arg causes the function to
> bomb out on calling, which seems the logical thing to do as the table
> can't accept the data anyway.
>
> Thoughts?
> --
> Craig Skinner | http://twitter.com/Craig_Skinner | http://linkd.in/yGqkv7
>
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql



pgsql-sql by date:

Previous
From: skinner@britvault.co.uk (Craig R. Skinner)
Date:
Subject: Function args: TEXT -vs- VARCHAR?
Next
From: Sergey Konoplev
Date:
Subject: Re: Function args: TEXT -vs- VARCHAR?