Re: [GENERAL] Code tables, conditional foreign keys?

2009-05-23 Thread Lew
Conrad Lender wrote: I didn't intend any disrespect to Joe Celko. I have read a number of his articles, which tend to be well written and informative. Last year, when I posted to comp.databases asking for advice on whether to refactor that table, he wrote "You will have to throw it all out and st

[GENERAL] do postgresql this job for me ? (firebird user)

2009-05-23 Thread mnavahan
Hi i am firebird user But now have some problem with it and chk postgresql to migrate to it ... 1.have postgresql support online change of tables ? for example i have over 400 table in db with many relation : A: if i dont any user connect to table RR (but many user connect to other tables)

[GENERAL] Can't start service but works from command line

2009-05-23 Thread Dejan
Computer which hosted a database crashed, but I managed to save "data" folder. I copied it to another computer and pointed postgres to that folder (stopping the service first). But, the service cannot start. Progress bar just goes for awhile, and then a pop-up tells me that the service stopped.

Re: [GENERAL] Code tables, conditional foreign keys?

2009-05-23 Thread Conrad Lender
On 23/05/09 09:34, Scott Marlowe wrote: > I have a great deal of respect for Celko. I don't always agree with > everything he says, but most of it makes a lot of sense to me. I didn't intend any disrespect to Joe Celko. I have read a number of his articles, which tend to be well written and info

Re: [GENERAL] 8.3: timestamp subtraction

2009-05-23 Thread Tom Lane
=?ISO-8859-1?Q?Havasv=F6lgyi_Ott=F3?= writes: > Thanks, It's off in both 8.2 and 8.3. As was already stated, that depends on which build you're using. (And no, "the Win32 distribution on the PgSql site" is not a unique description, not even for a single PG version.) > What will be the default in

Re: [GENERAL] Excessive (?) Pg file descriptor use when partitioning

2009-05-23 Thread Tom Lane
Henry writes: > However, once I start real processing and there's lots of updates and > selects occurring, file descriptor usage (by many Pg procs) will > gleefully claw it's way up to 400k (on the busy cluster master node) > and eventually bludgeon my arbitrary 500k limit. Each Pg process

Re: [GENERAL] 8.3: timestamp subtraction

2009-05-23 Thread Havasvölgyi Ottó
Thanks, It's off in both 8.2 and 8.3. What will be the default in 8.4? Best regards, Otto 2009/5/23 Alvaro Herrera > Havasvölgyi Ottó escribió: > > I mean the Win32 distribution on the PgSql site. I always used that. > > If you want to find out whether a particular build used floating point or

Re: [GENERAL] Daylight saving time question

2009-05-23 Thread Lew
Bayless Kirtley wrote: Thanks Tom and Scott. You got me looking in the right direction. In this case the client and server are on the same machine (testing/development) and psql does return the right result. I tried all the possibilities from the java program, "show timezone", "select current_t

Re: [GENERAL] 8.3: timestamp subtraction

2009-05-23 Thread Alvaro Herrera
Havasvölgyi Ottó escribió: > I mean the Win32 distribution on the PgSql site. I always used that. If you want to find out whether a particular build used floating point or integer datetimes, issue "SHOW integer_datetimes". If it says "off", then it's floating point. -- Alvaro Herrera

Re: [GENERAL] Sql Update Sentence

2009-05-23 Thread Martijn van Oosterhout
On Sat, May 23, 2009 at 03:13:58PM -0400, mariolos wrote: > hello to all!!! i have a quiestion and problem, i need replace a value from > a field with other value, i try using this sql sentence: > > update packing_acum set corr=corr + 200) BETWEEN 26821 AND 27340 and > extract(year from fec_prod)

Re: [GENERAL] Sql Update Sentence

2009-05-23 Thread Adrian Klaver
On Saturday 23 May 2009 12:13:58 pm mariolos wrote: > hello to all!!! i have a quiestion and problem, i need replace a value from > a field with other value, i try using this sql sentence: Is this the entire actual SQL statement? If so see below. > > update packing_acum set corr=corr + 200) BETWE

Re: [GENERAL] 8.3: timestamp subtraction

2009-05-23 Thread Havasvölgyi Ottó
I mean the Win32 distribution on the PgSql site. I always used that. It would be very good if these data types were exact by default, even if that's a bit slower. Otto 2009/5/23 Christophe > > On May 23, 2009, at 10:44 AM, Havasvölgyi Ottó wrote: > > Thanks. >> I tested the standard Win32 distr

[GENERAL] Sql Update Sentence

2009-05-23 Thread mariolos
hello to all!!! i have a quiestion and problem, i need replace a value from a field with other value, i try using this sql sentence: update packing_acum set corr=corr + 200) BETWEEN 26821 AND 27340 and extract(year from fec_prod) = 2009 AND cod_packing between 2321 and 2327 but this error appear

Re: [GENERAL] 8.3: timestamp subtraction

2009-05-23 Thread Christophe
On May 23, 2009, at 10:44 AM, Havasvölgyi Ottó wrote: Thanks. I tested the standard Win32 distribution of 8.3.6. The same happens on 8.2. But on 8.0 it works. When I don't use milliseconds, then it works. Will 8.4 work fine on Win32 again? If the issue is using floating point timestamps, th

Re: [GENERAL] Asssociative Arrays: Best practices / snippets?

2009-05-23 Thread Stefan Keller
Steve, Filip: Many thanks for your patient answers and concerns. Did'nt know hstore! => Is it enough to run the hstore.sql (found in ..\8.3\share\contrib\ plus .dll) in order to install this contrib type under Windows? => What's the status of this contribution? Is it going to be still in 8.4? (el

Re: [GENERAL] 8.3: timestamp subtraction

2009-05-23 Thread Havasvölgyi Ottó
Hi, On 8.2 this comparision is also not true: select '240:0:0.3'::interval = '10 0:0:0.3'::interval; But without milliseconds it's true. Is this also because interval is represented internally as a floating point value? On 8.3 this test does not fail. Best regards, Otto 2009/5/23 Havasvölgyi

Re: [GENERAL] 8.3: timestamp subtraction

2009-05-23 Thread Havasvölgyi Ottó
Thanks. I tested the standard Win32 distribution of 8.3.6. The same happens on 8.2. But on 8.0 it works. When I don't use milliseconds, then it works. Will 8.4 work fine on Win32 again? Thanks, Otto 2009/5/23 Ludwig Kniprath > Scott Marlowe schrieb: > >> On Sat, May 23, 2009 at 7:18 AM, Chr

[GENERAL] psql Windows and variables

2009-05-23 Thread Ivan Sergio Borgonovo
I need to loop from DOS [sic] on a set of files to get them imported into a table. I noticed that psql is wrapped up in a import.bat I wrote another bat that substantially do rem import.bat FOR %%f in (pattern) do "longpathtopsql.bat" --variable csvfile=%%f -f some.sql -- some.sql \copy import

Re: [GENERAL] Asssociative Arrays: Best practices / snippets?

2009-05-23 Thread Steve Atkins
On May 23, 2009, at 2:25 AM, Stefan Keller wrote: I have a use case where the I want to put an unforeseable number of key/value pairs in a column. Now, PostgreSQL has arrays as first class types. Are there any best practices and snippets (preferrably in plpgsql) for handling key/value pairs

Re: [GENERAL] 8.3: timestamp subtraction

2009-05-23 Thread Ludwig Kniprath
Scott Marlowe schrieb: On Sat, May 23, 2009 at 7:18 AM, Christophe wrote: On May 23, 2009, at 9:13 AM, Daniel Verite wrote: I don't know why this query returns false: SELECT '20040506 070809.01'::timestamp(6) - '20010203 040506.007000'::timestamp(6) = '1188 day 3 hour 3 minute 3 se

Re: [GENERAL] 8.3: timestamp subtraction

2009-05-23 Thread Scott Marlowe
On Sat, May 23, 2009 at 7:18 AM, Christophe wrote: > > On May 23, 2009, at 9:13 AM, Daniel Verite wrote: >>> >>> I don't know why this query returns false: >>> SELECT '20040506 070809.01'::timestamp(6) - '20010203 >>> 040506.007000'::timestamp(6) = '1188 day 3 hour 3 minute 3 second 3 >>> mill

Re: [GENERAL] 8.3: timestamp subtraction

2009-05-23 Thread Christophe
On May 23, 2009, at 9:13 AM, Daniel Verite wrote: I don't know why this query returns false: SELECT '20040506 070809.01'::timestamp(6) - '20010203 040506.007000'::timestamp(6) = '1188 day 3 hour 3 minute 3 second 3 millisecond'::interval; If I just subtract the two timestamps, its result is

Re: [GENERAL] 8.3: timestamp subtraction

2009-05-23 Thread Daniel Verite
Havasvölgyi Ottó wrote: I don't know why this query returns false: SELECT '20040506 070809.01'::timestamp(6) - '20010203 040506.007000'::timestamp(6) = '1188 day 3 hour 3 minute 3 second 3 millisecond'::interval; If I just subtract the two timestamps, its result is the interval I sp

Re: [GENERAL] Aggregate Function to return most common value for a column

2009-05-23 Thread Benjamin Smith
I've used this same concept in subqueries for a very long time. Doing this allows me to "dive in" and get other values from the joined table, rather than just the thing that we're getting the most of. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "I kept looking fo

[GENERAL] 8.3: timestamp subtraction

2009-05-23 Thread Havasvölgyi Ottó
Hi, I don't know why this query returns false: SELECT '20040506 070809.01'::timestamp(6) - '20010203 040506.007000'::timestamp(6) = '1188 day 3 hour 3 minute 3 second 3 millisecond'::interval; If I just subtract the two timestamps, its result is the interval I specified. What may cause this?

Re: [GENERAL] Asssociative Arrays: Best practices / snippets?

2009-05-23 Thread Filip Rembiałkowski
2009/5/23 Stefan Keller > I have a use case where the I want to put an unforeseable number of > key/value pairs in a column. > Now, PostgreSQL has arrays as first class types. > Are there any best practices and snippets (preferrably in plpgsql) for > handling key/value pairs? > -- S. > common r

Re: [GENERAL] Asssociative Arrays: Best practices / snippets?

2009-05-23 Thread Leif B. Kristensen
On Saturday 23. May 2009, Stefan Keller wrote: >I have a use case where the I want to put an unforeseable number of >key/value pairs in a column. >Now, PostgreSQL has arrays as first class types. >Are there any best practices and snippets (preferrably in plpgsql) for >handling key/value pairs? >--

Re: [GENERAL] Code tables, conditional foreign keys?

2009-05-23 Thread Alban Hertroys
Here's an example of the value groups that were contained in the table: fax status: pending, active, sent, error department: office, accounting, it, legal, experts deadline type: official, unofficial ... Is it really advisable to put all these values into 70 separate tables with the exact

Re: [GENERAL] performance tuning on Vista problem

2009-05-23 Thread Alban Hertroys
On May 23, 2009, at 3:55 AM, Murray Richardson wrote: Hello postgres community, I am running postgresql 8.3 on Vista 64 and trying to do some performance tuning to make better use of my system resources. Anytime I make any changes to the postgresql.conf file, I cannot connect to the serv

Re: [GENERAL] duplicate rows in query

2009-05-23 Thread Alban Hertroys
On May 22, 2009, at 9:41 PM, Mark Watson wrote: Hello all, I have a perplexing problem which I cannot figure out. I have a somewhat complex query that is returning two identical rows, where only one row exists in the table. If I run a simpler query, I receive the one row as desired. ...

[GENERAL] Asssociative Arrays: Best practices / snippets?

2009-05-23 Thread Stefan Keller
I have a use case where the I want to put an unforeseable number of key/value pairs in a column. Now, PostgreSQL has arrays as first class types. Are there any best practices and snippets (preferrably in plpgsql) for handling key/value pairs? -- S.

Re: [GENERAL] Code tables, conditional foreign keys?

2009-05-23 Thread Scott Marlowe
On Sat, May 23, 2009 at 12:27 AM, Conrad Lender wrote: > On 23/05/09 06:05, Rodrigo E. De León Plicet wrote: Is there a better way? >>> >>> Yeah, natural keys. >> >> +1. >> >> Also, what Ben described reeks of EAV. >> >> Ben, please read: >> >> http://joecelkothesqlapprentice.blogspot.com/200

[GENERAL] changing datatype from int to bigint quickly

2009-05-23 Thread Ow Mun Heng
Is there a method to do this without transversing the whole 20GB table? What about manipulating the pg_attribute table and changing atttypid just like we can manipulate atttypmod to change from varchar(4) to varchar(8)? Thanks -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org