Friday, September 19, 2008

Re: [NOVICE] Moving data from one set of tables to another?

Yes, I have been deleting them as I go. I thought about running one pass
to move the data over and a second one to then delete the records. The
data in two of the tables is only loosely linked to the data in the
first by the value in one column, and I was concerned about how to know
where to restart the process if it stopped and I had to restart it
later. Deleting the three rows after the database reported successfully
writing the three new ones seemed like a good idea at the time. I don't
want to stop the process now, but I'll look at having the program keep
track of its progress and then go back and delete the old data when it's
done.

And yes, I do have a complete backup of the data from before I started
any of this. I can easily go back to where I was and try again or tweak
the process as needed. The database tuning is a problem I think we have
from before this procedure and I'll have to look at again after this
data is moved around.

Howard

Carol Walter wrote:
> Database tuning can really be an issue. I have a development copy and
> a production copy of most of my databases. They are on two different
> machines. The databases used to tuned the same way, however one of
> the machines has more processing power and one has more memory. When
> we retuned the databases to take advantage of the machines strong
> points, it decreased the time it took to run some queries by 400%.
>
> Carol
>
> P.S. If I understand your process, and your deleting the records as
> you go, that would make me really nervous. As soon as you start, you
> no longer have an intact table that has all the data in it. While
> modern databases engines do a lot to protect your data, there is
> always some quirk that can happen. If you have enough space, you
> might consider running the delete after the tables are created.
>
>
> On Sep 19, 2008, at 11:07 AM, Howard Eglowstein wrote:
>
>> There are a lot of issues at work here. The speed of the machine, the
>> rest of the machine's workload, the database configuration, etc. This
>> machine is about 3 years old and not as fast as a test machine I have
>> at my desk. It's also running three web services and accepting new
>> data into the current year's tables at the rate of one set of rows
>> every few seconds. The database when I started didn't have any
>> indices applied. I indexed a few columns which seemed to help
>> tremendously (a factor of 10 at least) and perhaps a few more might
>> help.
>>
>> Considering that searching the tables now with the data split into 3
>> rows takes a minute or more to search the whole database, I suspect
>> that there's still organizational issues that could be addressed to
>> speed up all PG operations. I'm far more concerned with robustness
>> and I'm not too keen on trying too many experiments until I get the
>> data broken up and backed up again.
>>
>> I doubt this machine could perform 7 SQL operations on 1.5 million
>> rows in each of 3 tables in a few seconds or minutes on a good day,
>> with the wind, rolling down hill. I'd like to be proven wrong though...
>>
>> Howard
>>
>> Sean Davis wrote:
>>> On Fri, Sep 19, 2008 at 10:48 AM, Howard Eglowstein
>>> <howard@yankeescientific.com> wrote:
>>>
>>>> Absolutely true, and if the data weren't stored on the same machine
>>>> which is
>>>> running the client, I would have worked harder to combine
>>>> statements. In
>>>> this case though, the server and the data are on the same machine
>>>> and the
>>>> client application doing the SELECT, INSERT and DELETEs is also on
>>>> the same
>>>> machine.
>>>>
>>>> I'd like to see how to have done this with combined statements if I
>>>> ever
>>>> have to do it again in a different setup, but it is working well
>>>> now. It's
>>>> moved about 1/2 million records so far since last night.
>>>>
>>>
>>> So the 150ms was per row? Not to belabor the point, but I have done
>>> this with tables with tens-of-millions of rows in the space of seconds
>>> to minutes (for the entire move, not per row), depending on the exact
>>> details of the table(s). No overnight involved. The network is one
>>> issue (which you have avoided by being local), but the encoding and
>>> decoding overhead to go to a client is another one that is entirely
>>> avoided. When you have some free time, do benchmark, as I think the
>>> difference could be substantial.
>>>
>>> Sean
>>>
>>>
>>>> Sean Davis wrote:
>>>>
>>>>> On Fri, Sep 19, 2008 at 7:42 AM, Howard Eglowstein
>>>>> <howard@yankeescientific.com> wrote:
>>>>>
>>>>>
>>>>>> So you'd agree then that I'll need 7 SQL statements but that I could
>>>>>> stack
>>>>>> the INSERT and the first SELECT if I wanted to? Cool. That's what
>>>>>> I ended
>>>>>> up
>>>>>> with in C code and it's working pretty well. I did some indexing
>>>>>> on the
>>>>>> database and got the whole transaction down to about 150ms for the
>>>>>> sequence.
>>>>>> I guess that's as good as it's going to get.
>>>>>>
>>>>>>
>>>>> Keep in mind that the INSERT [...] SELECT [...] is done server-side,
>>>>> so the data never goes over the wire to the client. This is very
>>>>> different than doing the select, accumulating the data, and then
>>>>> doing
>>>>> the insert and is likely to be much faster, relatively. 150ms is
>>>>> already pretty fast, but the principle of doing as much on the server
>>>>> as possible is an important one when looking for efficiency,
>>>>> especially when data sizes are large.
>>>>>
>>>>> Glad to hear that it is working.
>>>>>
>>>>> Sean
>>>>>
>>>>>
>>>>>
>>>>>> Sean Davis wrote:
>>>>>>
>>>>>>
>>>>>>> On Thu, Sep 18, 2008 at 7:28 PM, Howard Eglowstein
>>>>>>> <howard@yankeescientific.com> wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> What confuses me is that I need to do the one select with all
>>>>>>>> three
>>>>>>>> tables
>>>>>>>> and then do three inserts, no? The results is that the 150
>>>>>>>> fields I get
>>>>>>>> back
>>>>>>>> from the select have to be split into 3 groups of 50 fields
>>>>>>>> each and
>>>>>>>> then
>>>>>>>> written into three tables.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> You do the insert part of the command three times, once for each
>>>>>>> new
>>>>>>> table, so three separate SQL statements. The select remains
>>>>>>> basically
>>>>>>> the same for all three, with only the column selection changing
>>>>>>> (data_a.* when inserting into new_a, data_b.* when inserting into
>>>>>>> new_b, etc.). Just leave the ids the same as in the first set of
>>>>>>> tables. There isn't a need to change them in nearly every
>>>>>>> case. If
>>>>>>> you need to add a new ID column, you can do that as a serial
>>>>>>> column in
>>>>>>> the new tables, but I would stick to the original IDs, if possible.
>>>>>>>
>>>>>>> Sean
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> What you're suggesting is that there is some statement which
>>>>>>>> could do
>>>>>>>> the
>>>>>>>> select and the three inserts at once?
>>>>>>>>
>>>>>>>> Howard
>>>>>>>>
>>>>>>>> Sean Davis wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> You might want to look at insert into ... select ...
>>>>>>>>>
>>>>>>>>> You should be able to do this with 1 query per new table (+ the
>>>>>>>>> deletes, obviously). For a few thousand records, I would
>>>>>>>>> expect that
>>>>>>>>> the entire process might take a few seconds.
>>>>>>>>>
>>>>>>>>> Sean
>>>>>>>>>
>>>>>>>>> On Thu, Sep 18, 2008 at 6:39 PM, Howard Eglowstein
>>>>>>>>> <howard@yankeescientific.com> wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Somewhat empty, yes. The single set of 'data_' tables contains 3
>>>>>>>>>> years
>>>>>>>>>> worth
>>>>>>>>>> of data. I want to move 2 years worth out into the 'new_'
>>>>>>>>>> tables.
>>>>>>>>>> When
>>>>>>>>>> I'm
>>>>>>>>>> done, there will still be 1 year's worth of data left in the
>>>>>>>>>> original
>>>>>>>>>> table.
>>>>>>>>>>
>>>>>>>>>> Howard
>>>>>>>>>>
>>>>>>>>>> Carol Walter wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> What do you want for your end product? Are the old tables
>>>>>>>>>>> empty
>>>>>>>>>>> after
>>>>>>>>>>> you
>>>>>>>>>>> put the data into the new tables?
>>>>>>>>>>>
>>>>>>>>>>> Carol
>>>>>>>>>>>
>>>>>>>>>>> On Sep 18, 2008, at 3:02 PM, Howard Eglowstein wrote:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> I have three tables called 'data_a', 'data_b' and 'data_c'
>>>>>>>>>>>> which
>>>>>>>>>>>> each
>>>>>>>>>>>> have 50 columns. One of the columns in each is 'id' and is
>>>>>>>>>>>> used to
>>>>>>>>>>>> keep
>>>>>>>>>>>> track of which data in data_b and data_c corresponds to a
>>>>>>>>>>>> row in
>>>>>>>>>>>> data_a. If
>>>>>>>>>>>> I want to get all of the data in all 150 fields for this
>>>>>>>>>>>> month (for
>>>>>>>>>>>> example), I can get it with:
>>>>>>>>>>>>
>>>>>>>>>>>> select * from (data_a, data_b, data_c) where
>>>>>>>>>>>> data_a.id=data_b.id
>>>>>>>>>>>> AND
>>>>>>>>>>>> data_a.id = data_c.id AND timestamp >= '2008-09-01
>>>>>>>>>>>> 00:00:00' and
>>>>>>>>>>>> timestamp
>>>>>>>>>>>> <= '2008-09-30 23:59:59'
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>>> What I need to do is execute this search which might return
>>>>>>>>>>>> several
>>>>>>>>>>>> thousand rows and write the same structure into 'new_a',
>>>>>>>>>>>> 'new_b'
>>>>>>>>>>>> and
>>>>>>>>>>>> 'new_c'. What i'm doing now in a C program is executing the
>>>>>>>>>>>> search
>>>>>>>>>>>> above.
>>>>>>>>>>>> Then I execute:
>>>>>>>>>>>>
>>>>>>>>>>>> INSERT INTO data_a (timestamp, field1, field2 ...[imagine
>>>>>>>>>>>> 50 of
>>>>>>>>>>>> them])
>>>>>>>>>>>> VALUES ('2008-09-01 00:00:00', 'ABC', 'DEF', ...);
>>>>>>>>>>>> Get the ID that was assigned to this row since 'id' is a
>>>>>>>>>>>> serial
>>>>>>>>>>>> field
>>>>>>>>>>>> and
>>>>>>>>>>>> the number is assigned sequentially. Say it comes back as '1'.
>>>>>>>>>>>> INSERT INTO data_b (id, field1, field2 ...[imagine 50 of
>>>>>>>>>>>> them])
>>>>>>>>>>>> VALUES
>>>>>>>>>>>> ('1', 'ABC', 'DEF', ...);
>>>>>>>>>>>> INSERT INTO data_c (id, field1, field2 ...[imagine 50 of
>>>>>>>>>>>> them])
>>>>>>>>>>>> VALUES
>>>>>>>>>>>> ('1', 'ABC', 'DEF', ...);
>>>>>>>>>>>>
>>>>>>>>>>>> That moves a copy of the three rows of data form the three
>>>>>>>>>>>> tables
>>>>>>>>>>>> into
>>>>>>>>>>>> the three separate new tables.
>>>>>>>>>>>> From the original group of tables, the id for these rows
>>>>>>>>>>>> was, let's
>>>>>>>>>>>> say,
>>>>>>>>>>>> '1234'. Then I execute:
>>>>>>>>>>>>
>>>>>>>>>>>> DELETE FROM data_a where id='1234';
>>>>>>>>>>>> DELETE FROM data_b where id='1234';
>>>>>>>>>>>> DELETE FROM data_c where id='1234';
>>>>>>>>>>>>
>>>>>>>>>>>> That deletes the old data.
>>>>>>>>>>>>
>>>>>>>>>>>> This works fine and gives me exactly what I wanted, but is
>>>>>>>>>>>> there a
>>>>>>>>>>>> better
>>>>>>>>>>>> way? This is 7 SQL calls and it takes about 3 seconds per
>>>>>>>>>>>> moved
>>>>>>>>>>>> record
>>>>>>>>>>>> on
>>>>>>>>>>>> our Linux box.
>>>>>>>>>>>>
>>>>>>>>>>>> Any thoughts or suggestions would be appreciated.
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>
>>>>>>>>>>>> Howard
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>> Sent via pgsql-novice mailing list
>>>>>>>>>>>> (pgsql-novice@postgresql.org)
>>>>>>>>>>>> To make changes to your subscription:
>>>>>>>>>>>> http://www.postgresql.org/mailpref/pgsql-novice
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>> ------------------------------------------------------------------------
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> No virus found in this incoming message.
>>>>>>>>>>> Checked by AVG - http://www.avg.com Version: 8.0.169 / Virus
>>>>>>>>>>> Database:
>>>>>>>>>>> 270.6.21/1678 - Release Date: 9/18/2008 9:01 AM
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
>>>>>>>>>> To make changes to your subscription:
>>>>>>>>>> http://www.postgresql.org/mailpref/pgsql-novice
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> ------------------------------------------------------------------------
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> No virus found in this incoming message.
>>>>>>>>> Checked by AVG - http://www.avg.com Version: 8.0.169 / Virus
>>>>>>>>> Database:
>>>>>>>>> 270.6.21/1678 - Release Date: 9/18/2008 9:01 AM
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>> ------------------------------------------------------------------------
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> No virus found in this incoming message.
>>>>>>> Checked by AVG - http://www.avg.com Version: 8.0.169 / Virus
>>>>>>> Database:
>>>>>>> 270.7.0/1679 - Release Date: 9/18/2008 5:03 PM
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>>
>>>>>
>>>>> No virus found in this incoming message.
>>>>> Checked by AVG - http://www.avg.com Version: 8.0.169 / Virus
>>>>> Database:
>>>>> 270.7.0/1679 - Release Date: 9/18/2008 5:03 PM
>>>>>
>>>>>
>>>>>
>>> >
>>> ------------------------------------------------------------------------
>>>
>>>
>>>
>>> No virus found in this incoming message.
>>> Checked by AVG - http://www.avg.com Version: 8.0.169 / Virus
>>> Database: 270.7.0/1679 - Release Date: 9/18/2008 5:03 PM
>>>
>>>
>>
>>
>> --
>> Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-novice
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com
> Version: 8.0.169 / Virus Database: 270.7.0/1679 - Release Date: 9/18/2008 5:03 PM
>
>


