Re: [SQL] Database consistency after a power shortage

2010-12-16 Thread Jean-David Beyer
do not know how long it takes to do such a shutdown with postgreSQL, but it could involve stopping all new transactions from entering the system, and allowing those in process to complete. A UPS to allow 10 minutes of run-time is not normally considered too expensive. Mine will run for about an hour

Re: [SQL] subtract two dates to get the number of days

2010-07-14 Thread Jean-David Beyer
Thomas Kellerer wrote: > Jean-David Beyer wrote on 14.07.2010 14:37: >> My dates are of the form -mm-dd and such. > Storing a date as a string is never a good idea. I started this long ago, when postgreSQL did not really work very well (1998?). One version of it would not d

Re: [SQL] subtract two dates to get the number of days

2010-07-14 Thread Jean-David Beyer
allowed a date datatype where I could add, subtract, and so on. I use it in programs that do not necessarily use a database, but also in programs that do when the computations are the big part of the cpu load, as contrasted to just "gentle" massaging of existing data. - -- .~. J

Re: [SQL] Re: Efficiently determining the number of bits set in the contents of, a VARBIT field

2008-07-27 Thread Jean-David Beyer
. >> >> Allan. > > When I had to do that, in days with smaller amounts of RAM, but very long bit-vectors, I used a faster function sort-of like this: static char table[256] = { 0,1,1,2,1,2,2,3,1,. }; Then like above, but instead of the loop, n+= table[aval]; You get

Re: [SQL] Curious about wide tables.

2008-04-30 Thread Jean-David Beyer
Shane Ambler wrote: > Jean-David Beyer wrote: >> In another thread, the O.P. had a question about a large table with >> over 100 columns. Is this usual? Whenever I make a database, which is >> not often, it ends up with tables that rarely have over to columns, and >> u

[SQL] Curious about wide tables.

2008-04-27 Thread Jean-David Beyer
criticising the O.P., since I know nothing about his application, I am curious how it comes about that such a wide table is justified. -- .~. Jean-David Beyer Registered Linux User 85642. /V\ PGP-Key: 9A2FC99A Registered Machine 241939. /( )\ Shrewsbury, New Jerseyhttp

Re: [SQL] How to find double entries

2008-04-19 Thread Jean-David Beyer
parate record: U S Government Federal Aviations Administration Kennedy Airport Pilot Information Arrivals Departures We had to make it find "Pilot Arrivals" so indexing was not trivial until you figured out how to do it. But when all was said an

Re: [SQL] Check before INSERT INTO

2008-02-11 Thread Jean-David Beyer
l)? Would this not fix your problem especially if you have a SERIAL as primary key? > > I though it was possible to change the SQL string before it does the > update.. But i can't seem to find a solution for it.. Any idea ?? > -- .~. Jean-David Beyer Re

Re: [SQL] Is there anything special about pg_dump's compression?

2007-11-16 Thread Jean-David Beyer
Shane Ambler wrote: > Jean-David Beyer wrote: >>> The physical tape speed is surely the real bottleneck here, and the >>> fact that the total elapsed time is about the same both ways proves >>> that about the same number of bits went onto tape both ways. >> &

Re: [SQL] Is there anything special about pg_dump's compression?

2007-11-16 Thread Jean-David Beyer
Tom Lane wrote: > Jean-David Beyer <[EMAIL PROTECTED]> writes: >> I turned the software compression off. It took: >> 524487428 bytes (524 MB) copied, 125.394 seconds, 4.2 MB/s > >> When I let the software compression run, it uses only 30 MBytes. So whatever >>

Re: [SQL] Is there anything special about pg_dump's compression?

2007-11-15 Thread Jean-David Beyer
Andrew Sullivan wrote: > On Thu, Nov 15, 2007 at 11:05:44AM -0500, Jean-David Beyer wrote: >> Does pg_dump's compression do anything really special that it is not >> likely the tape drive already does? The drive claims 2:1 compression >> for average data (e.g., not alr

[SQL] Is there anything special about pg_dump's compression?

2007-11-15 Thread Jean-David Beyer
drive claims 2:1 compression for average data (e.g., not already compressed stuff like .jpeg files). -- .~. Jean-David Beyer Registered Linux User 85642. /V\ PGP-Key: 9A2FC99A Registered Machine 241939. /( )\ Shrewsbury, New Jerseyhttp://counter.li.org ^^-^^ 10:50:0

Re: [SQL] How to use serial variable to insert into muiti-recrods?

2007-09-06 Thread Jean-David Beyer
umber in multiple records, then you should get the serial number direct from the SEQUENCE and plug it in each tuple as you need it. - -- .~. Jean-David Beyer Registered Linux User 85642. /V\ PGP-Key: 9A2FC99A Registered Machine 241939. /( )\ Shrewsbury, New Jerseyh

Re: [SQL] Block size with pg_dump?

2007-08-27 Thread Jean-David Beyer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Bruce Momjian wrote: > Jean-David Beyer wrote: >>>>> The main question is, If I present pg_restore with a 65536-byte >>>>> blocksize >>>>> and it is expecting, e.g., 1024-bytes, will the rest of each

Re: [SQL] Block size with pg_dump?

2007-08-27 Thread Jean-David Beyer
) uses 8K blocks. > > That is true of the internal storage, but not of pg_dump's output > because it is using libpq to pull rows and output them in a stream, > meaning there is no blocking in pg_dumps output itself. > Is that true for both input and output (i.e., pg_restore

Re: [SQL] Block size with pg_dump?

2007-08-26 Thread Jean-David Beyer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Bruce Momjian wrote: > Jean-David Beyer wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> When I make a backup of a database, I put the output file directly on >> magnetic tape; i.e., my command look

[SQL] Block size with pg_dump?

2007-08-26 Thread Jean-David Beyer
I suppose to make any blocksize I want. On the way back, likewise I could pipe the tape through dd before giving it to pg_restore. Does pg_dump care what blocksize it gets? If so, what is it? - -- .~. Jean-David Beyer Registered Linux User 85642. /V\ PGP-Key: 9A2FC99A

Re: [SQL] there is already a transaction in progress ?

2007-08-18 Thread Jean-David Beyer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jean-David Beyer wrote: > It probably shows I am new to postgreSQL. I recently started running this > instead of DB2, and am converting the applications I already wrote. These > use ecpg. > > The problem I have concerns transact

[SQL] there is already a transaction in progress ?

2007-08-18 Thread Jean-David Beyer
sequences with this kind of thing: ALTER SEQUENCE company_company_id_seq RESTART WITH 1; before running the test program. -- .~. Jean-David Beyer Registered Linux User 85642. /V\ PGP-Key: 9A2FC99A Registered Machine 241939. /( )\ Shrewsbury, New Jerseyhttp://co

[SQL] Starting autovacuum in postgresql-8.1.9

2007-08-16 Thread Jean-David Beyer
t. Is it built into the server now, or is it to be found somewhere else? In particular, pgavd does not exist anywhere on my system. - -- .~. Jean-David Beyer Registered Linux User 85642. /V\ PGP-Key: 9A2FC99A Registered Machine 241939. /( )\ Shrewsbury, New Jersey

[SQL] how to download linux 7.3 image

2007-07-22 Thread Jean-David Beyer
ion of postgreSQL that will run on RHL 7.3, that might be a problem since the current versions of postgreSQL probably all demand a much newer kernel (RHL 7.3 used a 2.2 kernel, IIRC) and associated libraries. -- .~. Jean-David Beyer Registered Linux User 85642. /V\ PGP-Key: 9A

Re: [SQL] another simple SQL question

2007-06-25 Thread Jean-David Beyer
ook here: http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?tp=&arnumber=810466&isnumber=16537 for one way to do this. It explains briefly how to make a suitable index for it. -- .~. Jean-David Beyer Registered Linux User 85642. /V\ PGP-Key: 9A2FC99A Registered Mac

Re: [SQL] Embedded C++ with ecpg?

2007-06-22 Thread Jean-David Beyer
Tom Lane wrote: > Jean-David Beyer <[EMAIL PROTECTED]> writes: >> What is the current status of (pre) compiling Embedded SQL in C++ programs? > > I just asked Michael Meskes about that (had you put a support request > into Red Hat asking this?). Yes, and Red Hat's

[SQL] Embedded C++ with ecpg?

2007-06-22 Thread Jean-David Beyer
these programs in C. Red Hat seem to be on postgresql version 8.1.4 for the initial release of RHEL5, and they may have updates a little higher. -- .~. Jean-David Beyer Registered Linux User 85642. /V\ PGP-Key: 9A2FC99A Registered Machine 241939. /( )\ Shrewsbury, New J