pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedHelp reqd: Copying char to date
3+ messages / 2 participants
[nested] [flat]
* Help reqd: Copying char to date
@ 2002-03-08 11:38 rjb26@hotmail.losethis.nothere.com
0 siblings, 1 reply; 3+ messages in thread
From: rjb26@hotmail.losethis.nothere.com @ 2002-03-08 11:38 UTC (permalink / raw)
To: pgsql-sql
Anybody offer some advice please:
I want to copy a char field to a date field. Is there any quick way of
doing this?
TIA
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Help reqd: Copying char to date
@ 2002-03-08 13:26 rjb26@hotmail.losethis.nothere.com
parent: rjb26@hotmail.losethis.nothere.com
0 siblings, 1 reply; 3+ messages in thread
From: rjb26@hotmail.losethis.nothere.com @ 2002-03-08 13:26 UTC (permalink / raw)
To: pgsql-sql
On Fri, 08 Mar 2002 12:38:29 +0100, rjb26@hotmail.losethis.nothere.com
wrote:
>Anybody offer some advice please:
>
>I want to copy a char field to a date field. Is there any quick way of
>doing this?
>TIA
Sorry - this was not very clear. I can copy text to a date field; but
actually want to be able to perform the following:
I have a text field (contents: 20020301)
I would like to change the field type to Date, but retain the
contents, but formatted as a date type. Any ideas, suggestions?
TIA
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Help reqd: Copying char to date
@ 2002-03-13 18:18 Stephan Szabo <sszabo@megazone23.bigpanda.com>
parent: rjb26@hotmail.losethis.nothere.com
0 siblings, 0 replies; 3+ messages in thread
From: Stephan Szabo @ 2002-03-13 18:18 UTC (permalink / raw)
To: rjb26@hotmail.losethis.nothere.com; +Cc: pgsql-sql
On Fri, 8 Mar 2002 rjb26@hotmail.losethis.nothere.com wrote:
> On Fri, 08 Mar 2002 12:38:29 +0100, rjb26@hotmail.losethis.nothere.com
> wrote:
>
> >Anybody offer some advice please:
> >
> >I want to copy a char field to a date field. Is there any quick way of
> >doing this?
> >TIA
>
> Sorry - this was not very clear. I can copy text to a date field; but
> actually want to be able to perform the following:
>
> I have a text field (contents: 20020301)
> I would like to change the field type to Date, but retain the
> contents, but formatted as a date type. Any ideas, suggestions?
Umm, if you don't have complicated foreign key structures and the like,
you might just be able to do something like:
select col1, col2, ... , coln::date, ... into tmp from starttable;
alter table starttable rename to old;
alter table tmp rename to starttable;
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2002-03-13 18:18 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-03-08 11:38 Help reqd: Copying char to date rjb26@hotmail.losethis.nothere.com
2002-03-08 13:26 ` rjb26@hotmail.losethis.nothere.com
2002-03-13 18:18 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox