Re: [GENERAL] [HACKERS] optimization join on random value

2015-05-04 Thread Martijn van Oosterhout
84) >Filter: ((customer_id)::double precision = trunc((random() * > 45000::double precision))) > (2 rows) If you look carefully you'll see that the comparison here is done as a "double precision" and so can't use the index. If you say something like: WHERE customer_id =

Re: [GENERAL] Unit tests and foreign key constraints

2015-05-21 Thread Martijn van Oosterhout
t foreign key. Foreign keys aren't deferrable by default, you have to create them that way... Have a nice day, -- Martijn van Oosterhout http://svana.org/kleptog/ > He who writes carelessly confesses thereby at the very outset that he does > not attach much importance to his own

Re: [GENERAL] Unit tests and foreign key constraints

2015-05-21 Thread Martijn van Oosterhout
gres features like timestamptz calculations and hstore, it's generally way easier to run your unit tests on an actual PostgreSQL database. Otherwise you're going to spend all your time working around the fact that your mock database is not the real thing (and running into bugs in your emula

Re: [GENERAL] Better way to process boolean query result in shell-like situations?

2015-10-29 Thread Martijn van Oosterhout
test that à la: What I do is use grep, for example (off the top of my head): if ! psql -qAt -c "select usename from pg_user" | grep -q USERNAME ; then ... If you're looking for true/false you could grep for t/f. Hope this helps, -- Martijn van Oosterhout http://svana.org/

Re: [GENERAL] jdbc pg_hba.conf error

2007-05-30 Thread Martijn van Oosterhout
rror: > > psql: FATAL: no pg_hba.conf entry for host "127.0.0.1", user "brakesh", > database "testing123", SSL off Ofcourse, the first connection is a local connection, which you obviously have configured. The latter connects to localhost, which you havn&#x

Re: [GENERAL] Problem - any password accepted

2007-05-30 Thread Martijn van Oosterhout
are the failure of the SSL connection, the successful connection is just fine. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] function retuning refcursor, order by ignored?

2007-05-30 Thread Martijn van Oosterhout
called like so: What you're doing is equivalent to ORDER BY 'constant' which is totally meaningless. If you want to control the column name dynamically, you need to build the query dynamically, with EXECUTE for example. > ORDER BY "pstr_orderby"; Have a nice d

Re: [GENERAL] Numeric performances

2007-06-01 Thread Martijn van Oosterhout
r some application and not > enough for other ones. If you can use float, use it. There's hardware support for that, whereas there's none for numeric... Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to

Re: [GENERAL] user restriction

2007-06-01 Thread Martijn van Oosterhout
e database with the same name as their username (sameuser option). Hope this helps, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] invalid memory alloc after insert with c trigger function

2007-06-01 Thread Martijn van Oosterhout
sed parameters like that. The compiler should have flagged this. Also, can you show how you defined the function in SQL, does it match? Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according t

Re: [GENERAL] multimaster

2007-06-02 Thread Martijn van Oosterhout
at: checking uniqueness, referential integrity and constraints, and let the user code deal with the actual work. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] Need a wee bit more info on PostgreSQL's SSL security options

2007-06-03 Thread Martijn van Oosterhout
/www.postgresql.org/docs/8.2/interactive/libpq-ssl.html As for CRL, I think that was only added after 8.1. Other than that I don't know. Hope this helps, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] multimaster

2007-06-03 Thread Martijn van Oosterhout
ing it in the database. But fundamental integrity constraints, the database is the only place. I wish you success in your efforts to making rails a little more sane in this area. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] changing 'mons' in interval?

2007-06-04 Thread Martijn van Oosterhout
t I could live without > it). Have you considered using to_char to get the output in the exact format you want? Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability t

Re: [Fwd: Re: [GENERAL] Autovacuum keeps vacuuming a table disabled in pg_autovacuum]

2007-06-04 Thread Martijn van Oosterhout
bloat indexes. Also, people tend to find that CLUSTER is faster anyway. If all you want is to avoid XID wraparound, an ordinary VACUUM will do fine. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each a

Re: [GENERAL] $libdir

2007-06-05 Thread Martijn van Oosterhout
t;$libdir/libtsearch" or something (perhaps a directory is missing or something and it should be tsearch/libtsearch.so). Please provide the *exact* error messages if you want more detailed help. Hope this helps, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ >

Re: [GENERAL] lo or bytea streaming engine??

2007-06-05 Thread Martijn van Oosterhout
to me to be (a) a terrible idea (b) trivial to implement. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] Postgresql 7.4.3/8.2.4 out of memory

2007-06-06 Thread Martijn van Oosterhout
ea? Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] Running v8.1 amd v8.2 at the same time for a transition

2007-06-06 Thread Martijn van Oosterhout
pgrade is complete, uninstall the old one. > Anyway, I guess wrappers are a must have like 3D desktops these days. You have an better alternative for handling multiple versions? Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each

Re: [GENERAL] plperl and/or insert trigger problem

2007-06-06 Thread Martijn van Oosterhout
able even exists. I'd say replace that line with: push @$tuple_status, [ $err, $sth->errstr, $sth->state]; And be done with it... Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each

Re: [GENERAL] String trim function - possible bug?

2007-06-06 Thread Martijn van Oosterhout
'dhct:dn'); > ?column? | ltrim > --+--- > dhct:dn | n > (1 row) The bit after the leading is the set of *characters* to be removed. Like so: # select trim( leading 'dhct:' from 'dhdhda'); ltrim --- a (1 row) It's matching characters,

Re: [GENERAL] formatting the output of a function

2007-06-06 Thread Martijn van Oosterhout
rt with the sizes, just use 16 bytes for both and in the snprintf use 16 also, then everything will work fine. > HeapTuple data; > Datum finalResult; > data = BuildTupleFromCStrings(attinmeta, output); Although I think you're going the long way round, you can build a tuple from the inte

Re: [GENERAL] insane index scan times

2007-06-07 Thread Martijn van Oosterhout
ss once you get to a significant percentage. However, recent versions have Bitmap index scans which are a middle ground, linear index scan, linear heap scan which has a much better worst case. So perhaps you're running a really old version of postgres, you didn't actually say what version you were

Re: [GENERAL] Jumping Weekends

2007-06-07 Thread Martijn van Oosterhout
ing convention, I wrote this of the top of my head). Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] Limitations on 7.0.3?

2007-06-08 Thread Martijn van Oosterhout
XID wraparound was to re-initdb at least every 4 billion transactions. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] query log corrupted-looking entries

2007-06-08 Thread Martijn van Oosterhout
ve worked with logging went through syslog and it seems to split long lines at 80 characters or so: [528-1] SELECT fo... [528-2] ... etc... I always assumed it was postgres doing the splitting but perhaps it was syslog all along. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED

Re: [GENERAL] insane index scan times

2007-06-08 Thread Martijn van Oosterhout
the specific > order or smth? Not really, Postgres can rearrange joins into the order it works out to be the best. You need to check whether the statistics on your columns are good, so postgres can make a good estimate. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> htt

Re: [GENERAL] gist index on cube column

2007-06-10 Thread Martijn van Oosterhout
. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] transaction problem using cursors

2007-06-11 Thread Martijn van Oosterhout
RE "CUSTOMERS"."ZIP" >= '1' AND "CUSTOMERS"."ZIP" < '2' That will produce the same result, but without any chance of errors... Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://sv

Re: [GENERAL] INSERT ... RETURNING in v8.2

2007-06-12 Thread Martijn van Oosterhout
d out I think) > Amk I doing anything wrong or is there some missing sentence in the > documentation? When the docs talk about an "expression" they don't mean aggregates, since they are not functions in the ordinary sense. Hope this helps, -- Martijn van Oosterhout <

Re: [GENERAL] how to speed up query

2007-06-12 Thread Martijn van Oosterhout
in. Now, you may argue that in your case this doesn't apply, which may be true, but it's always been a difficult construct to optimise... (and somewhat surprising for people with they didn't realise the null-effect). The most efficient way you write this is with an OUTER JOIN

Re: [GENERAL] [SQL] function to find difference between in days between two dates

2007-06-14 Thread Martijn van Oosterhout
t though. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] [SQL] function to find difference between in days between two dates

2007-06-14 Thread Martijn van Oosterhout
of hits on google :) Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] changing the /tmp/ lock file?

2007-06-14 Thread Martijn van Oosterhout
the case. It is possible, you just have to realise that just like every postmaster has to listen on a different IP, they also all need to listen to a different socket directory. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each ac

Re: [GENERAL] about cursors

2007-06-16 Thread Martijn van Oosterhout
mean, suppose an > application opens a cursor and crashes. What happens to that cursor? Is > there a way to close idle cursors? Cursors are attached to the transactio and session, if either ends, the cursor dies with it... Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]&g

Re: [GENERAL] Using the query INTERSECTion

2007-06-18 Thread Martijn van Oosterhout
ic one to be > built at runtime. The INTERSECT will almost certainly be slower, basically because all the joins will have to be processed twice. Also, the results won't be quite the same, especially with respect to duplicate records and NULLs. Have a nice day, -- Martijn van Oosterhout

Re: [GENERAL] Surrogate VS natural keys

2007-06-20 Thread Martijn van Oosterhout
oices, games or scores it may be easier to reference the relatioship via a surrogate key rather than copying the other IDs around everywhere. For simple tables like this I generally don't bother, but sometimes I find myself adding a surrogate key later. Have a nice day, -- Martijn van Oos

Re: [GENERAL] B-tree fan-out

2007-06-23 Thread Martijn van Oosterhout
Bigs keys mean less. For integers you can fit an awful lot of keys. > In B-trees all non-leaf nodes have a bunch of pointers to its child > nodes. What is the size of such a pointer? I imagine it's a page number, probably just a 32-bit integer. Have a nice day, -- Martijn van

Re: [GENERAL] B-tree fan-out

2007-06-23 Thread Martijn van Oosterhout
. What is the size of such a pointer? > >I imagine it's a page number, probably just a 32-bit integer. > > > OK, thanks a lot. Do you know if other database systems implement > b-trees this way too? I.e. one page per node. No idea whatsoever. Have a nice day, -- Martijn van

Re: [GENERAL] minimum function

2007-06-23 Thread Martijn van Oosterhout
I want to do is something like > > SELECT minimum(5,6) => 5 There are the functions int4larger/int4smaller. There are equivalent function for other types. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his a

Re: [GENERAL] B-tree fan-out

2007-06-23 Thread Martijn van Oosterhout
size > and each child node is stored in its own page. Is that correct? I beleive so, yes. Each branch is a page that points to many either branches or leaves. A leaf is also a page which can contain many keys, which reference tuples in the actual table. Have a nice day, -- Martijn van Oost

Re: [GENERAL] 8.2 contrib. "Full Disjunction"

2007-06-23 Thread Martijn van Oosterhout
FWIW, with this simple description I finally worked out what full disjunctions are and why you can't do them (efficiently) in SQL. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each acco

Re: [GENERAL] 8.2 contrib. "Full Disjunction"

2007-06-24 Thread Martijn van Oosterhout
On Sat, Jun 23, 2007 at 10:33:49PM +0100, Gregory Stark wrote: > "Martijn van Oosterhout" <[EMAIL PROTECTED]> writes: > > On Fri, Jun 22, 2007 at 07:38:01PM +0300, Tzahi Fadida wrote: > >> Let me simplify it in lamer terms. > >> Basically, you have a cyc

Re: [GENERAL] dynamic table/col names in plpgsql

2007-06-26 Thread Martijn van Oosterhout
/python/etc...) Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] COPY to/from non-local file

2007-06-27 Thread Martijn van Oosterhout
In perl DBI is works like that, for C also, so probably from ruby also. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] COPY to/from non-local file

2007-06-27 Thread Martijn van Oosterhout
h it. Hrm, in what sense doesn't it work well? Line-by-line means record-by-record. And writing a function to take an fd and do the work would be straightforward, or do you mean something else? Do you have any suggestions for improvement? Have a nice day, -- Martijn van Oosterhout <[EM

Re: [GENERAL] AutoVacuum Behaviour Question

2007-06-28 Thread Martijn van Oosterhout
2947120794 Whatever this table is, the freeze XID isn't getting updated for some reason... Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] AutoVacuum Behaviour Question

2007-06-28 Thread Martijn van Oosterhout
tovacuum ignores temporary tables. And somehow you've got a temporary table that's been alive for hundreds of millions of transactions... Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each acc

Re: [GENERAL] Looking for help regarding getting the latest inserted sequence value.

2007-07-01 Thread Martijn van Oosterhout
nvoke triggers? And what view should they get? Does the trigger on the outer table get to see the effect of the nested insert, for example. I'm sure it will get done eventually, once the details have been sorted out. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]>

Re: [GENERAL] shmctl EIDRM preventing startup

2007-07-02 Thread Martijn van Oosterhout
s exposed under /proc somehow... If it's installed, this: lsof |grep SYSV Will list all processes attached to a SHM segemtn on the system. I think ipcs can do the same. You can grep /proc/*/maps for the same info. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> htt

Re: [GENERAL] ERROR: unexpected hash relation size:

2007-07-02 Thread Martijn van Oosterhout
nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] How to get fast ~ operator using C locale

2007-07-05 Thread Martijn van Oosterhout
27;t change it. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] simple query question to use with DBI selectall_hashref

2007-07-05 Thread Martijn van Oosterhout
is stored as a hash. That can be done simple using: my $emps = $dbh->selectall_arrayref( "SELECT ename FROM emp ORDER BY ename", { Slice => {} } ); It's then an array rather than a hash, but that'

Re: [GENERAL] CASE in ORDER BY clause

2007-07-07 Thread Martijn van Oosterhout
asc/desc inside a case. > ... order by start_date desc, asc; > or > ... order by desc, start_date asc; Almost, it's actually: ... order by start_date desc, null asc; or ... order by null desc, start_date asc; Ordering by a constant has no effect, which is why it works. Have a nic

Re: [GENERAL] Postgres 8.2 binary for ubuntu 6.10?

2007-07-12 Thread Martijn van Oosterhout
stgres team wants. For distributors "stable" means no behavioural changes, whereas the postgresql team does bug fixes, some of which definitly make behavioural changes that would make previously working programs break. Backports is usually a good compromise. Have a nice day, -- M

Re: [GENERAL] backend process terminates

2007-08-08 Thread Martijn van Oosterhout
unning "nm -D" over the main postgres executable and your libraries should give you an idea of the scope of the problem. Hope this helps, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] Reordering columns, will this ever be simple?

2007-08-08 Thread Martijn van Oosterhout
;s > said they'll be doing it yet and there are a lot of other more exciting ideas > too. Doubt it, patches to implement this have been submitted and rejected in the past. I don't see any reason why 8.4 would be any different. Have a nice day, -- Martijn van Oosterhout <[EMAIL

Re: [GENERAL] Trigger not working as expected, first row gets a null value

2007-08-08 Thread Martijn van Oosterhout
onplace issue. It doesn't have to be repoducable, but the definition of the tables involves + the code of the trigger would help. I read your description three times and still couldn't quite work out exactly what the problem was or what you were expecting to happen... Have a nice day,

Re: [GENERAL] backend process terminates

2007-08-08 Thread Martijn van Oosterhout
. FWIW, this document has lots of information about ELF shared libraries. http://people.redhat.com/drepper/dsohowto.pdf There's a lot of technical stuff that you can skip, but there is a lot of info about scopes and how they are resolved, common problems and how to fix them. Have a nice, --

Re: [GENERAL] Reordering columns, will this ever be simple?

2007-08-08 Thread Martijn van Oosterhout
could provide useful savings on wide tables and multicolumn indexes, but you have to decouple logical and physical ordering to do it. But this is a thoroughly dead horse, lets not beat it up again. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ &g

Re: [GENERAL] timestamp skew during 7.4 -> 8.2 upgrade

2007-08-12 Thread Martijn van Oosterhout
ened and you don't want it rotated, no matter what, you need "without". Hope this helps, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] UDFs

2007-08-13 Thread Martijn van Oosterhout
lly, what is probably the actual problem, at no point did you assign a length to the hash variable, ie VARLEN(hash)=foo. Hope this helps, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his abili

Re: [GENERAL] UDFs

2007-08-13 Thread Martijn van Oosterhout
to the right locations. If you can, I'd suggest installing binary versions of the contrib modules (it's called postgresql-8.2-contrib in debian for example). That saves you having to worry about sources, paths, compilations, etc). Have a nice day, -- Martijn van Oosterhout <[EMAIL PRO

Re: [GENERAL] Best practice for: ERROR: invalid byte sequence for encoding "UTF8"

2007-08-15 Thread Martijn van Oosterhout
's no way you can "fix" the query. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] Best practice for: ERROR: invalid byte sequence for encoding "UTF8"

2007-08-15 Thread Martijn van Oosterhout
would work though. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] Yet Another COUNT(*)...WHERE...question

2007-08-16 Thread Martijn van Oosterhout
ows Hope this helps, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] [RESEND] Transaction auto-abort causes grief with Spring Framework

2007-08-16 Thread Martijn van Oosterhout
t savepoint prior to execution.) Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] [RESEND] Transaction auto-abort causes grief with Spring Framework

2007-08-17 Thread Martijn van Oosterhout
ent it... (Odd, I wouldn't have thought it was so difficult). Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] Some frustrations with admin tasks on PGSQL database

2007-08-17 Thread Martijn van Oosterhout
h, with 6million rows, it might even fit in memory. Can you see (in ps) what it's actually doing? Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] Repeat posts

2007-08-17 Thread Martijn van Oosterhout
m non-subscribers can get held for moderation. Because they CC the other people the thread kept going. Later on the moderator approves the messages and they get sent out again. Hope this help, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according

Re: [GENERAL] Postgresql performance in production environment

2007-08-19 Thread Martijn van Oosterhout
processes lying around. You'll have to provide more detail about your system before getting any better recommendations. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ab

Re: [GENERAL] pg_class.relfilenode for large tables

2007-08-20 Thread Martijn van Oosterhout
abase as it isn't an independant object. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] Stripping apostrophes from data

2007-08-20 Thread Martijn van Oosterhout
y you just escape them or, if you don't want to worry about them at all, use queries with placeholders. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] PGError: input out of range

2007-08-20 Thread Martijn van Oosterhout
The only thing in your query that I can imagine being out of range is ACOS() which would need to be between -1 and 1 (otherwise the result would be complex). I'd try and see what the argument to the ACOS is, but it's probably some corner case where the rounding is getting you. Hope

Re: [GENERAL] PG Seg Faults Performing a Query

2007-08-22 Thread Martijn van Oosterhout
ory for you, you need to avoid getting it in the first place. If you only want to display part of it, do a LIMIT . Or use a cursor to page through it. That said, it would be nice if it returned an error instead of crashing. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]>

Re: [GENERAL] "out of memory" error

2007-08-23 Thread Martijn van Oosterhout
ought >that the memory used for buffers and caches can be thought of as free >memory. Isn't this correct? Postgresql shared_buffers is not "free". It should be around your actually working set size, much bigger is counter productive. Have a nice day, -- Martijn

Re: [GENERAL] "out of memory" error

2007-08-24 Thread Martijn van Oosterhout
On Fri, Aug 24, 2007 at 12:07:37PM +0300, Mikko Partio wrote: > On 8/23/07, Martijn van Oosterhout <[EMAIL PROTECTED]> wrote: > > You've got it completely wrong. By setting shared_buffers to 2GB it > > means no-one can use it. It's not postgres that's running

Re: [GENERAL] Shared memory usage

2007-08-25 Thread Martijn van Oosterhout
the system manage the memory itself, if it needs it, it'll use it. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] create or replace for tables and schemas

2007-08-27 Thread Martijn van Oosterhout
r you. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] Tables dissapearing

2007-08-27 Thread Martijn van Oosterhout
uot;. On each database... As for debugging, maybe something like: select xmin, age(xmin) from pg_class; Just to check the wraparound issue... Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each

Re: [GENERAL] Out of Memory - 8.2.4

2007-08-27 Thread Martijn van Oosterhout
ystem. Another thing I havn't seen mentioned: you appear to be on a 32-bit architecture and with 2GB shared_buffers you've lost half your address space on that alone. Perhaps you simply don't have enough contiguous address space to alloc 512MB. Hope this helps, -- Martijn van Ooster

Re: [GENERAL] Tables dissapearing

2007-08-27 Thread Martijn van Oosterhout
views and also some > application level indices etc. Depends what you mean by too high. Anything with XID 1 and 2 is not a problem, and age returns a really big number for them. Can you give some examples? Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.or

Re: [GENERAL] Tables dissapearing

2007-08-28 Thread Martijn van Oosterhout
to reappear. Ofcourse, your indexes may be invalid, your constraints may be violated, but the data will still be there... Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability

Re: [GENERAL] Is there a better way to do this?

2007-08-28 Thread Martijn van Oosterhout
P WITHOUT TIME ZONE AS ' SELECT $1+$2*24*3600*''1 second''::INTERVAL; ' LANGUAGE 'sql'; Not sure if it qualifies as 'more concise' though. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > Fro

Re: [GENERAL] How to avoid "Seq Scans"?

2007-08-29 Thread Martijn van Oosterhout
needs adjusting. Also, your query can't use an index anyway, for that you'd need an index on (f2,f3). Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate.

Re: [GENERAL] Obtaining random rows from a result set

2007-08-31 Thread Martijn van Oosterhout
distinct rows, which is different to just running the above set 5 times in parallel. I don't know if there's a similar method for median... Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each

Re: [GENERAL] Obtaining random rows from a result set

2007-09-01 Thread Martijn van Oosterhout
it has chance 2/3 of being kept. At row four it's 3/4. As you see, the numerators and denominators cancel, leaving 1/n at the end... Neat huh? -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according t

Re: [GENERAL] invalid byte sequence for encoding "UTF8": 0xff

2007-09-03 Thread Martijn van Oosterhout
ient_encoding". Well, the error is correct, that's not a valid UTF-8 character. I seem to remember someone saying that ooasionally windows puts BOMs in UTF-8 files (which is completely bogus). Check the file using a simple text editor a check if there are some odd characters at the beginn

Re: [GENERAL] Statistics collection question

2007-09-04 Thread Martijn van Oosterhout
able bloat. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] psql hanging

2007-09-05 Thread Martijn van Oosterhout
ealous firewall dropping the RST packets in response to the keepalives?). Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] Type cast text to int4

2007-09-07 Thread Martijn van Oosterhout
can use ''::text::myint which probably will call your cast function. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] Type cast text to int4

2007-09-07 Thread Martijn van Oosterhout
s and internal datatypes, which pl/pgsql can't do. What you're trying to do has been done before, so you should check the archives. In general though you should really just fix the source to produce valid SQL standard output. Have a nice day, -- Martijn van Oosterhout <[EMAIL PRO

Re: [GENERAL] Time Zone design issues

2007-09-10 Thread Martijn van Oosterhout
ything is in my timezone, no matter where the machine is or whatever anyone else on the machine is doing. It's not magic, just someone 30 years ago making the smart choice. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each accord

Re: [GENERAL] Time Zone design issues

2007-09-10 Thread Martijn van Oosterhout
hatever you've configured the timezone to be. Have your webapp execute "set timezone = 'foo'" at the beginning of the session and everything will flow from there. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From eac

Re: [GENERAL] cast time interval to seconds

2007-09-10 Thread Martijn van Oosterhout
86400 - CAST(start_time AS SECONDS)) > % 86400; At a guess I'd say you should simply subtract the two (ie stop_time - start_time) and then use extract() to pull the seconds out. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each accordi

Re: [GENERAL] Statistics collection question

2007-09-10 Thread Martijn van Oosterhout
ock you showed is merely the transaction holding an exclusive lock on itself. As you can see, there is no database or relation mentioned, so it's not locking anything else. It has a shared lock on a table, but that's normal. For more info the activity, try "select * from pg_stat_activity;

Re: [GENERAL] Time Zone design issues

2007-09-10 Thread Martijn van Oosterhout
ezone (probably because there's no standard way of specifying it). However there is code on the web to give you a guess though, by using javascript to get time difference from UTC. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] avg() of array values

2007-09-11 Thread Martijn van Oosterhout
postgres replaces the * with a 1, whic doesn't change the fact that the query is wrong. Have a nice day, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] Event-driven programming?

2007-09-12 Thread Martijn van Oosterhout
y, -- Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate. signature.asc Description: Digital signature

Re: [GENERAL] Cannot declare record members NOT NULL

2007-09-12 Thread Martijn van Oosterhout
I know this information because the client is using the > "describe" feature of Postgresql to retrieve the types returned > by a statement. The describe clearly can't tell if the result is always going to be NULL or not. Have a nice day, -- Martijn van Oosterhout <[

  1   2   3   4   5   6   7   8   9   10   >