--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice

Re: [GENERAL] how to return the first record from the sorted records which may have duplicated value.

--- On Fri, 9/19/08, Yi Zhao <yi.zhao@alibaba-inc.com> wrote:

> From: Yi Zhao <yi.zhao@alibaba-inc.com>
> Subject: [GENERAL] how to return the first record from the sorted records which may have duplicated value.
> To: "pgsql-general" <pgsql-general@postgresql.org>
> Date: Friday, September 19, 2008, 8:51 AM
> hi all:
> I have a table with columns(>2) named "query",
> "pop", "dfk".
> what I want is:
> when I do some select, if the column "query" in
> result records have
> duplicate value, I only want the record which have the
> maximum value of
> the "pop".
>
> for example, the content of table:
> query pop dfk
> -----------------------
> abc 30 1 --max
> foo 20 lk --max
> def 16 kj --max
> foo 15 fk --discard
> abc 10 2 --discard
> bar 8 are --max
>
> the result should be:
> query pop dfk
> -----------------------
> abc 30 1
> foo 20 lk
> def 16 kj
> bar 8 are
>
> now, I do it like this(plpgsql)
> ------------------------------------
> declare hq := ''::hstore;
> begin
> for rc in execute 'select * from test order by pop
> desc' loop
> if not defined(hq, rc.query) then
> hq := hq || (rc.query => '1')::hstore;
> return next rc;
> end if;
> end loop;
> -----------------------------------
> language sql/plpgsql will be ok.
>
> ps: I try to use "group by" or "max"
> function, because of the
> multi-columns(more than 2), I failed.
>
> thanks,
> any answer is appreciated.
>
> regards,
>


this query work for me....


select distinct max(pop),query from test
group by query


please reply your results

thanks...

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] setting Postgres client

