Function args: TEXT -vs- VARCHAR?

From: skinner(at)britvault(dot)co(dot)uk (Craig R(dot) Skinner)
To: pgsql-sql(at)postgresql(dot)org
Subject: Function args: TEXT -vs- VARCHAR?
Date: 2013-11-12 18:17:44
Message-ID: 20131112181744.GA7522@teak.britvault.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Luca Vernini 2013-11-12 18:23:29 Re: Function args: TEXT -vs- VARCHAR?
Previous Message Sergey Konoplev 2013-11-10 23:40:01 Re: Find datatype of a column during the backend flow