Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Re: [INTERFACES] retrieving varchar size

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: lockhart(at)alumni(dot)caltech(dot)edu (Thomas G(dot) Lockhart)
Cc: byronn(at)insightdist(dot)com, hannu(at)trust(dot)ee, daveh(at)insightdist(dot)com, pgsql-hackers(at)postgresql(dot)org, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: [HACKERS] Re: [INTERFACES] retrieving varchar size
Date: 1998-04-28 02:17:55
Message-ID: 199804280217.WAA01689@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-interfaces
> 
> > > > We could pass back atttypmod as part of the PGresult.  I can add
> > > > that to the TODO list.  Would that help?
> > > Yes, that would do it!
> > > Thank you for listening to our ravings on this issue.
> > Added to TODO:
> > * Add pg_attribute.atttypmod/Resdom->restypmod to PGresult structure
> > This is a good suggestion.
> 
> How do we determine atttypmod for queries like
> 
>   select '123' || '456';
> 
> ?? I might be able to address this with my upcoming type conversion work
> but I don't know if we have enough hooks for this right now...

No way, I think.  This would have a atttypmod of -1, which is true
because there is no atttypmod size for this.  Once a char()/varchar()
goes into a function, anything can come out.

-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

In response to

pgsql-hackers by date

Next:From: Thomas G. LockhartDate: 1998-04-28 02:22:42
Subject: Re: [HACKERS] Re: [QUESTIONS] Practical SQL Handbook - demo script for postgreSQL
Previous:From: Vadim B. MikheevDate: 1998-04-28 02:04:48
Subject: Re: [INTERFACES] Re: [HACKERS] New Driver and Unique Indexes

pgsql-interfaces by date

Next:From: Bruce MomjianDate: 1998-04-28 02:42:36
Subject: Re: [HACKERS] New Driver and Unique Indexes
Previous:From: Vadim B. MikheevDate: 1998-04-28 02:04:48
Subject: Re: [INTERFACES] Re: [HACKERS] New Driver and Unique Indexes

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group