Re: [GENERAL] timestamp to int

2001-06-30 Thread Tomas Berndtsson

will trillich <[EMAIL PROTECTED]> writes:

> On Tue, Jun 26, 2001 at 09:22:25PM +0200, Tomas Berndtsson wrote:
> > Is there a way to do it the other way around, from an integer to a
> > timestamp?
> 
> of course not. don't be silly.
> 
> certainly not date_part or to_char or to_date. they're not
> mentioned in the docs, either, so don't bother looking.
> (think of the time you'll save.)
> 
> in particular, on my debian system, you wouldn't look in
> /usr/share/doc/postgresql-doc/html/postgres/postgres.htm
> and you wouldn't do
> 
>   cd /usr/share/doc/postgresql-doc/html/postgres
>   grep -i epoch *
> 
> that would be bad.

I sense a touch of sarcasm. Yet, having looked (yes, before I mailed,
and now again after), I still can't find a way to create a timestamp
from an integer. You may call me stupid, but I'd be glad to see how
it's done.


Tomas

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [GENERAL] User defined type with text* field

2001-06-30 Thread Tom Lane

Ken K <[EMAIL PROTECTED]> writes:
>  I am trying to create a user defined type with 2 fields
> in it, a text* and an Oid. I am not sure what size to
> use in the create type command. When I try variable
> the back end core dumps. Are there any examples for
> doing this sort of thing?  Is it even doable?

You can't use any kind of pointer in a datatype --- what is it going to
point to?  There's nothing it could point at that might live as long as
the datavalue on disk will.

You could embed a TEXT value into a larger varlena value, say


Oid


regards, tom lane

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster