Re: [SQL] problem converting strings to timestamps with time zone
Could you please post the exact string how you did?
Thanks
Deepak
On Thu, Apr 29, 2010 at 12:59 AM, Edward Ross wrote:
> Tom Lane wrote:
>
>> Edward Ross writes:
>>
>>> Here is a sandbox example of what I mean.
>>>
>>
>> CREATE TABLE test_0
>>> (
>>>string_value varchar(2047),
>>>timestamp_value timestamp with time zone
>>> );
>>>
>>
>> insert into test_0
>>> (string_value)
>>>values
>>> ('2010-03-12 17:06:21-0800'),
>>> ('2009-08-14 16:47:40+0500'),
>>> ('2010-03-22 22:45:59-0400');
>>>
>>
>> As expected, select * from test_0; , produces the following:
>>>
>>
>> string_valuetimestamp_value
>>> 2010-03-12 17:06:21-0800
>>> 2009-08-14 16:47:40+0500
>>> 2010-03-22 22:45:59-0400
>>>
>>
>> I would like to parse the strings into their equivalent timestamps
>>> and put them in the timestamp_value column.
>>>
>>
>> My attempt, so far, to update the table:
>>>
>>
>> update value
>>>set
>>>timestamp_value =
>>>to_timestamp(string_value, '-MM-DD HH24:MI:SS-');
>>>
>>
>> Forget to_timestamp; just cast the string to timestamptz. The
>> regular timestamp input converter will handle that format fine.
>>
>>regards, tom lane
>>
>>
> That worked great.
>
> Thanks very much,
>
> Edward Ross
>
>
> --
> Sent via pgsql-sql mailing list ([email protected])
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>
[SQL] pg_restore error - Any Idea?
Hi All, I am facing an error on executing the below command dump name: pg_dump_FcZ0.pnps_200903041201_1.2.1.0_base_testing databae name: pnqd_test $pg_restore -U postgres -p 5433 -d pnqd_test pg_dump_FcZ0.pnps_200903041201_1.2.1.0_base_testing pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry 3715; 0 0 ACL monitor postgres WARNING: errors ignored on restore: 1 I am not able to figure out this issue. Any idea guys. Thanks Deepak
Re: [SQL] [GENERAL] pg_restore error - Any Idea?
Eric, There was no change in the version, we are using postgres v8.3.5 Thanks Deepak On Sun, Mar 22, 2009 at 11:17 PM, Erik Jones wrote: > > On Mar 22, 2009, at 10:44 PM, DM wrote: > > Hi All, >> >> I am facing an error on executing the below command >> >> dump name: pg_dump_FcZ0.pnps_200903041201_1.2.1.0_base_testing >> databae name: pnqd_test >> >> $pg_restore -U postgres -p 5433 -d pnqd_test >> pg_dump_FcZ0.pnps_200903041201_1.2.1.0_base_testing >> >> pg_restore: [archiver (db)] Error while PROCESSING TOC: >> pg_restore: [archiver (db)] Error from TOC entry 3715; 0 0 ACL monitor >> postgres >> WARNING: errors ignored on restore: 1 >> >> I am not able to figure out this issue. Any idea guys. >> > > > TOC -> Table of Contents > > A dump made with pg_dump's -Fc will contain a table of contents of all of > the database objects in the dump file. Something in that is causing an > error for pg_restore. Does the version of pg_restore match up with the > version of pg_dump that you used to make the dump? > > Erik Jones, Database Administrator > Engine Yard > Support, Scalability, Reliability > 866.518.9273 x 260 > Location: US/Pacific > IRC: mage2k > > > > > >
[SQL] Can we load all database objects in memory?
Hi All, I have a database of 10GB. My Database Server has a RAM of 16GB Is there a way that I can load all the database objects to memory? Thanks for your time and taking a look at this question. Thanks Deepak
[SQL] how to set the value to the column
Hi All, I have a table test with columns name and value test table name value It has around 500 rows. I added a new column id to the table, Table test id, name, value I am not sure how to insert numbers to my column id (1-500). Thanks
Re: [SQL] how to set the value to the column
never mind i got the answer. Thanks for looking into it. - deepak On Thu, Apr 16, 2009 at 12:00 PM, DM wrote: > Hi All, > > I have a table test with columns name and value > > test table > name > value > > It has around 500 rows. > > I added a new column id to the table, > > Table test > id, > name, > value > > I am not sure how to insert numbers to my column id (1-500). > > Thanks > > >
