Re: [HACKERS] atttypmod

Lists: pgsql-hackers
From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: hackers(at)postgreSQL(dot)org (PostgreSQL-development)
Subject: atttypmod
Date: 1998-02-19 21:48:26
Message-ID: 199802192148.QAA14921@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Just to let people know, pg_attribute.atttypmod is now passed as the
third parameter to all in and out functions, so it is ready to go for
people who need this functionality.

We did this by passing it through the backend from TypName and Resdom to
TupleDesc.

--
Bruce Momjian
maillist(at)candle(dot)pha(dot)pa(dot)us


From: Brett McCormick <brett(at)work(dot)chicken(dot)org>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: hackers(at)postgreSQL(dot)org (PostgreSQL-development)
Subject: Re: [HACKERS] atttypmod
Date: 1998-02-20 02:59:43
Message-ID: 199802200259.SAA11199@abraxas.scene.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Which functionality is that?

On Thu, 19 February 1998, at 16:48:26, Bruce Momjian wrote:

> Just to let people know, pg_attribute.atttypmod is now passed as the
> third parameter to all in and out functions, so it is ready to go for
> people who need this functionality.


From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: brett(at)work(dot)chicken(dot)org (Brett McCormick)
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] atttypmod
Date: 1998-02-20 03:04:34
Message-ID: 199802200304.WAA20036@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

>
>
> Which functionality is that?
>
> On Thu, 19 February 1998, at 16:48:26, Bruce Momjian wrote:
>
> > Just to let people know, pg_attribute.atttypmod is now passed as the
> > third parameter to all in and out functions, so it is ready to go for
> > people who need this functionality.
>

Things like decimal types with defined precision. decimal(10,2).

--
Bruce Momjian
maillist(at)candle(dot)pha(dot)pa(dot)us


From: Brett McCormick <brett(at)work(dot)chicken(dot)org>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] atttypmod
Date: 1998-02-20 03:09:55
Message-ID: 199802200309.TAA11262@abraxas.scene.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


How about having output options for types? I know this can be
implemented with functions and views, but it would be nice to able to
output values in different formats by default (such as datetime =>
seconds since the epoch)

On Thu, 19 February 1998, at 22:04:34, Bruce Momjian wrote:

> > Which functionality is that?
> >
> > On Thu, 19 February 1998, at 16:48:26, Bruce Momjian wrote:
> >
> > > Just to let people know, pg_attribute.atttypmod is now passed as the
> > > third parameter to all in and out functions, so it is ready to go for
> > > people who need this functionality.
> >
>
> Things like decimal types with defined precision. decimal(10,2).
>
> --
> Bruce Momjian
> maillist(at)candle(dot)pha(dot)pa(dot)us


From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: brett(at)work(dot)chicken(dot)org (Brett McCormick)
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] atttypmod
Date: 1998-02-20 03:19:57
Message-ID: 199802200319.WAA20990@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

You could use atttypmod to have a type that has a default output format
that you specify at type creation time.

>
>
> How about having output options for types? I know this can be
> implemented with functions and views, but it would be nice to able to
> output values in different formats by default (such as datetime =>
> seconds since the epoch)
>
> On Thu, 19 February 1998, at 22:04:34, Bruce Momjian wrote:
>
> > > Which functionality is that?
> > >
> > > On Thu, 19 February 1998, at 16:48:26, Bruce Momjian wrote:
> > >
> > > > Just to let people know, pg_attribute.atttypmod is now passed as the
> > > > third parameter to all in and out functions, so it is ready to go for
> > > > people who need this functionality.
> > >
> >
> > Things like decimal types with defined precision. decimal(10,2).
> >
> > --
> > Bruce Momjian
> > maillist(at)candle(dot)pha(dot)pa(dot)us
>

--
Bruce Momjian
maillist(at)candle(dot)pha(dot)pa(dot)us


From: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
To: Brett McCormick <brett(at)work(dot)chicken(dot)org>
Cc: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>, hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] atttypmod
Date: 1998-02-20 03:24:54
Message-ID: 34ECF786.94F34FDB@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Brett McCormick wrote:

> How about having output options for types? I know this can be
> implemented with functions and views, but it would be nice to able to
> output values in different formats by default (such as datetime =>
> seconds since the epoch)

This is a slippery slope. If you have various output options, then you also
would want to cleanly input those same outputs. There are already some output
options for date/time, to accomodate the world-wide variations in same. Having
a fully-general input/output capability for all data types which bypasses
functions and views seems to be ignoring the power of those existing
mechanisms...

otoh, we _do_ have to figure out how to implement the decimal/numeric type
someday, so dive in :)

- Tom


From: The Hermit Hacker <scrappy(at)hub(dot)org>
To: Brett McCormick <brett(at)work(dot)chicken(dot)org>
Cc: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>, hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] atttypmod
Date: 1998-02-20 03:36:58
Message-ID: Pine.BSF.3.96.980219233641.226j-100000@thelab.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, 19 Feb 1998, Brett McCormick wrote:

>
> How about having output options for types? I know this can be
> implemented with functions and views, but it would be nice to able to
> output values in different formats by default (such as datetime =>
> seconds since the epoch)

date_part('epoch', 'now'::datetime);

>
> On Thu, 19 February 1998, at 22:04:34, Bruce Momjian wrote:
>
> > > Which functionality is that?
> > >
> > > On Thu, 19 February 1998, at 16:48:26, Bruce Momjian wrote:
> > >
> > > > Just to let people know, pg_attribute.atttypmod is now passed as the
> > > > third parameter to all in and out functions, so it is ready to go for
> > > > people who need this functionality.
> > >
> >
> > Things like decimal types with defined precision. decimal(10,2).
> >
> > --
> > Bruce Momjian
> > maillist(at)candle(dot)pha(dot)pa(dot)us
>

Marc G. Fournier
Systems Administrator @ hub.org
primary: scrappy(at)hub(dot)org secondary: scrappy(at){freebsd|postgresql}.org


From: Brett McCormick <brett(at)work(dot)chicken(dot)org>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] atttypmod
Date: 1998-02-20 03:59:35
Message-ID: 199802200359.TAA11588@abraxas.scene.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


er, at table creation time?

On Thu, 19 February 1998, at 22:19:57, Bruce Momjian wrote:

> You could use atttypmod to have a type that has a default output format
> that you specify at type creation time.


From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: brett(at)work(dot)chicken(dot)org (Brett McCormick)
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] atttypmod
Date: 1998-02-20 04:14:42
Message-ID: 199802200414.XAA22342@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

>
>
> er, at table creation time?
>
> On Thu, 19 February 1998, at 22:19:57, Bruce Momjian wrote:
>
> > You could use atttypmod to have a type that has a default output format
> > that you specify at type creation time.
>

Oops, yep, table creation time.

--
Bruce Momjian
maillist(at)candle(dot)pha(dot)pa(dot)us