Markova, Nina wrote:
>
> Thanks Richard.
>
>
> I specified the host IP ( I use the default 5432 port), got error:
> psql: could not connect to server: Connection refused
> Is the server running on host "192.168.XX.XXX" and accepting
> TCP/IP connections on port 5432?
>
> The only tcp lines in my postgres.conf are
> #tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;
> # 0 selects the system default
> #tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;
> # 0 selects the system default
> #tcp_keepalives_count = 0 # TCP_KEEPCNT;
> # 0 selects the system default
> Should I change something here?

Check "listen_addresses" and "port" look OK. You're probably only
listening to localhost.

You can test by telnet-ing to port 5432 or using lsof / netstat to see
what connections you have open in that zone.

--
Richard Huxton
Archonet Ltd

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] How to change log file language?

On Friday 19. September 2008, Rainer Bauer wrote:

>I installed 8.3.3 on an english WinXP. The database cluster was
> initialized with server encoding UTF8 and the locale was set to
> 'German, Germany'.
>
>Now all messages in the log and everywhere else are showing up in
> German (as expected). However I want to see those messages in
> English. I tried to alter lc_messages in the postgresql.conf file (
> '', 'C' and 'English_United States'), but this seems to have no
> effect (yes, I restarted the server).

I don't know how this is handled in Windows, but on a Linux computer you
can enter the directory /usr/local/share/locale/de/LC_MESSAGES/ and
just rename or delete the file psql.mo.

I fixed the issue permanently on my Gentoo system by disabling nls
support for PostgreSQL. I hate localized messages. They are
distracting, hard to figure out, or even downright silly, and you can't
do efficient searches on Google in problem situations.
--
Leif Biberg Kristensen | Registered Linux User #338009
Me And My Database: http://solumslekt.org/blog/

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [NOVICE] Moving data from one set of tables to another?

Database tuning can really be an issue. I have a development copy
and a production copy of most of my databases. They are on two
different machines. The databases used to tuned the same way,
however one of the machines has more processing power and one has
more memory. When we retuned the databases to take advantage of the
machines strong points, it decreased the time it took to run some
queries by 400%.

Carol

P.S. If I understand your process, and your deleting the records as
you go, that would make me really nervous. As soon as you start, you
no longer have an intact table that has all the data in it. While
modern databases engines do a lot to protect your data, there is
always some quirk that can happen. If you have enough space, you
might consider running the delete after the tables are created.


On Sep 19, 2008, at 11:07 AM, Howard Eglowstein wrote:

