Re: [GENERAL] Hope for a new PostgreSQL era?

2011-12-08 Thread Tomas Vondra
the pool share connections between DB users and/or >> databases on the instance? If the answer is yes to either, that is a >> fair bit better than what we can achieve today. > > Between users yes. But there is only one DB per instance in Oracle :) Because Oracle uses schemas inste

Re: [GENERAL] Hope for a new PostgreSQL era?

2011-12-08 Thread Tomas Vondra
;s a third party (might be a local consulting company) providing acceptable guarantees and support for PostgreSQL, it may as well provide guarantees for pgbouncer and the enterprise customer is fine. They simply want a package with guarantees, it does not matter whether it's in core or not. Toma

Re: [GENERAL] Hope for a new PostgreSQL era?

2011-12-08 Thread Tomas Vondra
n mistake - in my native language we often use 'you' when we actually mean 'someone.' So it should be something like "If someone expects ... he's mistaken," etc. Tomas -- 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] Hope for a new PostgreSQL era?

2011-12-08 Thread Tomas Vondra
On 8 Prosinec 2011, 14:20, Andrew Sullivan wrote: > On Thu, Dec 08, 2011 at 01:53:45PM +0100, Tomas Vondra wrote: >> I wonder if the prioritisation could be done using nice - each backend >> is >> a separate process, so why not to do 'nice(10)' for low priority &g

Re: [GENERAL] fsync on ext4 does not work

2011-12-19 Thread Tomas Vondra
tasync, open_sync), but all are > similar. > Should I disable write cache on HDD to make it work? Yes, disable that. > Have you any idea why? What scale factor have you used with pgbench? And how long are the pgbench runs? The smaller the data set, the more it will be affected by the wr

Re: [GENERAL] invalid memory alloc request size

2011-12-27 Thread Tomas Vondra
ed integers). Some time ago I've written an extension that might help you locate where's the actual issue (which block / row / field) and Heikki did some review about a month ago so there's a change it might work. It's available here http://github.com/tvondra/pg_check Let me know in case of any issues. regards Tomas -- 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] invalid memory alloc request size

2011-12-27 Thread Tomas Vondra
On 27.12.2011 23:23, Merlin Moncure wrote: > On Tue, Dec 27, 2011 at 4:07 PM, Tomas Vondra wrote: >> That's not likely. The corruption is usually the cause, when it hits >> varlena header - that's where the length info is stored. In that case >> PostgreSQL suddenly

Re: [GENERAL] indexes no longer used after shutdown during reindexing

2012-01-13 Thread Tomas Vondra
connects sessions rather than and returns 1. If you really need to wait for shutdown, you need to add "-w" to the command line, use "-m fast" or "-m immediate". But even ignoring the return value should not cause corruption IMHO. Tomas -- Sent via pgsql-genera

Re: [GENERAL] Getting all entries in a single block with ctid

2012-01-16 Thread Tomas Vondra
from foo where ctid like '(123,%' > > or ... ctid.block = 123 WHERE ctid >= '(123,0)'::tid AND ctid < '(124,0)'::tid Tomas -- 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] Getting all entries in a single block with ctid

2012-01-16 Thread Tomas Vondra
On 16 Leden 2012, 15:28, Tore Halvorsen wrote: > On Mon, Jan 16, 2012 at 3:20 PM, Tomas Vondra wrote: > [...] > >> >> WHERE ctid >= '(123,0)'::tid AND ctid < '(124,0)'::tid >> >> > Ah, forgot a point here - without doing a sequential

Re: [GENERAL] Getting all entries in a single block with ctid

2012-01-16 Thread Tomas Vondra
On 16 Leden 2012, 17:15, Tore Halvorsen wrote: > On Mon, Jan 16, 2012 at 4:08 PM, Tomas Vondra wrote: > >> The only other solution is to check all possible items on the page. >> There >> may be up to 291 items (although it depends on block size and >> architectur

Re: [GENERAL] indexes no longer used after shutdown during reindexing

2012-01-22 Thread Tomas Vondra
On 20.1.2012 19:47, Matt Dew wrote: > On 01/13/2012 02:49 PM, Tomas Vondra wrote: >> On 13.1.2012 22:20, Tom Lane wrote: >>> Matt Dew writes: >>>> An interesting sidenote we realized. the nice system shutdown script >>>> /etc/init.d/postgres doesn

Re: [GENERAL] PG migration policy

2012-01-29 Thread Tomas Vondra
an that you want to move just one of the databases (not the whole cluster)? Tomas PS: I don't think this to be off topic. General list is exactly the right place where this should be discussed. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make chang

Re: [GENERAL] High checkpoint_segments

2012-02-15 Thread Tomas Vondra
f the drives etc. If you need to protect yourself against this, you need to keep a WAL archive (prefferably on a separate machine) and/or a hot standby for failover. kind regards Tomas -- 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] Memory tuning Postgres

2012-02-15 Thread Tomas Vondra
On 15 Únor 2012, 15:20, Robert James wrote: > I have a 4 core, 4 GB server dedicated to running Postgres (only other > thing on it are monitoring, backup, and maintenance programs). It > runs about 5 databases, backing up an app, mainly ORM queries, but > some reporting and more complicated SQL JO

Re: [GENERAL] "canceling autovacuum time"

2012-02-28 Thread Tomas Vondra
UPDATE > * INSERT > * DELETE > Does anyone have a suggestions as to what the cause of this error might > be? Generally yes, autovacuum can cancel itself is something holds a lock. Check pg_locks what locks are there (http://www.postgresql.org/docs/9.1/static/view-pg-locks.html). Tomas -- 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] Problems with non use of indexes

2012-03-02 Thread Tomas Vondra
3) > -> Index Scan using activity_action_actor_id on > activity_action (cost=0.00..65.20 rows=111 width=51) >Index Cond: (activity_action.actor_id = > u0.object_id) >-> Hash (cost=278.00..278.00 rows=1 width=104) > -> Seq Scan on auth_user (cost=0.00..278.00 > rows=1 width=104) > > > If I do a SET enable_seqscan TO 'off'; It uses the index but is also slow. Errr, what? The only sequential scan in that explain output is on auth_user, not activity_follow which is the table referenced in the original query. It actually uses index scan to read activity_follow -> Index Scan using activity_follow_user_id on activity_follow u0 (cost=0.00..4875.15 rows=4898 width=4) Index Cond: (user_id = 1) Filter: (content_type_id = 3) kind regards Tomas -- 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] Problems with non use of indexes

2012-03-02 Thread Tomas Vondra
On 2 Březen 2012, 13:45, Tyler Durden wrote: >> > Yes, but if I remove *U0."user_id" = 1 *will use the index: Which PostgreSQL version is that? Post EXPLAIN ANALYZE output for all three queries, not just EXPLAIN. And use explain.depesz.com if possible, it's much more reada

Re: [GENERAL] Problems with non use of indexes

2012-03-02 Thread Tomas Vondra
On 2 Březen 2012, 14:34, Tyler Durden wrote: > On Fri, Mar 2, 2012 at 12:55 PM, Tomas Vondra wrote: > >> On 2 Březen 2012, 13:45, Tyler Durden wrote: >> >> >> > Yes, but if I remove *U0."user_id" = 1 *will use the index: >> >> Which PostgreS

Re: [GENERAL] corrupted table postgresql 8.3

2012-03-06 Thread Tomas Vondra
ut I don't know if > the method that I used to "recover" the table was technically correct... It > was a try...) > - all up and running again What do you mean by 'populated the table' with the production data? How did you do that? kind regards Tomas -- 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] oracle linux

2012-03-28 Thread Tomas Vondra
ailable to RedHat yet etc.). > They seem to run the same way as RHEL do, ie - you can download it for > free, but pay for repo access. (thus updates). Well, and they can change that any time they want ... Tomas -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To ma

Re: [GENERAL] oracle linux

2012-03-28 Thread Tomas Vondra
On 28 Březen 2012, 17:44, Thom Brown wrote: > On 28 March 2012 16:30, Tom Lane wrote: >> "Tomas Vondra" writes: >>> On 28 Březen 2012, 16:38, Gregg Jaskiewicz wrote: >>>> They seem to claim up to 70% speed gain. >>>> Did anyone proved it,

Re: [GENERAL] How to repair Pg 9.1?

2012-04-15 Thread Tomas Vondra
m.* parameters at the kernel level and shared_buffers/work_mem/maintenance_work_mem at the PostgreSQL level. In this particular situation (ALTER TABLE) I'd use a low value for the maintenance_work_mem parameter - it'll run longer but won't need that much memory. Tomas -- 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] Writing data to a text file based on a trigger event...

