Subject: timestamptz alias

From: Markus Schaber <[email-masked]>
Date: Tue, 03 Oct 2006 00:15:44 +0200

Hi,

I'm happy that the rather verbose "timestamp with time zone" has the
much nicer alias "timestamptz", however it seems that this alias is not
documented, neither at
http://developer.postgresql.org/pgdocs/postgres/datatype-datetime.html
nor at http://www.postgresql.org/docs/8.1/interactive/datatype-datetime.html

I see it mentioned at
http://www.postgresql.org/docs/8.1/interactive/datatype.html but that's
possibly not where people look at first, when they search for the
timestamp type. (At least I found it only when grepping for
"timestamptz" in the docs. :-)

Should the alias be mentioned on the datetime page? The same for timetz?
What do you think?

Thanks,
Markus

---

From: AgentM <[email-masked]>
Date: Mon, 2 Oct 2006 18:22:39 -0400

> Should the alias be mentioned on the datetime page? The same for  

I am pleased that the documentation promotes database-independent   
("standard") SQL.

-M

---

From: Jim Nasby <[email-masked]>
Date: Mon, 2 Oct 2006 21:26:51 -0400

> I am pleased that the documentation promotes database-independent   

There's a difference between promoting and withholding info. I'd  
rather see us explicitly state which is preferred and why.

BTW, another confusing example is all the string functions that are  
essentially the same, such as substring and substr. (http:// 
www.postgresql.org/docs/8.1/interactive/functions-string.html)
--
Jim Nasby                                            [email-masked]
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)

---

From: Markus Schaber <[email-masked]>
Date: Tue, 03 Oct 2006 11:20:35 +0200

Hi, Jim,

Jim Nasby wrote:

> There's a difference between promoting and withholding info. I'd rather
> see us explicitly state which is preferred and why.

Here's a small patch that adds an appropriate explanation.

Index: doc/src/sgml/datatype.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/datatype.sgml,v
retrieving revision 1.176
diff -u -r1.176 datatype.sgml
--- doc/src/sgml/datatype.sgml  22 Sep 2006 16:20:00 -0000      1.176
+++ doc/src/sgml/datatype.sgml  3 Oct 2006 09:14:32 -0000
@@ -1372,6 +1372,17 @@
     </para>
    </note>

+   <note>
+    <para>
+     <productname>PostgreSQL</productname> also supports the aliases
+     <type>timestamptz</type> for <type>timestamp with time zone</type>
+     and <type>timetz</type> for <type>time with time zone</type>. It
+     is recommended to avoid them, as the more verbose variants comply
+     to the SQL standard, and thus are more portable. But there are no
+     plans to drop the short aliases in future versions.
+    </para>
+   </note>
+
    <para>
     <type>time</type>, <type>timestamp</type>, and
     <type>interval</type> accept an optional precision value

HTH,
Markus
-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org

---

From: Tom Lane <[email-masked]>
Date: Tue, 03 Oct 2006 11:33:02 -0400

> Here's a small patch that adds an appropriate explanation.

If we're going to document these aliases, what of float4, float8, and bool?
Also, although the docs mention int2/int4/int8, it's more or less left
to the reader's imagination to deduce what they are.

Perhaps it'd be better to provide a small table of recognized type
aliases, rather than inserting equivalent notes into three or four places.

			regards, tom lane

---

From: Andrew Dunstan <[email-masked]>
Date: Tue, 03 Oct 2006 12:13:46 -0400

> aliases, rather than inserting equivalent notes into three or four places.

you mean like the table here?  
http://momjian.us/main/writings/pgsql/sgml/datatype.html

cheers

andrew

---

From: "Jim C. Nasby" <[email-masked]>
Date: Tue, 3 Oct 2006 11:47:16 -0500

Moving to -docs

> http://momjian.us/main/writings/pgsql/sgml/datatype.html

An issue I've seen with the docs is that for chapters that have a lot of
sections (such as 8), the section list at the start of each chapter
fills the screen, so it's easy to miss the fact that there's more info
beneath the list (which is wy presumably most folks never knew that
table existed).

I think the ideal way to handle this would be to put the table of
contents in a side-bar and flow the text around it. But that could be a
real bear to do in docbook/sgml, so perhaps it would be better to just
force the TOC for each chapter onto it's own page (and ensure the
overview/introduction text shows up in the TOC).
-- 
Jim Nasby                                            [email-masked]
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)

---

From: Andrew Dunstan <[email-masked]>
Date: Tue, 03 Oct 2006 12:57:17 -0400

> overview/introduction text shows up in the TOC).

I would like a frame driven version of the docs (c.f. doxygen, javadoc, 
etc.). The we would not need contents links at the top of each chapter 
like this. Navigating the HTML docs is less than pleasant. 
Unfortunately, I don't have enough time or docbook-fu to be able to do this.

cheers

andrew

---

From: Peter Eisentraut <[email-masked]>
Date: Wed, 4 Oct 2006 02:01:23 +0200

Jim C. Nasby wrote:
> contents in a side-bar and flow the text around it.

It's all CSS, so this should be doable.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---

From: Markus Schaber <[email-masked]>
Date: Wed, 04 Oct 2006 11:39:27 +0200

Hi, Jim,

> overview/introduction text shows up in the TOC).

I agree.

The fact that the TOC and the first part of the Chapter are on the same
page has annoyed me several times now. :-)

Regards,
Markus

---

From: Markus Schaber <[email-masked]>
Date: Wed, 04 Oct 2006 11:41:28 +0200

Hi, Tom,

> aliases, rather than inserting equivalent notes into three or four places.

It's not only about documenting the pure existence of the aliases (which
was already documented in the table on the datatype TOC page), it's also
about telling the user which of the names are the ones to avoid, and the
reasons to do so.

HTH,
Markus

---

From: "Magnus Hagander" <[email-masked]>
Date: Wed, 4 Oct 2006 15:05:58 +0200

> I would like a frame driven version of the docs (c.f. 
> doxygen, javadoc, etc.). The we would not need contents links 
> at the top of each chapter like this. Navigating the HTML 
> docs is less than pleasant. 

Yuck. Frames. Ickk. All the issues with bookmarking and searching and
things like that.

Anyway. If done, make sure the current version doesn't go away, but make
the frames version just an option instead.

//Magnus

---

From: Andrew Dunstan <[email-masked]>
Date: Wed, 04 Oct 2006 10:05:07 -0400

> the frames version just an option instead.

Then use a tiled mechanism instead if you want to avoid frames. Or if 
you want to be get more advanced some sort of Ajax solution. But we need 
some sort of nav bar that you can drill down on. Navigation now is just 
horrible, IMNSHO.

cheers

andrew

---

From: Andrew Dunstan <[email-masked]>
Date: Wed, 04 Oct 2006 10:17:51 -0400

> about telling the user which of the names are the ones to avoid, and the

*blink* Why do any need to be avoided? What you use is a matter of 
taste, and your organisation's coding standards. From a purely technical 
POV I don't see any reason to avoid using either the canonical type 
names or the various aliases.

cheers

andrew

---

From: Markus Schaber <[email-masked]>
Date: Wed, 04 Oct 2006 17:52:17 +0200

Hi, Andrew,

> names or the various aliases.

At least compatibility with the SQL standard, as well as with other
Databases might be a reason.

Using pure "timestamp" may lead human readers to be confused, because it
has both meanings with and without timezone historically, this might be
a reason to prefer the "timestamp with[out] time zone" wording.

HTH,
Markus

---

From: Jim Nasby <[email-masked]>
Date: Thu, 5 Oct 2006 21:18:40 -0500

> Databases might be a reason.

It would be nice to denote types/aliases that are and aren't ANSI. A  
number are marked  in the docs, but it would be good to add the info  
to that summary table.
--
Jim Nasby                                            [email-masked]
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)

--
Jim Nasby                                    [email-masked]
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)

---

From: "Andrew Dunstan" <[email-masked]>
Date: Fri, 6 Oct 2006 02:35:55 -0500 (CDT)

> number are marked  in the docs, but it would be good to add the info

Right under the table this sentence appears:

Compatibility:  The following types (or spellings thereof) are specified
by SQL: bit, bit varying, boolean, char, character varying, character,
varchar, date, double precision, integer, interval, numeric, decimal,
real, smallint, time (with or without time zone), timestamp (with or
without time zone).

What's unclear about that?

cheers

andrew

---

From: "Jim C. Nasby" <[email-masked]>
Date: Sun, 8 Oct 2006 12:03:26 -0500

> What's unclear about that?

Oops. This is what happens when I answer emails on a plane. :(
-- 
Jim Nasby                                            [email-masked]
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)