> There are a lot of issues at work here. The speed of the machine,
> the rest of the machine's workload, the database configuration,
> etc. This machine is about 3 years old and not as fast as a test
> machine I have at my desk. It's also running three web services and
> accepting new data into the current year's tables at the rate of
> one set of rows every few seconds. The database when I started
> didn't have any indices applied. I indexed a few columns which
> seemed to help tremendously (a factor of 10 at least) and perhaps a
> few more might help.
>
> Considering that searching the tables now with the data split into
> 3 rows takes a minute or more to search the whole database, I
> suspect that there's still organizational issues that could be
> addressed to speed up all PG operations. I'm far more concerned
> with robustness and I'm not too keen on trying too many experiments
> until I get the data broken up and backed up again.
>
> I doubt this machine could perform 7 SQL operations on 1.5 million
> rows in each of 3 tables in a few seconds or minutes on a good day,
> with the wind, rolling down hill. I'd like to be proven wrong
> though...
>
> Howard
>
> Sean Davis wrote:
>> On Fri, Sep 19, 2008 at 10:48 AM, Howard Eglowstein
>> <howard@yankeescientific.com> wrote:
>>
>>> Absolutely true, and if the data weren't stored on the same
>>> machine which is
>>> running the client, I would have worked harder to combine
>>> statements. In
>>> this case though, the server and the data are on the same machine
>>> and the
>>> client application doing the SELECT, INSERT and DELETEs is also
>>> on the same
>>> machine.
>>>
>>> I'd like to see how to have done this with combined statements if
>>> I ever
>>> have to do it again in a different setup, but it is working well
>>> now. It's
>>> moved about 1/2 million records so far since last night.
>>>
>>
>> So the 150ms was per row? Not to belabor the point, but I have done
>> this with tables with tens-of-millions of rows in the space of
>> seconds
>> to minutes (for the entire move, not per row), depending on the exact
>> details of the table(s). No overnight involved. The network is one
>> issue (which you have avoided by being local), but the encoding and
>> decoding overhead to go to a client is another one that is entirely
>> avoided. When you have some free time, do benchmark, as I think the
>> difference could be substantial.
>>
>> Sean
>>
>>
>>> Sean Davis wrote:
>>>
>>>> On Fri, Sep 19, 2008 at 7:42 AM, Howard Eglowstein
>>>> <howard@yankeescientific.com> wrote:
>>>>
>>>>
>>>>> So you'd agree then that I'll need 7 SQL statements but that I
>>>>> could
>>>>> stack
>>>>> the INSERT and the first SELECT if I wanted to? Cool. That's
>>>>> what I ended
>>>>> up
>>>>> with in C code and it's working pretty well. I did some
>>>>> indexing on the
>>>>> database and got the whole transaction down to about 150ms for the
>>>>> sequence.
>>>>> I guess that's as good as it's going to get.
>>>>>
>>>>>
>>>> Keep in mind that the INSERT [...] SELECT [...] is done server-
>>>> side,
>>>> so the data never goes over the wire to the client. This is very
>>>> different than doing the select, accumulating the data, and then
>>>> doing
>>>> the insert and is likely to be much faster, relatively. 150ms is
>>>> already pretty fast, but the principle of doing as much on the
>>>> server
>>>> as possible is an important one when looking for efficiency,
>>>> especially when data sizes are large.
>>>>
>>>> Glad to hear that it is working.
>>>>
>>>> Sean
>>>>
>>>>
>>>>
>>>>> Sean Davis wrote:
>>>>>
>>>>>
>>>>>> On Thu, Sep 18, 2008 at 7:28 PM, Howard Eglowstein
>>>>>> <howard@yankeescientific.com> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>> What confuses me is that I need to do the one select with all
>>>>>>> three
>>>>>>> tables
>>>>>>> and then do three inserts, no? The results is that the 150
>>>>>>> fields I get
>>>>>>> back
>>>>>>> from the select have to be split into 3 groups of 50 fields
>>>>>>> each and
>>>>>>> then
>>>>>>> written into three tables.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> You do the insert part of the command three times, once for
>>>>>> each new
>>>>>> table, so three separate SQL statements. The select remains
>>>>>> basically
>>>>>> the same for all three, with only the column selection changing
>>>>>> (data_a.* when inserting into new_a, data_b.* when inserting into
>>>>>> new_b, etc.). Just leave the ids the same as in the first set of
>>>>>> tables. There isn't a need to change them in nearly every
>>>>>> case. If
>>>>>> you need to add a new ID column, you can do that as a serial
>>>>>> column in
>>>>>> the new tables, but I would stick to the original IDs, if
>>>>>> possible.
>>>>>>
>>>>>> Sean
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> What you're suggesting is that there is some statement which
>>>>>>> could do
>>>>>>> the
>>>>>>> select and the three inserts at once?
>>>>>>>
>>>>>>> Howard
>>>>>>>
>>>>>>> Sean Davis wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> You might want to look at insert into ... select ...
>>>>>>>>
>>>>>>>> You should be able to do this with 1 query per new table (+ the
>>>>>>>> deletes, obviously). For a few thousand records, I would
>>>>>>>> expect that
>>>>>>>> the entire process might take a few seconds.
>>>>>>>>
>>>>>>>> Sean
>>>>>>>>
>>>>>>>> On Thu, Sep 18, 2008 at 6:39 PM, Howard Eglowstein
>>>>>>>> <howard@yankeescientific.com> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> Somewhat empty, yes. The single set of 'data_' tables
>>>>>>>>> contains 3
>>>>>>>>> years
>>>>>>>>> worth
>>>>>>>>> of data. I want to move 2 years worth out into the 'new_'
>>>>>>>>> tables.
>>>>>>>>> When
>>>>>>>>> I'm
>>>>>>>>> done, there will still be 1 year's worth of data left in
>>>>>>>>> the original
>>>>>>>>> table.
>>>>>>>>>
>>>>>>>>> Howard
>>>>>>>>>
>>>>>>>>> Carol Walter wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> What do you want for your end product? Are the old tables
>>>>>>>>>> empty
>>>>>>>>>> after
>>>>>>>>>> you
>>>>>>>>>> put the data into the new tables?
>>>>>>>>>>
>>>>>>>>>> Carol
>>>>>>>>>>
>>>>>>>>>> On Sep 18, 2008, at 3:02 PM, Howard Eglowstein wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> I have three tables called 'data_a', 'data_b' and
>>>>>>>>>>> 'data_c' which
>>>>>>>>>>> each
>>>>>>>>>>> have 50 columns. One of the columns in each is 'id' and
>>>>>>>>>>> is used to
>>>>>>>>>>> keep
>>>>>>>>>>> track of which data in data_b and data_c corresponds to a
>>>>>>>>>>> row in
>>>>>>>>>>> data_a. If
>>>>>>>>>>> I want to get all of the data in all 150 fields for this
>>>>>>>>>>> month (for
>>>>>>>>>>> example), I can get it with:
>>>>>>>>>>>
>>>>>>>>>>> select * from (data_a, data_b, data_c) where
>>>>>>>>>>> data_a.id=data_b.id
>>>>>>>>>>> AND
>>>>>>>>>>> data_a.id = data_c.id AND timestamp >= '2008-09-01
>>>>>>>>>>> 00:00:00' and
>>>>>>>>>>> timestamp
>>>>>>>>>>> <= '2008-09-30 23:59:59'
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>
>>>>>>>>>>> What I need to do is execute this search which might
>>>>>>>>>>> return several
>>>>>>>>>>> thousand rows and write the same structure into 'new_a',
>>>>>>>>>>> 'new_b'
>>>>>>>>>>> and
>>>>>>>>>>> 'new_c'. What i'm doing now in a C program is executing
>>>>>>>>>>> the search
>>>>>>>>>>> above.
>>>>>>>>>>> Then I execute:
>>>>>>>>>>>
>>>>>>>>>>> INSERT INTO data_a (timestamp, field1, field2 ...[imagine
>>>>>>>>>>> 50 of
>>>>>>>>>>> them])
>>>>>>>>>>> VALUES ('2008-09-01 00:00:00', 'ABC', 'DEF', ...);
>>>>>>>>>>> Get the ID that was assigned to this row since 'id' is a
>>>>>>>>>>> serial
>>>>>>>>>>> field
>>>>>>>>>>> and
>>>>>>>>>>> the number is assigned sequentially. Say it comes back as
>>>>>>>>>>> '1'.
>>>>>>>>>>> INSERT INTO data_b (id, field1, field2 ...[imagine 50 of
>>>>>>>>>>> them])
>>>>>>>>>>> VALUES
>>>>>>>>>>> ('1', 'ABC', 'DEF', ...);
>>>>>>>>>>> INSERT INTO data_c (id, field1, field2 ...[imagine 50 of
>>>>>>>>>>> them])
>>>>>>>>>>> VALUES
>>>>>>>>>>> ('1', 'ABC', 'DEF', ...);
>>>>>>>>>>>
>>>>>>>>>>> That moves a copy of the three rows of data form the
>>>>>>>>>>> three tables
>>>>>>>>>>> into
>>>>>>>>>>> the three separate new tables.
>>>>>>>>>>> From the original group of tables, the id for these rows
>>>>>>>>>>> was, let's
>>>>>>>>>>> say,
>>>>>>>>>>> '1234'. Then I execute:
>>>>>>>>>>>
>>>>>>>>>>> DELETE FROM data_a where id='1234';
>>>>>>>>>>> DELETE FROM data_b where id='1234';
>>>>>>>>>>> DELETE FROM data_c where id='1234';
>>>>>>>>>>>
>>>>>>>>>>> That deletes the old data.
>>>>>>>>>>>
>>>>>>>>>>> This works fine and gives me exactly what I wanted, but
>>>>>>>>>>> is there a
>>>>>>>>>>> better
>>>>>>>>>>> way? This is 7 SQL calls and it takes about 3 seconds per
>>>>>>>>>>> moved
>>>>>>>>>>> record
>>>>>>>>>>> on
>>>>>>>>>>> our Linux box.
>>>>>>>>>>>
>>>>>>>>>>> Any thoughts or suggestions would be appreciated.
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>>
>>>>>>>>>>> Howard
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> Sent via pgsql-novice mailing list (pgsql-
>>>>>>>>>>> novice@postgresql.org)
>>>>>>>>>>> To make changes to your subscription:
>>>>>>>>>>> http://www.postgresql.org/mailpref/pgsql-novice
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>> -------------------------------------------------------------
>>>>>>>>>> -----------
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> No virus found in this incoming message.
>>>>>>>>>> Checked by AVG - http://www.avg.com Version: 8.0.169 / Virus
>>>>>>>>>> Database:
>>>>>>>>>> 270.6.21/1678 - Release Date: 9/18/2008 9:01 AM
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Sent via pgsql-novice mailing list (pgsql-
>>>>>>>>> novice@postgresql.org)
>>>>>>>>> To make changes to your subscription:
>>>>>>>>> http://www.postgresql.org/mailpref/pgsql-novice
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------
>>>>>>>> ---------
>>>>>>>>
>>>>>>>>
>>>>>>>> No virus found in this incoming message.
>>>>>>>> Checked by AVG - http://www.avg.com Version: 8.0.169 / Virus
>>>>>>>> Database:
>>>>>>>> 270.6.21/1678 - Release Date: 9/18/2008 9:01 AM
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> -----------------------------------------------------------------
>>>>>> -------
>>>>>>
>>>>>>
>>>>>> No virus found in this incoming message.
>>>>>> Checked by AVG - http://www.avg.com Version: 8.0.169 / Virus
>>>>>> Database:
>>>>>> 270.7.0/1679 - Release Date: 9/18/2008 5:03 PM
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>> -------------------------------------------------------------------
>>>> -----
>>>>
>>>>
>>>> No virus found in this incoming message.
>>>> Checked by AVG - http://www.avg.com Version: 8.0.169 / Virus
>>>> Database:
>>>> 270.7.0/1679 - Release Date: 9/18/2008 5:03 PM
>>>>
>>>>
>>>>
>> >
>> ---------------------------------------------------------------------
>> ---
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG - http://www.avg.com Version: 8.0.169 / Virus
>> Database: 270.7.0/1679 - Release Date: 9/18/2008 5:03 PM
>>
>>
>
>
> --
> Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice


--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice

Re: [pgadmin-hackers] Dialogue issue

On Thu, Sep 18, 2008 at 11:02 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
>> Certainly better - I think it perhaps needs the same spacing added
>> again though? What do you think?
>>
>
> Yes, this is much better. See attached patch.

Yup - I've tweaked it a little more (put the checkbox under the
password box) and committed. Feel free to tweak some more if you don't
like what I did :-)


--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

[pgadmin-hackers] SVN Commit by dpage: r7485 - trunk/pgadmin3/pgadmin/ui

Author: dpage

Date: 2008-09-19 16:35:59 +0100 (Fri, 19 Sep 2008)

New Revision: 7485

Revision summary: http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/?rev=7485&view=rev

Log:
Tweak dlgConnect layout.

Modified:
trunk/pgadmin3/pgadmin/ui/dlgConnect.xrc

--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

Re: [HACKERS] Proposal of SE-PostgreSQL patches (for CommitFest:Sep)

> [2] Make a new implementation of OS-independent fine grained access control
>
> If it is really really necessary, I may try to implement a new separated
> fine-grained access control mechanism due to the CommitFest:Nov.
> However, we don't have enough days to develop one more new feature from
> the scratch by the deadline.

+1.

...Robert

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Thursday, September 18, 2008

[GENERAL] Pg COnference: Call for Lightning Talks

While recently seeking feedback on the conference schedule from Josh
Berkus and David Fetter I was asked, "Are there going to be lightning
talks?". To which I replied, "What?".

I know of lightning talks; in a similar manage of how I know of the
existence of competitors to PostgreSQL. They are there in the
background fog of consciousness while posing no perceivable threat but
still trying to maintain their significance.

