pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feeddate array
4+ messages / 2 participants
[nested] [flat]
* date array
@ 2006-04-23 12:55 A. R. Van Hook <hook@lake-lotawana.mo.us>
0 siblings, 1 reply; 4+ messages in thread
From: A. R. Van Hook @ 2006-04-23 12:55 UTC (permalink / raw)
To: pgsql-sql
How do you add null values to a date array?
update dattable set insDate = '{04/12/2006,'null'} <-- doesn't work
update dattable set insDate= '{04/12/2006,null}' <-- doesn't work
update dattable set insDate= '{04/12/2006,''}' <-- doesn't work
the table field is defined as insDate date[]
thanks
--
Arthur R. Van Hook
Mayor
The City of Lake Lotawana
hook@lake-lotawana.mo.us
(816) 578-4704 - Home
(816) 578-4215 - City
(816) 564-0769 - Cell
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: date array
@ 2006-04-23 16:36 Bruno Wolff III <bruno@wolff.to>
parent: A. R. Van Hook <hook@lake-lotawana.mo.us>
0 siblings, 1 reply; 4+ messages in thread
From: Bruno Wolff III @ 2006-04-23 16:36 UTC (permalink / raw)
To: A. R. Van Hook <hook@lake-lotawana.mo.us>; +Cc: pgsql-sql
On Sun, Apr 23, 2006 at 07:55:54 -0500,
"A. R. Van Hook" <hook@lake-lotawana.mo.us> wrote:
> How do you add null values to a date array?
>
> update dattable set insDate= '{04/12/2006,null}' <-- doesn't work
That is the correct format. However, I think that only works in HEAD
(what will become 8.2 in about 6 months).
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: date array
@ 2006-04-24 03:37 Bruno Wolff III <bruno@wolff.to>
parent: Bruno Wolff III <bruno@wolff.to>
0 siblings, 1 reply; 4+ messages in thread
From: Bruno Wolff III @ 2006-04-24 03:37 UTC (permalink / raw)
To: A. R. Van Hook <hook@lake-lotawana.mo.us>; +Cc: pgsql-sql
Please keep responses copied to the list. This both helps other people with
similar questions by getting the discussion in the archives and helps you
by letting other people see your additional questions.
On Sun, Apr 23, 2006 at 13:21:49 -0500,
"A. R. Van Hook" <hook@lake-lotawana.mo.us> wrote:
> I am running 8.1.2, what can I do in the mean time?
You could build from source using HEAD. (This is probably not a good idea for
a production system.)
You could restructure your data model to not use arrays. (You probably
shouldn't be using them anyway. Arrays should be used for things that are
naturally arrays (e.g. vectors) and I would be surprised if this was the
case when you are storing dates.)
Also note that 8.1.3 is out and 8.1.4 will probably be out soon, so you
should be looking to upgrade in any case.
>
>
> thanks
>
> Bruno Wolff III wrote:
>
> >On Sun, Apr 23, 2006 at 07:55:54 -0500,
> > "A. R. Van Hook" <hook@lake-lotawana.mo.us> wrote:
> >
> >
> >>How do you add null values to a date array?
> >>
> >>update dattable set insDate= '{04/12/2006,null}' <-- doesn't work
> >>
> >>
> >
> >That is the correct format. However, I think that only works in HEAD
> >(what will become 8.2 in about 6 months).
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: date array
@ 2006-04-24 20:37 A. R. Van Hook <hook@lake-lotawana.mo.us>
parent: Bruno Wolff III <bruno@wolff.to>
0 siblings, 0 replies; 4+ messages in thread
From: A. R. Van Hook @ 2006-04-24 20:37 UTC (permalink / raw)
To: Bruno Wolff III <bruno@wolff.to>; +Cc: pgsql-sql
While down loading 8.1.3, I tried the following:
update pf_inspectionsBld set insdate[0] = current_date
update pf_inspectionsBld set insdate[1] = current_date
update pf_inspectionsBld set insdate[2] = current_date
update pf_inspectionsBld set insdate[3] = current_date
update pf_inspectionsBld set insdate[4] = current_date + 1
select * from pf_inspectionsBld
A-2 | 1793 |
[0:4]={04/24/2006,04/24/2006,04/24/2006,04/24/2006,04/25/2006}
yet if I try
update pr_inspectionsbld set inspdate[3] = null
then
select * from pf_inspectionsBld
A-2 | 1793 |
[0:4]={04/24/2006,04/24/2006,04/24/2006,04/24/2006,04/25/2006}
i.e. no error and no change
what am I missing??
thanks
Bruno Wolff III wrote:
>Please keep responses copied to the list. This both helps other people with
>similar questions by getting the discussion in the archives and helps you
>by letting other people see your additional questions.
>
>On Sun, Apr 23, 2006 at 13:21:49 -0500,
> "A. R. Van Hook" <hook@lake-lotawana.mo.us> wrote:
>
>
>>I am running 8.1.2, what can I do in the mean time?
>>
>>
>
>You could build from source using HEAD. (This is probably not a good idea for
>a production system.)
>You could restructure your data model to not use arrays. (You probably
>shouldn't be using them anyway. Arrays should be used for things that are
>naturally arrays (e.g. vectors) and I would be surprised if this was the
>case when you are storing dates.)
>
>Also note that 8.1.3 is out and 8.1.4 will probably be out soon, so you
>should be looking to upgrade in any case.
>
>
>
>>thanks
>>
>>Bruno Wolff III wrote:
>>
>>
>>
>>>On Sun, Apr 23, 2006 at 07:55:54 -0500,
>>>"A. R. Van Hook" <hook@lake-lotawana.mo.us> wrote:
>>>
>>>
>>>
>>>
>>>>How do you add null values to a date array?
>>>>
>>>>update dattable set insDate= '{04/12/2006,null}' <-- doesn't work
>>>>
>>>>
>>>>
>>>>
>>>That is the correct format. However, I think that only works in HEAD
>>>(what will become 8.2 in about 6 months).
>>>
>>>
>
>---------------------------(end of broadcast)---------------------------
>TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>
>
--
Arthur R. Van Hook
Mayor
The City of Lake Lotawana
hook@lake-lotawana.mo.us
(816) 578-4704 - Home
(816) 578-4215 - City
(816) 564-0769 - Cell
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2006-04-24 20:37 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-04-23 12:55 date array A. R. Van Hook <hook@lake-lotawana.mo.us>
2006-04-23 16:36 ` Bruno Wolff III <bruno@wolff.to>
2006-04-24 03:37 ` Bruno Wolff III <bruno@wolff.to>
2006-04-24 20:37 ` A. R. Van Hook <hook@lake-lotawana.mo.us>
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