2012-04-15 Thread Tomas Vondra
postgresql.org/docs/9.1/interactive/adminpack.html You may either use that directly or use that as an inspiration to write your own C extension (it's quite simple). Just be careful about granting the execution rights to regular users, it's probably better to wrap the function in your own funct

Re: [GENERAL] How to repair Pg 9.1?

2012-04-15 Thread Tomas Vondra
. > >> In this particular situation (ALTER TABLE) I'd use a low value for the >> maintenance_work_mem parameter - it'll run longer but won't need that >> much memory. > >> Tomas > > I've just upgraded my postgresql upto current wheezy versi

Re: [GENERAL] What is the different between pg_trgm search and FULL Text search?

2012-04-23 Thread Tomas Vondra
s, allows you to define synonyms and much more. It has much more insight into the language structure etc. It allows you to build complex queries (AND, OR, NOT, ...) etc. Tomas -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://ww

[GENERAL] manipulating anyarray columns

2012-05-05 Thread Tomas Vondra
gly, I can do this: SELECT (string_to_array(array_to_string(most_common_vals,','),','))[1:3] FROM pg_stats WHERE tablename = 'pg_attribute' AND attname = 'attname'; which is good enough for me, but I'm curious why the simple approach does not wor

Re: [GENERAL] Is there a tool for checking database integrity

2012-05-06 Thread Tomas Vondra
regular backups and **check them** i.e. check that the backup finished OK and restore them somewhere else (a backup of a corrupted database usually fails) (3) use good hw (ECC memory, ...) / test it thoroughly etc. kind regards Tomas -- Sent via pgsql-general mailing list (pg

Re: [GENERAL] Is there a tool for checking database integrity

2012-05-06 Thread Tomas Vondra
On 7.5.2012 00:56, Bruce Momjian wrote: > On Mon, May 07, 2012 at 12:37:47AM +0200, Tomas Vondra wrote: >> Hi, >> >> On 6.5.2012 20:47, Clemens Eisserer wrote: >>> Hi, >>> >>> Is there a tool for checking a postgresql database for integrity, so I &g

Re: [GENERAL] manipulating anyarray columns

2012-05-07 Thread Tomas Vondra
w why pg > not support the cast. IMHO this is exactly what I did, except that I casted the array to string and back by calling functions (array_to_string/string_to_array) and you did that by casting. Tomas -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make change

Re: [GENERAL] 2 machines, same database, same query, 10 times slower?

2012-05-08 Thread Tomas Vondra
ntly (without running VACUUM FULL after) or by not running autovacuum at all. Which is quite likely, because it was introduced in 8.1 and was off by default. BTW if you care about performance, you should upgrade to a more recent version (preferably 9.x) because 8.1 is not supported for several year

Re: [GENERAL] 2 machines, same database, same query, 10 times slower?

2012-05-08 Thread Tomas Vondra
On 8.5.2012 20:32, Antonio Goméz Soto wrote: >> > Do this on both machines to verify that >> > >> >SELECT relpages, reltuples FROM pg_class WHERE relname = 'cdr'; > Slow machine: > > relpages | reltuples > --+--- >400566 |982321 > > Fast machine: > > relpages | re

Re: [GENERAL] relpages sudden increase

2012-05-08 Thread Tomas Vondra
ould the table size remain massive when the number of pages dropped to 164? Did you mean a different table or the whole database? > Using Centos5/postgres 8.1.21 at the moment. Planning to upgrade over > summer but not had issues like this before on 8.1. > > What gives?! Good idea. 8

Re: [GENERAL] 2 machines, same database, same query, 10 times slower?

2012-05-09 Thread Tomas Vondra
On 9.5.2012 22:50, Antonio Goméz Soto wrote: > Tomas, > > running vacuum full cdr brought down the query time to 4 seconds.. Fine. I'd recommend checking the other tables too - if this one was bloated, it's likely there might be others. Anyway, you should find out how this

[GENERAL] 08P01: unexpected EOF on client connection

2009-04-30 Thread Tomas Vondra
only a few tiny images, and the "empty" images are different each time (so there are no corrupted data or something like that). Do you have any idea why this happens? regards Tomas -- 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] 08P01: unexpected EOF on client connection

2009-05-01 Thread Tomas Vondra
Hi, Tomas Vondra wrote: $conn = pg_connect(...); $res = pg_query("SELECT mime, thumbnail_data FROM images WHERE filename = "); $row = pg_fetch_assoc($row); header('Content-Type: ' . $row['mime']); echo pg_unescape_bytea($row['thumbnail_data']);

[GENERAL] pg_autovacuum / pg_class

2006-10-26 Thread Tomas Vondra
ostgresql.conf, and there are no rows in pg_autovacuum. The new tables are growing pretty fast (about 1.000.000 of rows each month), so the thresholds should be exceeded pretty very fast. But maybe this is caused by some stupid misconfiguration and/or is a known feature ... thanks f

Re: [GENERAL] pg_autovacuum / pg_class

2006-10-27 Thread Tomas Vondra
ticed that only for the new tables (having 0 values in all columns), as most of the other tables are not changing very frequently (resp. have about the same number of inserts and deletes). So now the pg_autovacuum is up and running, and I'll check how it works tomorrow. But I guess this time i

Re: [GENERAL] pg_autovacuum / pg_class

2006-10-28 Thread Tomas Vondra
> Tomas Vondra wrote: >> Hello, >> >> I have a simple question about auto-vacuuming. We are running a Postgres >> 8.1 and I've noticed that some of the tables are not analyzed by the >> pg_autovacuum daemon. That is - when I select the rows from pg_class,

Re: [GENERAL] bytea / large object and image

2006-11-04 Thread Tomas Vondra
age on PHP pages ? > what is the purpose in this case to store image a bytea / large object ? This is true in case of 'dumb' databases as for example MySQL, as these databases handle LOB columns pretty bad. Tomas ---(end of broadcast)

Re: [GENERAL] SPI

2006-11-17 Thread Tomas Vondra
e/trigger-interface.html But sure - that's just the basics. Tomas ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] After Update Triggers

2006-11-17 Thread Tomas Vondra
se of an INSERT. Anyway the point is you can define the trigger as AFTER INSERT OR UPDATE and use TG_OP variable, or maybe define several triggers - one for the UPDATE, one for the INSERT. Tomas ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] After Update Triggers

2006-11-17 Thread Tomas Vondra
... ELSE ... END IF; There are several other useful variables - see the this http://www.postgresql.org/docs/8.1/interactive/plpgsql-trigger.html Tomas ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

Re: [GENERAL] Problem with unique key

2006-11-28 Thread Tomas Vondra
ues from 1 ... and these are already in the table. Try this =# SELECT setval('admin_field_list_key_seq', (SELECT MAX(key) FROM admin_field_list)); and then the insert again. Tomas ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

[GENERAL] could not open file xxxx for writing: Permission denied

2007-01-03 Thread Tomas Lanczos
ql/ml50jtsk.out" for writing: Permission denied SQL state: 42501 What's wrong? Does it mean that the database user has no writing permission out of the database? How I did a pg_dump then few weeks ago? Many thanks for help and/or explanation, best regards and Happy New Year Tomas --

[GENERAL] Moving the database from winxp to linux

2007-01-10 Thread Tomas Lanczos
I am planning within few week to migrate the existing 8.1.4 postgresql database from winxp to 8.2 postgresql installed on linux (ubuntu). Is there any good tutorial for the task like this, event. do have somebody summarized some tricks and tips, at least? many thanks in advance and regards Tomas

Re: [GENERAL] Moving the database from winxp to linux

2007-01-10 Thread Tomas Lanczos
> [mailto:[EMAIL PROTECTED] On Behalf Of Chris > > Tomas Lanczos wrote: > > I am planning within few week to migrate the existing 8.1.4 > postgresql > > database from winxp to 8.2 postgresql installed on linux > (ubuntu). Is > > there any good tutorial for t

Re: [GENERAL] Finding bogus dates

2007-01-18 Thread Tomas Vondra
> Suppose that I have a varchar column which contains dates, and some of them > are bogus, such as '1968-02-31'. Is it possible to specify a query condition > "cannot be cast to a valid date". (It's legacy data, and I'm trying to clean > it up before importing into the final schema.) There probably

Re: [GENERAL] Multiple column index usage question

2007-01-19 Thread Tomas Vondra
list, but there may be columns with more variability. Another thing you have to take into account is sorting - that's another area of indexing, especially with multi-column indexes. Well, somehow long answer for a relatively short question ... sorry for that. Tomas ---

Re: [GENERAL] triggers vs b-tree

2007-01-26 Thread Tomas Vondra
e trigger / array solution and compare them to the foreign key / index. Try to do some other optimizations too (for example cluster the Person table along the family_id column - that usually means a serious performance boost). Tomas ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

[GENERAL] strange thing with partitioning / rules / plpgsql

2007-01-29 Thread Tomas Vondra
ecuted say once a day, but with heavily used procedures doing a lot of operation on this partitioned table that really is not an option. Is there some other solution? Tomas ---(end of broadcast)--- TIP 6: explain analyze is your friend

[GENERAL] partitioning / rules - strange behavior

2007-02-04 Thread Tomas Vondra
ules (drop / create) manually, but still no change. But when I drop the new rule (insert_900) it works fine, and once I create it again it stops working. What I suspect is the failure in the stored procedure did something wrong to the catalogs but maybe I'm completely wrong. Anyway I really don't know how to fix it. thanks for all advices Tomas ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] partitioning / rules - strange behavior

2007-02-04 Thread Tomas Vondra
ty is that the you are not using sessions_id_seq in the way > you think you are. What do you mean? I do a 'SELECT currval(...)' after the insert and it gives me the right value. It works until I create the next RULE, so this does not seem as a sequence problem. Tomas -

Re: [GENERAL] PostgreSQL/FireBird

2007-02-06 Thread Tomas Vondra
areful saying someone is a communist. I disagree with R. Stallman in many cases but that does not mean he's a communist. Tomas ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] partitioning / rules - strange behavior

2007-02-06 Thread Tomas Vondra
base (I have not been able to > simulate this on the development/testing system) - I'll play with that at > night > (european time). I'll try to drop / recreate the partition (I've tried to > recreate only the RULEs, not the partitions). > > Tomas OK, I did some t

Re: [GENERAL] PostgreSQL/FireBird

2007-02-06 Thread Tomas Vondra
it comes to marking someone as a communist, especially in the area of open source, and I have missed the crank. Tomas ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] partitioning / rules - strange behavior

2007-02-07 Thread Tomas Vondra
alue) VALUES(nextval('sessions_id_seq','x'); it calls sessions_id_seq several times. I'll fix it by first fetching the ID and then using it as a constant value in the INSERT, but I'd like to know the reason why it works this way. Tomas ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly

Re: [GENERAL] partitioning / rules - strange behavior

2007-02-07 Thread Tomas Vondra
d be a clear explanation / example in the docs about this - I've read the documentation on RULE sytem several times and as far as I remember. Anyway thanks to those helped me to solve this problem, now it works as expected. Tomas ---(end of broadcast)-

Re: [GENERAL] partitioning / rules - strange behavior

2007-02-07 Thread Tomas Vondra
d as far as I remember there's no clear statement about this. Tomas ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] MOVE cursor in plpgsql?

2007-02-11 Thread Tomas Vondra
> Hi all, > > Is there a way to move a cursor in plpgsql in the same way as in > regular sql? The function below would like to move the cursor back to > the start each time the cursor runs out of rows, creating pairs of > integers that are randomly put together. > > The "motivation" for this is

Re: [GENERAL] Setting up functions in psql.

2007-02-16 Thread Tomas Vondra
as a different one). This is a feature, not a bug! You can bypass this using dynamic SQL, ie. use EXECUTE 'DROP ...'; EXECUTE 'CREATE ...'; instead of plain DROP / CREATE. Dynamic SQL could be a performance issue in some cases (as the query has to be parsed each time it'

[GENERAL] up-to-date docs on vacuum

2007-02-16 Thread Tomas Vondra
27;m not sure about it's relevance to the current state). Is there some other documentation / articles on this topic or do I have to study the sources? Tomas ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

[GENERAL] Moving WAL files

2007-02-22 Thread Tomas Simonaitis
Hi, I've got following online-backup setup (v. 8.1.8): - on master -- archive_command = 'mv %p //%f -- rsyncd with access to DB data and - on slave -- rsync client running every 10sec. to sync and directories to slave: rsync -a --delete master:: rsync -a --delete master:: -- pg_start_backu

Re: [GENERAL] Moving WAL files

2007-02-22 Thread Tomas Simonaitis
> Quick question, you mentioned LVM snapshots, and I am not aware what > it does! Is there any doc that explains it? Can you point me to some > such resources? Newer LVM versions support read/write snapshots [essentially cheap clone of all partition data]. http://tldp.org/HOWTO/LVM-HOWTO/snapshot

Re: [GENERAL] PGSQL Locking vs. Oracle's MVCC

2007-02-23 Thread Tomas Vondra
do that, PostgreSQL uses one of them, Oracle uses another one. MVCC generally means that the DB is able to serve various versions of the same row (block). PostgreSQL does not overwrite the updated rows, Oracle uses undo log. Tomas ---(end of broadcast)

Re: [GENERAL] Best way to store and retrieve photo from PostGreSQL

2007-02-25 Thread Tomas Vondra
inary data (and load them only if reallly needed, using proper projection). You can do some benchmarks, but I've never head performance problems with it on PostgreSQL and the ability to use transactions was invaluable (it saved us hundreds of hours when the machine went down for some re

Re: [GENERAL] SQL Question - Using Group By

2007-02-25 Thread Tomas Vondra
active THEN 1 ELSE NULL END) / COUNT(*) AS active_pct FROM table_name; but have not tested it ;( Tomas ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

[GENERAL] how to return 0 rows in function

2007-05-18 Thread Tomas Macek
archar and it always returns at least one row. How can I make it to return 0 rows? Is it possible or not and how? Returning NULL does not help (return NULL string in 1 row). Not to return a value leads to error output. Many thanks for help Tomas

[GENERAL]

2007-05-18 Thread Tomas Macek
archar and it always returns at least one row. How can I make it to return 0 rows? Is it possible or not and how? Returning NULL does not help (return NULL string in 1 row). Not to return a value leads to error output. Many thanks for help Tomas

[GENERAL] how to return 0 rows in function

2007-05-18 Thread Tomas Macek
archar and it always returns at least one row. How can I make it to return 0 rows? Is it possible or not and how? Returning NULL does not help (return NULL string in 1 row). Not to return a value leads to error output. Many thanks for help Tomas

Re: [GENERAL] how to return 0 rows in function

2007-05-18 Thread Tomas Macek
On Fri, 18 May 2007, Richard Huxton wrote: Tomas Macek wrote: Hi, I have simplified function like this: CREATE OR REPLACE FUNCTION f(varchar) RETURNS varchar AS $FUNC$ DECLARE addr ALIAS FOR $1; BEGIN -- return NULL; -- return ''; END $FUNC$ LANGUAG

Re: [GENERAL] Query is not using index when it should

2004-12-11 Thread Tomas Skäre
Stephan Szabo <[EMAIL PROTECTED]> writes: > On Fri, 10 Dec 2004, Tomas [iso-8859-1] Skäre wrote: > > > I have a table that looks like this: > > > > Table "public.cjm_object" > > Column | Type| Modifiers > > --

[GENERAL] Query is not using index when it should

2004-12-10 Thread Tomas Skäre
ut it gives the same result, except that the estimated cost is higher. I have also done a vacuum full analyze, and I have reindexed the database, the table and the index. I have dropped the index and recreated it, but it still gives the same result. Please, could someone give me a clue to this? Tom

[GENERAL] Sounds silly ...

2006-03-22 Thread Tomas Lanczos
ted. During the installation the installer tried to create an acocunt, but than it gave an errormessage that the account already exists and the installation rolled back. Do somebody have a similar problem or do have somebody a suggestion what to do? Can I somehow remove this account? Thank You in

[GENERAL] export from views

2006-04-13 Thread Tomas Lanczos
Hello everybody, I am quite a newbie in the database business, so sorry for stupid questions. Is there any convenient and simple method/tool to export data from views to file, something like COPY TO (file) from a table? I am using WinXP and Postgresql 8.1. Many thanks in advance Tomas

[GENERAL] Postgres on WinXP - app on Cygwin

2006-04-27 Thread Tomas Lanczos
I am curious, whether is it possible to connect to a PostgreSQL database installed on WinXP for an application installed on the same box but running in the Cygwin environment (the app. is the GRASS GIS). many thanx Tomas ---(end of broadcast

Re: [GENERAL] timestamp to int

2001-06-30 Thread Tomas Berndtsson
will trillich <[EMAIL PROTECTED]> writes: > On Tue, Jun 26, 2001 at 09:22:25PM +0200, Tomas Berndtsson wrote: > > Is there a way to do it the other way around, from an integer to a > > timestamp? > > of course not. don't be silly. > > certainly not date_p

Re: [GENERAL] timestamp to int

2001-07-01 Thread Tomas Berndtsson
Alex Pilosov <[EMAIL PROTECTED]> writes: > On 30 Jun 2001, Tomas Berndtsson wrote: > > > > certainly not date_part or to_char or to_date. they're not > > > mentioned in the docs, either, so don't bother looking. > > > (think of the time you&#

[GENERAL] connection failed in threaded application

2001-09-05 Thread Tomas Berndtsson
application. I have set the systems SHMMAX to 16MB instead of the default 1MB. Has anyone seen this happen before, or know why it could happen? The fact that 11 threads succeeds sounds very strange to me. Greetings, Tomas ---(end of broadcast)--

[GENERAL] Stored procedures from MS Query

2003-10-28 Thread Tomas Larsson
alled getStudents(). How do we get around this? We would be very grateful for any help! /tomas, Patrik and Siv. __ Do you Yahoo!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/ ---(end of broa

Re: [GENERAL] Stored procedures from MS Query

2003-10-28 Thread Tomas Larsson
Thanks Shridhar! Works like a charm! /tomas, Patrik and Siv. --- Shridhar Daithankar <[EMAIL PROTECTED]> wrote: > On Tuesday 28 October 2003 16:06, Tomas Larsson > wrote: > > Hi! > > > > We're trying to call a set-returning stored > procedure > > fro

Re: [GENERAL] Simple Question: Case sensitivity

2000-12-11 Thread Tomas Berndtsson
case-insensitive? If you have an index, but use upper() in the select, the index is not used. Tomas

[GENERAL] Is it possible to recover the schema from the raw files?

2016-04-23 Thread Tomas J Stehlik
important in this case. Thank you in advance for any insight into such a topic. Kind regards, Tomas -- 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] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
Hello Venkata, Thank you for your reply. You are stating the obvious though. If those conditions were met, I would have formulated my question differently. Kind regards, Tomas -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
d, is that the case? Yes. The database server's files were not damaged. > What happened if you connected to another database in the cluster? That's irrelevant. That said, some were damaged and some not. Kind regards, Tomas -- Sent via pgsql-general mailing list (pgsql-general

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
Please note that I mentioned previously that the database is corrupt. "pg_class" table can be queried but it is not possible to dump the database in question as some of the pages in blocks are missing. In this case, it is necessary to rely on raw files only. Thanks. T -- Sent via pgsql-gener

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
, Tomas -- 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] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
uestion potentially targets someone who could tell whether something like this is possible. Kind regards, Tomas -- 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] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
information is *largely* intact - yet the small missing amount is causing PostgreSQL not being able to work with this particular database. Kind regards, Tomas -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.o

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
out. All this relevant information has already been supplied previously. Kind regards, Tomas -- 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] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
d to cover the system information then I am > not sure how it would be possible to recover information from 0? This is an incorrect assumption. Most of the information is available. Just the PostgreSQL server can't work with it [because of the missing bits]. Kind regards, Tomas --

Re: [GENERAL] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
r tools in order > to make some of the schema dumpable. This is actually a very interesting idea. Kind regards, Tomas -- 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] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
dest regards, Tomas -- 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] Is it possible to recover the schema from the raw files?

2016-04-24 Thread Tomas J Stehlik
Hello Adrian, > Then I am of no further use to this conversation. No problem at all. Thank you for your well considered input and ideas. Have a lovely day. Kindest regards, Tomas -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscript

[GENERAL] listen/notify

2000-07-12 Thread Tomas B. Winkler
Hi Could someone, please give me a little example on how to use listen/notify mechanism. Or at least point me to some more legible documentation. What I particulary need is that my frontend application is notified on update/insert in a table. Thanx a lot. Tomas Winkler The System Group CSE HUJI

RE: [GENERAL] PSQL Problem

2000-03-13 Thread Tomas TPS Ulej
> On Sun, Mar 12, 2000 at 04:52:15PM +0100, Tomas TPS Ulej wrote: > > root@[master /usr/ports/databases/p5-DBI] # psql setup > > Connection to database 'setup' failed. > > connectDB() -- connect() failed: No such file or directory > > Is the postmaster

<    1   2   3   4