The threat here of course is that West won't have lightning talks. So
let's solve that threat now! Enter the call for lightning talks.
Lightning talks are 5 minute, micro talks on any topic of any regard as
long as it is somehow related to PostgreSQL (Pythoners I am calling to
you). If you have something you are willing to stand in front of people
for no more than 5 minutes (or you will be gonged) and talk about this
is your chance.

http://www.pgcon.us/west08/talk_submission/

Sincerely,

Joshua D. Drake

--
The PostgreSQL Company since 1997: http://www.commandprompt.com/
PostgreSQL Community Conference: http://www.postgresqlconference.org/
United States PostgreSQL Association: http://www.postgresql.us/
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[pgsql-advocacy] Pg Conference: Call for Lightning talks

While recently seeking feedback on the conference schedule from Josh
Berkus and David Fetter I was asked, "Are there going to be lightning
talks?". To which I replied, "What?".

I know of lightning talks; in a similar manage of how I know of the
existence of competitors to PostgreSQL. They are there in the
background fog of consciousness while posing no perceivable threat but
still trying to maintain their significance.

The threat here of course is that West won't have lightning talks. So
let's solve that threat now! Enter the call for lightning talks.
Lightning talks are 5 minute, micro talks on any topic of any regard as
long as it is somehow related to PostgreSQL (Pythoners I am calling to
you). If you have something you are willing to stand in front of people
for no more than 5 minutes (or you will be gonged) and talk about this
is your chance.

http://www.pgcon.us/west08/talk_submission/

Sincerely,

Joshua D. Drake

--
The PostgreSQL Company since 1997: http://www.commandprompt.com/
PostgreSQL Community Conference: http://www.postgresqlconference.org/
United States PostgreSQL Association: http://www.postgresql.us/
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate

--
Sent via pgsql-advocacy mailing list (pgsql-advocacy@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-advocacy

[pgus-general] Pg Conference: Call for Lightning Talks

While recently seeking feedback on the conference schedule from Josh
Berkus and David Fetter I was asked, "Are there going to be lightning
talks?". To which I replied, "What?".

I know of lightning talks; in a similar manage of how I know of the
existence of competitors to PostgreSQL. They are there in the
background fog of consciousness while posing no perceivable threat but
still trying to maintain their significance.

The threat here of course is that West won't have lightning talks. So
let's solve that threat now! Enter the call for lightning talks.
Lightning talks are 5 minute, micro talks on any topic of any regard as
long as it is somehow related to PostgreSQL (Pythoners I am calling to
you). If you have something you are willing to stand in front of people
for no more than 5 minutes (or you will be gonged) and talk about this
is your chance.

http://www.pgcon.us/west08/talk_submission/

Sincerely,

Joshua D. Drake


--
The PostgreSQL Company since 1997: http://www.commandprompt.com/
PostgreSQL Community Conference: http://www.postgresqlconference.org/
United States PostgreSQL Association: http://www.postgresql.us/
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate

--
Sent via pgus-general mailing list (pgus-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgus-general

[ODBC] compiling odbc

I am attempting to compile and install psqlodbc-08.03.0200 on my Mac Pro running Leopard.
Here is what I get:
client-66-xxx-17-x14:psqlodbc-08.03.0200 brent1a$ sudo ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for pg_config... no
configure: error: pg_config not found (set PG_CONFIG environment variable)

How do I fix "configure: error: pg_config not found (set PG_CONFIG environment variable)"
(I'm relatively new to most of this?
thanks
-B

Re: [pgsql-es-ayuda] Hola

Hola gente

--- El jue 18-sep-08, Gunnar Wolf <gwolf@gwolf.org> escribió:

> De: Gunnar Wolf <gwolf@gwolf.org>
> Asunto: Re: [pgsql-es-ayuda] Hola
> Para: "marcelo Cortez" <jmdc_marcelo@yahoo.com.ar>
> Cc: pgsql-es-ayuda@postgresql.org, "Danier Marante Jacas" <djacas@estudiantes.uci.cu>
> Fecha: jueves, 18 de septiembre de 2008, 1:50 pm
> marcelo Cortez dijo [Wed, Sep 17, 2008 at 10:33:15AM -0700]:
> > Hola
> >
> > Para mi el tema de las bases de datos de objetos y los
> otros metodos de mapear objetos tiene un eje de diferencia
> muy grande y conceptual
> > que termina siendo por donde pasa todo. la identidad.
> > En el paradigmade objetos esta asegurada la identidad
> todo objeto es identico a si mismo y esa identidad es
> unica,( perdon por la redundancia).
> > (...)
> > la diferencia entre mapear en una base de objetos y
> una base relacional es como si por ejemplo ,
> > todas las mañanas tomara mi auto para ir al trabajo y
> luego al llegar a casa lo desarmo todo en cajitas numeradas
> y a la mañana siguiente lo volviera a ensamblar y asi ...
> siempre ...
> > Volviendo al tema , creo que el pivot esta en la
> identidad.
>
> No exactamente. Todo objeto en un lenguaje limpiamente OO
> tiene
> también un ID. Veamos el siguiente ejemplo, en Ruby

Si pero yo me referia a que en una base de objetos no hace falta ni tiene sentido un id.
dije bien , no tiene el menor sentido. pero claro eso es dificil de digerir :( .
Lo que pasa es que los que conocemos como objetos en verdad son aproximaciones, en objetos verdaderos deberiamos hacermos la pregunta, de que clase seria el id ?..

Tampoco tienen sentido las validaciones, porque?

tengo un combobox o cualquier otra forma de presentacion de la informacion, por ejemplo seleccione una calle ...

Cuando eligen una y me devuelve el "resultado" lo que obtengo es una calle.

no un string. que sentido tiene preguntar ,,, es una callle?
tiene altura? que localidad?

no lo tiene porque YA ES .., es una calle.

del mismo modo los objetos no disponen de un campo id. en los ambientes de objetos los objetos no exponen su "id" lo tienen dentro de ellos es posible preguntar por algo "similar" al id pero en gral tiene poco sentido.
salvo en casos muy particulares y para las bases donde estos objetos se guardan no , no necesitan eso.

en las bases relacionales o sistemas de mapeos la UNICA manera de que no se desarme todo es usar el id , tiene un costo..

Hay que administrarlo.. para mi esto responde mas a razones historicas que verdaderas necesidades, en verdad crean mas problemas de los que solucionan OJO hablo del punto de vista de los objetos mapeos y bases de objetos ... desde este punto de vista lo digo.
Grandes problemas de ingenieria trae aparejado esto , y vuelvo a repetir
en objetos..

Para saber si hablamos de lo mismo cuando hablamos de objetos deberiamos ser capaces de responder estas sencillas preguntas todas afirmativamente para poder decir .. SI! es de objetos..

a) es la clase un objeto ?
b) son los procesos un objeto?
c) son los numeros objetos?
d) son todos objetos??

a) es re importante pero no me extendere sobbre ello.
b) c) son solo ejemplos de d) que es el meollo de la situacion.
leer d) pero afirmando , SI SON TODOS OBJETOS!!


si responde a todo eso si
Congratulaciones !!!! ud si esta hablando de objetos!!! :)


saludos a todos

mdc

para los amantes de los links
http://en.wikipedia.org/wiki/Gemstone_Database_Management_System
http://workshop99.ircache.net/Papers/rodriguez-abstract.html

> (estoy usando la
> consola interactiva, irb):
>
> Vamos a crear dos objetos con información aparentemente
> idéntica:
>
> >> cadena1 = "una cadena"
> => "una cadena"
> >> cadena2 = "una cadena"
> => "una cadena"
>
> Verificamos si, a nivel comparación, son iguales:
>
> >> cadena1 == cadena2
> => true
>
> Y vemos sus respectivos IDs:
>
> >> cadena1.object_id
> => 69996972347440
> >> cadena2.object_id
> => 69996972340800
>
> Entonces, claramente, estos dos objetos son iguales, mas no
> son el
> mismo objeto.
>
> ¿Cómo puedo hablar de lo mismo en un modelo
> relacional como el de
> PostgreSQL?
>
> Voy a crear una tabla muy sencilla, con solamente una
> columna, y
> poblarla de datos del mismo modo:
>
> test=# CREATE TEMP table cadena (datos text);
> CREATE TABLE
>
> solserv_test=# INSERT INTO cadena (datos) VALUES ('una
> cadena');
> INSERT 0 1
> solserv_test=# INSERT INTO cadena (datos) VALUES ('una
> cadena');
> INSERT 0 1
>
> Si consulto esta tabla, tengo -del mismo modo que en el
> ejemplo
> anterior- dos registros independientes, aunque casualmente
> idénticos
> (cosa que, obviamente, no quieres ver en una BD de
> producción ;-)
>
> test=# SELECT * from cadena;
> datos
> ------------
> una cadena
> una cadena
> (2 rows)
>
> No me meto en este momento en más detalles - Cada
> registro sigue
> siendo únic, tiene un identificador interno, tan interno
> como el
> object_id de Ruby (que en realidad no es muy utilizable
> más que para
> propósitos demostrativos para el usuario común).
>
> --
> Gunnar Wolf - gwolf@gwolf.org - (+52-55)5623-0154 /
> 1451-2244
> PGP key 1024D/8BB527AF 2001-10-23
> Fingerprint: 0C79 D2D1 2C4E 9CE4 5973 F800 D80E F35A 8BB5
> 27AF


Yahoo! Cocina
Recetas prácticas y comida saludable
http://ar.mujer.yahoo.com/cocina/
--
TIP 4: No hagas 'kill -9' a postmaster

Re: [ADMIN] Help request: how to tune performance?

Hi,

The only other thing to check is what indexes are defined for
your schema. You can look at a previous post about PostgreSQL
indexing for RT to see what we are using here at Rice. Let me
know if you have any questions.

Cheers,
Ken

On Thu, Sep 18, 2008 at 09:00:14PM +0300, Mauri Sahlberg wrote:
> Hi,
>
> Thanks for the reply and advice.
>
> Scott Marlowe kirjoitti:
>>> Version : 8.1.11 Vendor: CentOS
>>>
>>
>> So, you built it its own machine, but you didn't upgrade to at least 8.2?
>>
>>
> Now it is: 8.4devel_15092008
>
> The machine was installed by the production team from the standard CentOS
> template. I tried to adhere to the standard and installed the standard
> CentOS binary for Postgresql. I am not part of production team so I try to
> be extra careful with the "rule book".
>>
>> Please post the output of explain analyze as an attachment. explain
>> is only half the answer.
>>
>>
> I did what Kenneth Marshall suggested and edited DBIx::Searchbuilder's
> Handle/Pg.pm. I will post the explain analyze for the new query it now
> generates if it becomes necessary.
>> Possibly. explain analyze will help you identify where stats are
>> wrong. sometimes just cranking the stats target on a few columns and
>> re-analyzing gets you a noticeable performance boost. It's cheap and
>> easy.
>>
>> When the estimated and actual number of rows are fairly close, then
>> look for the slowest thing and see if an index can help.
>>
>> What have to already done to tune the install? shared_buffers,
>> work_mem, random_page_cost, effective_cache_size. Is your db bloating
>> during the day?
>>
>>
> When I upgraded to 8.4 I also checked newer Postgresql manual for the
> memory consumption and found comment by Steven Citron-Pousty and increased
> accordingly:
> - shared_buffers to 320MB
> - wal_buffers to 8MB
> - effective_cache_size to 2048MB
> - maintenance_work_mem to 384MB
>
> Sorry, I do not understand what you mean by bloating. The db size is:
> rt=# select pg_size_pretty(pg_database_size('rt'));
> pg_size_pretty
> ----------------
> 350 MB
> (1 row)
>
>> Are you running on a single SATA hard drive? How big's the database
>> directory? I'm guessing from your top output that the db is about 500
>> meg or so. it should all fit in memory.
>>
>>
> -bash-3.2$ du --si -s data
> 524M data
>
> I don't know what kind of drives there actually are. The machine is vmware
> virtual with two virtual CPU's clocking 2,33GHz, 4 GB ram, 1 GB swap. The
> disk is probably given from either MSA or from EVA. The disk shows up as
> one virtual drive and everything is on it. Filesystem is ext3 on lvm.
> Database data is on /var which is it's own volume.
>
> I have also added 5 more mason processes to the web frontend machine.
>
> For me the results look promising. Opening search builder went from 42
> seconds to 4 seconds and opening one particular long chain takes now only
> 27 seconds. But again I am not from the support team either so I do not get
> to define what is fast enough. The verdict is now in for the jury to
> decide.
>
> Thank you.
>
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: [HACKERS] FSM patch - performance test

Tom Lane wrote:
> Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
>> Zdenek Kotala wrote:
>>> My conclusion is that new implementation is about 8% slower in OLTP
>>> workload.
>
>> Thanks. That's very disappointing :-(
>
> One thing that jumped out at me is that you call FreeSpaceMapExtendRel
> every time a rel is extended by even one block. I admit I've not
> studied the data structure in any detail yet, but surely most such calls
> end up being a no-op? Seems like some attention to making a fast path
> for that case would be helpful.

Yes, most of those calls end up being no-op. Which is exactly why I
would be surprised if those made any difference. It does call
smgrnblocks(), though, which isn't completely free...

Zdenek, can you say off the top of your head whether the test was I/O
bound or CPU bound? What was the CPU utilization % during the test?

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] New FSM patch

Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> No, FANOUT^4 doesn't fit in int, good catch. Actually, FANOUTPOWERS
> table doesn't need to go that far, so that's just a leftover. It only
> needs to have DEPTH elements. However, we have the same problem if
> DEPTH==3, FANOUT^4 will not fit into int. I put a comment there.
> Ideally, the 4th element would be #iffed out, but I couldn't immediately
> figure out how to do that.

This is a "must fix" IMHO --- I don't plan to tolerate a scary compiler
warning ...

BTW, the comment about and computation of DEPTH are wrong anyway.
We support up to 2^32-1 pages, so I think the cutoff should be 1626.

I did a bit of testing and immediately got an Assert failure:

regression=# create table foo as select x from generate_series(1,100000) x;
SELECT
regression=# create index fooi on foo(x);
CREATE INDEX
regression=# delete from foo;
DELETE 100000
regression=# vacuum foo;
VACUUM
regression=# vacuum foo;
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.

The reason is that the Assert in FSM_CATEGORY_AVAIL is failing:
TRAP: FailedAssertion("!(x < 8192)", File: "freespace.c", Line: 46)
LOG: server process (PID 17691) was terminated by signal 6: Aborted

because RecordFreeIndexPage passes in BLCKSZ which is an illegal
value. Maybe use BLCKSZ-1 instead?

The scary part of that is that it gets through the regression tests ---
doesn't leave one with a warm feeling about how much of VACUUM gets
exercised by regression.

I take it the comment at the top of indexfsm.c about using one bit per
page should be recast as a possible future improvement?

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Re: [ADMIN] Help request: how to tune performance?

Hi,

Thanks for the reply and advice.

Scott Marlowe kirjoitti:
>> Version : 8.1.11 Vendor: CentOS
>>
>
> So, you built it its own machine, but you didn't upgrade to at least 8.2?
>
>
Now it is: 8.4devel_15092008

The machine was installed by the production team from the standard
CentOS template. I tried to adhere to the standard and installed the
standard CentOS binary for Postgresql. I am not part of production team
so I try to be extra careful with the "rule book".
>
> Please post the output of explain analyze as an attachment. explain
> is only half the answer.
>
>
I did what Kenneth Marshall suggested and edited DBIx::Searchbuilder's
Handle/Pg.pm. I will post the explain analyze for the new query it now
generates if it becomes necessary.
> Possibly. explain analyze will help you identify where stats are
> wrong. sometimes just cranking the stats target on a few columns and
> re-analyzing gets you a noticeable performance boost. It's cheap and
> easy.
>
> When the estimated and actual number of rows are fairly close, then
> look for the slowest thing and see if an index can help.
>
> What have to already done to tune the install? shared_buffers,
> work_mem, random_page_cost, effective_cache_size. Is your db bloating
> during the day?
>
>
When I upgraded to 8.4 I also checked newer Postgresql manual for the
memory consumption and found comment by Steven Citron-Pousty and
increased accordingly:
- shared_buffers to 320MB
- wal_buffers to 8MB
- effective_cache_size to 2048MB
- maintenance_work_mem to 384MB

Sorry, I do not understand what you mean by bloating. The db size is:
rt=# select pg_size_pretty(pg_database_size('rt'));
pg_size_pretty
----------------
350 MB
(1 row)

> Are you running on a single SATA hard drive? How big's the database
> directory? I'm guessing from your top output that the db is about 500
> meg or so. it should all fit in memory.
>
>
-bash-3.2$ du --si -s data
524M data

I don't know what kind of drives there actually are. The machine is
vmware virtual with two virtual CPU's clocking 2,33GHz, 4 GB ram, 1 GB
swap. The disk is probably given from either MSA or from EVA. The disk
shows up as one virtual drive and everything is on it. Filesystem is
ext3 on lvm. Database data is on /var which is it's own volume.

I have also added 5 more mason processes to the web frontend machine.

For me the results look promising. Opening search builder went from 42
seconds to 4 seconds and opening one particular long chain takes now
only 27 seconds. But again I am not from the support team either so I do
not get to define what is fast enough. The verdict is now in for the
jury to decide.

Thank you.


--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: [PERFORM] Why does this query write to the disk?

>>> "Nikolas Everett" <nik9000@gmail.com> wrote:

> I'm a bit confused as to why this query writes to the disk:
> SELECT count(*)
> FROM bigbigtable
> WHERE customerid IN (SELECT customerid FROM
> smallcustomertable)
> AND x !=
> 'special'
>
> AND y IS NULL
>
> It writes a whole bunch of data to the disk that has the tablespace
where
> bigbigtable lives as well as writes a little data to the main disk.
It
> looks like its is actually WAL logging these writes.

It's probably writing hint bits to improve performance of subsequent
access to the table. The issue is discussed here:

http://wiki.postgresql.org/wiki/Hint_Bits

-Kevin

--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

[BUGS] BUG #4425: cannot pg_restore from pg_dump --format=c

The following bug has been logged online:

Bug reference: 4425
Logged by: Kieran McCusker
Email address: kieran.mccusker@kwest.info
PostgreSQL version: 8.3.3
Operating system: Linux (fc9)
Description: cannot pg_restore from pg_dump --format=c
Details:

Hi

I'm trying to copy a database between two servers (both fc9).

If I do the following:-

pg_dump --format=c --username=portal --file=test.dump Portal

Create the database using:-

createdb -E utf8 --owner=portal --template postgres Portal

then:

pg_restore --dbname=Portal test.dump

The database schema is partially restored and no data added.

If I do the same thing using pg_dump --format=p and loading it using psql it
works fine. The database was originally created under fc7 (sorry can't
remember the version) Its a bit worrying as it means the previous nightly
backups are not usable.

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

[pgsql-es-ayuda] Problemas con pg_dump, mediawiki y encodings.

Hola, les escribo por un detalle que estamos teniendo a la hora de hacer restauraciones a partir de dumps de una base de datos de MediaWiki con pg_dump en PostgreSQL 8.1.11. Los dumps los hemos realizado tanto en texto plano como comprimidos, pero de ninguna forma hemos podido hacer el restore. El error que surge siempre es similar al siguiente:

ERROR:  secuencia de bytes no válida para codificación «UTF8»: 0x94

Los errores surgen principalmente al insertar datos sobre la tabla mediawiki.text, la cual contiene el código tipo MEDIAWIKI de cada página alojada en la wiki en cuestión.

Al revisar los archivos del dump, se puede observar que la mayoría de los caracteres especiales alojados en él se encuentran con el signo (�). Dentro de la wiki original se pueden ver los caracteres especiales sin ningún problema. Las BDs se encuentran con codificación UTF8, tanto la original, como la que queremos restaurar.

Cualquier ayuda que me puedan dar con respecto a esto será bastante agradecida.

Saludos, Luis Garcia.

--
Luis D. García M.

Telf: (+58) 2418662663
Cel.: (+58) 4143482018

[pgsql-es-ayuda] FW: ayuda


> > hola,
> > estoy instalando postgreSql bajo window Xp pero para ello me piden que instale un poco de componente
> > entre ellos tengo cygwin, cyipc odbc y pgAdmin III.
> > estoy en la consola de cygwin y quiero ejecutar el comando net Start ipc-daemon
> > y me da el siguiente error El servicio no esta respondiendo a la funcion de control
> >
> > Al iniciar el servicio x inicio-panel de control-herramientas administrativas-servicios me da el siguiente error
> > No se puede iniciar el servicio CygwinIPcDaemon en equipo local
> > error 1053> el servidor no ha respondido a la peticion o inicio de control en un tiempo adecuado
> >
> > Otra pregunta si instalo el cygwin, cygipc y odbc estos trabajan en consola y paAdmin con una interfaz como realaciono estos dos
> >
> > ayudenm xfa
> >
> >
> > _________________________________________________________________
> > Discover the new Windows Vista
> > http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
>
> --
> Alvaro Herrera http://www.CommandPrompt.com/
> PostgreSQL Replication, Consulting, Custom Development, 24x7 support


Connect to the next generation of MSN Messenger  Get it now!

[PERFORM] Why does this query write to the disk?

List,

I'm a bit confused as to why this query writes to the disk:
SELECT count(*)
FROM    bigbigtable
WHERE customerid IN (SELECT customerid FROM smallcustomertable)                                                        
AND x != 'special'                                                                               
AND y IS NULL 

It writes a whole bunch of data to the disk that has the tablespace where bigbigtable lives as well as writes a little data to the main disk.  It looks like its is actually WAL logging these writes.

Here is the EXPLAIN ANALYZE:
Aggregate  (cost=46520194.16..46520194.17 rows=1 width=0) (actual time=4892191.995..4892191.995 rows=1 loops=1)
  ->  Hash IN Join  (cost=58.56..46203644.01 rows=126620058 width=0) (actual time=2.938..4840349.573 rows=79815986 loops=1)
        Hash Cond: ((bigbigtable.customerid)::text = (smallcustomertable.customerid)::text)
        ->  Seq Scan on bigbigtable  (cost=0.00..43987129.60 rows=126688839 width=11) (actual time=0.011..4681248.143 rows=128087340 loops=1)
              Filter: ((y IS NULL) AND ((x)::text <> 'special'::text))
        ->  Hash  (cost=35.47..35.47 rows=1847 width=18) (actual time=2.912..2.912 rows=1847 loops=1)
              ->  Seq Scan on smallcustomertable  (cost=0.00..35.47 rows=1847 width=18) (actual time=0.006..1.301 rows=1847 loops=1)
Total runtime: 4892192.086 ms

Can someone point me to some documentation as to why this writes to disk?

Thanks,
Nik

[GENERAL] Running initdb while logged in as Administrator user (Windows)

I'm trying to develop an automated PostgreSQL installer for Windows that uses a silent install of PostgreSQL and batch scripts to initialise the database cluster (i.e. run initdb) and start/stop the db server. The install shouldn't install as a service, so initdb needs to be run manually.

The problem I'm having is that initdb cannot be run as an Administrator user, so I wrote a script that creates a new limited Windows user and I now want to run initdb using this user, but while still logged in as the Administrator user.
I've looked at using the RUNAS comand, but the user password has to be inserted manually when using this. I've also tried to pipe in the password using echo *** | RUNAS... where *** is the password, but this doesn't seem to work.

I know there are some apps out there that function as alternatives to RUNAS but some of them require licences, and I'm looking for a distributable solution.

How does the PostgreSQL installer work around this when a new limited user can be specified when installing as a service?

Thanks,
Daniel.

Re: [pgsql-es-ayuda] pregutna soporte

2008/9/18 Franz Marin <frarimava@hotmail.com>:
> buenas tardes!
>
> Alvaro cuando me dice que la DB entra en la RAM o no ... no entiendo esa
> parte, que ventajas tiene que entre o no en la RAM y como lo puedo hacer
>

Me parece que se refiere a que el tamaño total de tu db sea menor a la
cantidad de ram que tienes, si es asi todos tus datos podrian alojarse
en ram y las consultas no tendrian que acceder al disco para extraer
los datos, solo cuando moirifaras tus datos se tendria que hacer un
acceso a disco, esto de tener todos tus datos en ram te da un acceso a
los datos mucho mas rapido que accesar a disco :p


--
"Linux is for people who hate Windows, BSD is for people who love UNIX".
"Social Engineer -> Because there is no patch for human stupidity"
"The Unix Guru's View of Sex unzip ; strip ; touch ; grep ; finger ;
mount ; fsck ; more ; yes ; umount ; sleep."
"Documentation is like sex: when it is good, it is very, very good;
and when it is bad, it is better than nothing."
--
TIP 6: ¿Has buscado en los archivos de nuestra lista de correo?
http://archives.postgresql.org/pgsql-es-ayuda

Re: [JDBC] Bad Timestamp Format at 23 in 2008-09-16 18:41:00.479

On Thu, 18 Sep 2008, Warren Bell wrote:

> Caused by: Bad Timestamp Format at 23 in 2008-09-17 19:49:03.327
> at org.postgresql.jdbc2.ResultSet.getTimestamp(ResultSet.java:517)
> at org.postgresql.jdbc2.ResultSet.getTimestamp(ResultSet.java:675)
> at

This stacktrace is from a 7.2 or earlier JDBC driver, so you definitely
aren't using 8.3-603.

Kris Jurka

--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

Re: [JDBC] Bad Timestamp Format at 23 in 2008-09-16 18:41:00.479

I am using Ibatis as a object mapper and Spring as the DAO. Ibatis
assures me that Ibatis is just passing the parameters strait to the
driver without modifying them. Ibatis is logging the Insert statement as:

DEBUG [http-8080-2] - {conn-100072} Preparing Statement: INSERT
INTO receiveorder (rcv_date, rcv_po_number, rcv_invoice_number,
rcv_vendor_code, rcv_vendor_name, rcv_str_fk, rcv_usr_fk,
rcv_time_changed) values (?, ?, ?, ?, ?, ?, ?, NOW())
DEBUG [http-8080-2] - {pstm-100073} Executing Statement: INSERT
INTO receiveorder (rcv_date, rcv_po_number, rcv_invoice_number,
rcv_vendor_code, rcv_vendor_name, rcv_str_fk, rcv_usr_fk,
rcv_time_changed) values (?, ?, ?, ?, ?, ?, ?, NOW())
DEBUG [http-8080-2] - {pstm-100073} Parameters: [2008-09-17
19:55:44.774, 333, 333, 93 , American Biologics , 1, 3]
DEBUG [http-8080-2] - {pstm-100073} Types: [java.sql.Timestamp,
java.lang.String, java.lang.String, java.lang.String, java.lang.String,
java.lang.Integer, java.lang.Integer]

rcv_date is the field that is causing the problem not the NOW()
function. When this statement in executed from the Apple machine the
timestamp in the db is 2008-09-17 19:55:44.774 and when it is executed
on the Windows machine the timestamp in the db is 2008-09-17 19:55:44.77
. On the Windows machine it looses the last decimal of the milliseconds
from miliseconds to hundreths. When the Windows machine does a SELECT on
the record with the milliseconds it gives me the following exception:

DEBUG [http-8080-1] - {pstm-100294} Executing Statement: SELECT
rcv_pk, rcv_str_fk, rcv_date, rcv_po_number, rcv_invoice_number,
rcv_vendor_code, rcv_vendor_name, rcv_processed, rcv_report, rcv_usr_fk
FROM receiveorder WHERE rcv_processed = ? ORDER BY rcv_date DESC
DEBUG [http-8080-1] - {pstm-100294} Parameters: [false]
DEBUG [http-8080-1] - {pstm-100294} Types: [java.lang.Boolean]


DEBUG [http-8080-1] - {rset-100295} Result: [3737, 1, 2008-09-18
02:35:36.8, 454 , 323 ,
329 , Garden Of Life , false, false, 3, 3737]
org.springframework.jdbc.UncategorizedSQLException: SqlMapClient
operation; uncategorized SQLException for SQL []; SQL state [null];
error code [0];
--- The error occurred in
com/clarks/spanky/persistence/sqlmapdao/sql/postgres/recvOrder-postgres.xml.

--- The error occurred while applying a result map.
--- Check the RecvOrder.recvOrderWithLineItemsResult.
--- Check the result mapping for the 'recvOrderDate' property.
--- Cause: Bad Timestamp Format at 23 in 2008-09-17 19:49:03.327; nested
exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in
com/clarks/spanky/persistence/sqlmapdao/sql/postgres/recvOrder-postgres.xml.

--- The error occurred while applying a result map.
--- Check the RecvOrder.recvOrderWithLineItemsResult.
--- Check the result mapping for the 'recvOrderDate' property.
--- Cause: Bad Timestamp Format at 23 in 2008-09-17 19:49:03.327
at
org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:121)
at
org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:322)
at
org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:212)
at
org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:249)
at
org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:296)
at
com.clarks.spanky.persistence.sqlmapdao.RecvOrderSqlMapDao.getProcessedRecvOrderListWithLineItems(RecvOrderSqlMapDao.java:49)
at
com.clarks.spanky.service.ReceivingService.getProcessedRecvOrderListWithLineItems(ReceivingService.java:82)
at
com.clarks.spanky.presentation.ReceivingBean.goToOpenedReceivings(ReceivingBean.java:238)
at
com.clarks.spanky.presentation.NavRecvBean.receivingNavigation(NavRecvBean.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.clarks.struts.BeanAction.execute(BeanAction.java:123)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:856)
at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565)
at
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in
com/clarks/spanky/persistence/sqlmapdao/sql/postgres/recvOrder-postgres.xml.

--- The error occurred while applying a result map.
--- Check the RecvOrder.recvOrderWithLineItemsResult.
--- Check the result mapping for the 'recvOrderDate' property.
--- Cause: Bad Timestamp Format at 23 in 2008-09-17 19:49:03.327
at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:185)
at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:615)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:589)
at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
at
org.springframework.orm.ibatis.SqlMapClientTemplate$3.doInSqlMapClient(SqlMapClientTemplate.java:298)
at
org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:209)
... 29 more
Caused by: Bad Timestamp Format at 23 in 2008-09-17 19:49:03.327
at org.postgresql.jdbc2.ResultSet.getTimestamp(ResultSet.java:517)
at org.postgresql.jdbc2.ResultSet.getTimestamp(ResultSet.java:675)
at
org.apache.commons.dbcp.DelegatingResultSet.getTimestamp(DelegatingResultSet.java:262)
at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.ibatis.common.jdbc.logging.ResultSetLogProxy.invoke(ResultSetLogProxy.java:47)
at $Proxy4.getTimestamp(Unknown Source)
at
com.ibatis.sqlmap.engine.type.DateTypeHandler.getResult(DateTypeHandler.java:38)
at
com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getPrimitiveResultMappingValue(BasicResultMap.java:611)
at
com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getResults(BasicResultMap.java:344)
at
com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:381)
at
com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(SqlExecutor.java:301)
at
com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:190)
at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
... 35 more


Kris Jurka wrote:
>
>
> On Wed, 17 Sep 2008, Warren Bell wrote:
>
>> I have Postgresql 8.3 (PostgresPlus) running on an Apple with Tomcat
>> 6. I am using the postgresql-8.3-603.jdbc3.jar driver. My app runs
>> fine when on the apple, but when I move it over to a Windows machine
>> running Tomcat 6 that accesses the same exact database on the Apple I
>> get a "Bad Timestamp Format at 23 in 2008-09-16 18:41:00.479" error.
>
> This isn't an error that the JDBC driver produces. Can you provide a
> stacktrace to show where this error is actually generated?
>
> Kris Jurka


--
Thanks,

Warren Bell
909-645-8864
warren@clarksnutrition.com


--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc