[GENERAL] Connections closing due to "terminating connection due to administrator command"

2015-07-27 Thread Herouth Maoz
Hello everybody. In the past week, it has happened to us twice already that we got an exception from our Java application, due to PostgreSQL "terminating connection due to administrator command”. The problem is that I’m the administrator, and I issued no such command. On the first opportunity

Re: [GENERAL] Connections closing due to "terminating connection due to administrator command"

2015-07-27 Thread Herouth Maoz
> On 27 ביולי 2015, at 16:39, Adrian Klaver wrote: >> >> * Given that I did not terminate any backend connection interactively, >>why did I get a "terminating connection due to administrator >>command” message? Is there any situation where this message is >>issued without the admin

Re: [GENERAL] Connections closing due to "terminating connection due to administrator command"

2015-07-27 Thread Herouth Maoz
> On 27 ביולי 2015, at 16:55, Melvin Davidson wrote: > > If you are running Linux (please ALWAYS give the O/S ), then this could have > been caused by the sys admin doing a system shutdown. Yes, sorry about that, as I previously answered Adrian Klaver, the OS is Debian Gnu/Linux 7. But I did

Re: [GENERAL] Connections closing due to "terminating connection due to administrator command"

2015-07-27 Thread Herouth Maoz
> On 27 ביולי 2015, at 18:01, Adrian Klaver wrote: > Not sure what yo have set up for logging, but you might to crank it up. 13 > days between entries for a system that is in use all the time seems sort of > light to me. Most of the log settings are just the Debian default (except the log pref

Re: *SOLVED* [GENERAL] Connections closing due to "terminating connection due to administrator command"

2015-07-28 Thread Herouth Maoz
> On 27 ביולי 2015, at 18:20, Tom Lane wrote: > > Herouth Maoz writes: >> So I’m left with the question of what caused the shutdown on July 21st. > > Well, you had > > 2015-07-21 15:37:59 IDT LOG: received fast shutdown request > > There is exactly on

[GENERAL] Adding more space, and a vacuum question.

2011-01-28 Thread Herouth Maoz
Hello. We have two problems (which may actually be related...) 1. We are running at over 90% capacity of the disk at one of the servers - a report/data warehouse system. We have ran out of disk space several times. Now we need to make some file-archived data available on the database to support

Re: [GENERAL] Adding more space, and a vacuum question.

2011-01-29 Thread Herouth Maoz
בתאריך 29/01/11 13:57, ציטוט Craig Ringer: On 01/29/2011 05:12 AM, Herouth Maoz wrote: The machine has no additional room for internal disks. It is a recent purchase and not likely to be replaced any time soon. Newly acquired or not, it sounds like it isn't sized correctly for the loa

Re: [GENERAL] Adding more space, and a vacuum question.

2011-01-30 Thread Herouth Maoz
On 30/01/2011, at 13:03, Alban Hertroys wrote: > On 28 Jan 2011, at 22:12, Herouth Maoz wrote: > >> 2. That database has a few really huge tables. I think they are not being >> automatically vacuumed properly. In the past few days I've noticed a vacuum >> process

Re: [GENERAL] Adding more space, and a vacuum question.

2011-01-30 Thread Herouth Maoz
On 30/01/2011, at 12:27, Craig Ringer wrote: > > OK, so you're pre-8.4 , which means you have the max_fsm settings to play > with. Have you seen any messages in the logs about the free space map (fsm)? > If your install didn't have a big enough fsm to keep track of deleted tuples, > you'd face

Re: [GENERAL] Adding more space, and a vacuum question.

2011-01-31 Thread Herouth Maoz
On 31/01/2011, at 03:49, Craig Ringer wrote: > For approaches to possibly fixing your problem, see: > > http://www.depesz.com/index.php/2010/10/17/reduce-bloat-of-table-without-longexclusive-locks/ > > http://blog.endpoint.com/2010/09/reducing-bloat-without-locking.html I'm not quite sure what

[GENERAL] Book recommendation?

2011-02-01 Thread Herouth Maoz
As a result of my recent encounter with table bloat and other tuning issues I've been running into, I'm looking for a good resource for improving my tuning skills. My sysadmin ran into the following book: PostgreSQL 9.0 High Performance, by Gregory Smith, ISBN 184951030X http://amzn.com/1849510

[GENERAL] What's canceling autovacuum tasks?

2011-02-06 Thread Herouth Maoz
Hi there. During the weekend I've worked for hours on recovering table bloat. Now I was hoping that after the tables are properly trimmed, then after the next delete operation which created dead tuples, autovacuum will go into effect and do its job properly, and prevent the situation from recu

Re: [GENERAL] What's canceling autovacuum tasks?

2011-02-06 Thread Herouth Maoz
on 06/02/11 18:16, quoting Tom Lane: Most likely, some other session requested an exclusive lock on the table. Autovacuum will quit to avoid blocking the other query. That's strange. During the day, only selects are running on that database, or at worst, temporary tables are being created

[GENERAL] Decreasing performance in table partitioning

2014-09-07 Thread Herouth Maoz
Hello all. I have created a function that partitions a large table into monthly partitions. Since the name of the table, target schema for partitions, name of the date field etc. are all passed as strings, the function is heavily based on EXECUTE statements. My problem is the main loop, in wh

Re: [GENERAL] Decreasing performance in table partitioning

2014-09-10 Thread Herouth Maoz
. > Rename old non-partition table to something else. > Rename new partition table to the correct name as you wanted. > > Drop old non-partition table if you’re satisfied with current table structure. > > Thanks, > Suya > From: pgsql-general-ow...@postgresql.org >

Re: [GENERAL] Decreasing performance in table partitioning

2014-09-10 Thread Herouth Maoz
that make sense? On 07/09/2014, at 19:50, Tom Lane wrote: > Herouth Maoz writes: >> My problem is the main loop, in which data for one month is moved from the >> old table to the partition table. > >>EXECUTE FORMAT ( >>'WITH del

Re: [GENERAL] (Solved) Decreasing performance in table partitioning

2014-09-16 Thread Herouth Maoz
how it behaves in older > versions… > > From: Herouth Maoz [mailto:hero...@unicell.co.il] > Sent: Wednesday, September 10, 2014 6:26 PM > To: Huang, Suya > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] Decreasing performance in table partitioning > > Thank you.

Re: [GENERAL] Partitioning of a dependent table not based on date

2014-12-02 Thread Herouth Maoz
On 01/12/2014, at 19:26, Andy Colson wrote: > On 12/1/2014 11:14 AM, Herouth Maoz wrote: >> I am currently in the process of creating a huge archive database that >> contains data from all of our systems, going back for almost a decade. >> >> Most of the tables fall

[GENERAL] Table partitioning

2013-10-28 Thread Herouth Maoz
I have a rather large and slow table in Postgresql 9.1. I'm thinking of partitioning it by months, but I don't like the idea of creating and dropping tables all the time. I'm thinking of simply creating 12 child tables, in which the check condition will be, for example, date_part('month'', time

Re: [GENERAL] Table partitioning

2013-10-28 Thread Herouth Maoz
: > On 2013-10-28 12:27, Herouth Maoz wrote: >> I have a rather large and slow table in Postgresql 9.1. I'm thinking of >> partitioning it by months, but I don't like the idea of creating and >> dropping tables all the time. >> >> I'm thinking of sim

Re: [GENERAL] Table partitioning

2013-10-28 Thread Herouth Maoz
makes for maintenance spaghetti. I also don't like running automated DDL commands. They don't play well with backups. -הודעה מקורית- מאת: Steve Crawford [mailto:scrawf...@pinpointresearch.com] נשלח: ב 28/10/2013 22:31 אל: Herouth Maoz; pgsql-general@postgresql.org נושא: Re: [GENER

[GENERAL] Question about optimizing access to a table.

2013-12-10 Thread Herouth Maoz
Hello. I have one particular table with very specialized use. I am sending messages to some partner. The partner processes them asynchronously, and then returns the status report to me. The table is used to store a serialized version of the message object, together with a few identifiers, expi

Re: [GENERAL] Question about optimizing access to a table.

2013-12-11 Thread Herouth Maoz
On 10/12/2013, at 20:55, Jeff Janes wrote: > > On Tue, Dec 10, 2013 at 8:23 AM, Herouth Maoz wrote: > > Hello. > > I have one particular table with very specialized use. I am sending messages > to some partner. The partner processes them asynchronously, and then returns

Re: [GENERAL] Question about optimizing access to a table.

2013-12-11 Thread Herouth Maoz
On 10/12/2013, at 20:55, Kevin Grittner wrote: > Herouth Maoz wrote: > >> The problem starts when our partner has some glitch, under high >> load, and fails to send back a few hundred thousand reports. In >> that case, the table grows to a few hundred records, and they

[GENERAL] How do I track down a possible locking problem?

2014-02-17 Thread Herouth Maoz
I have a production system using Postgresql 9.1.2. The system basically receives messages, puts them in a queue, and then several parallel modules, each in its own thread, read from that queue, and perform two inserts, then release the message to the next queue for non-database-related processi

Re: [GENERAL] How do I track down a possible locking problem?

2014-02-18 Thread Herouth Maoz
times per hour. The table normally contains around 2-3 million records, and has 3 indexes. Thank you, Herouth On 17/02/2014, at 18:45, Herouth Maoz wrote: > I have a production system using Postgresql 9.1.2. > > The system basically receives messages, puts them in a queue, and then

Re: [GENERAL] How do I track down a possible locking problem?

2014-02-19 Thread Herouth Maoz
On 18/02/2014, at 19:02, Jeff Janes wrote: > On Mon, Feb 17, 2014 at 8:45 AM, Herouth Maoz wrote: > I have a production system using Postgresql 9.1.2. > > The system basically receives messages, puts them in a queue, and then > several parallel modules, each in its own thread,

[GENERAL] Up-to-date reports database

2012-05-23 Thread Herouth Maoz
Hi guys, I'm interested in a solution that will allow our customers to run reports - which may involve complicated queries - on data which is as up-to-date as possible. One thing I don't want to do is to let the reporting system connect to the production database. I want the indexes in product

Re: [GENERAL] Up-to-date reports database

2012-05-23 Thread Herouth Maoz
On 23/05/2012, at 17:20, Chris Ernst wrote: > I would have a look at slony. It is a trigger based replication system > that allows you to replicate only the tables you define and you can have > different indexing on the slave. The only requirement is that each > table you want to replicate has

Re: [GENERAL] Up-to-date reports database

2012-05-23 Thread Herouth Maoz
On 23/05/2012, at 18:54, Bartosz Dmytrak wrote: > hi, > my suggestion is to redesign reporting database to fit reporting specifics > (e.g. brake normal form of database, in some cases this will speed up > reports). Than you can use some ETL tool to sync production and reporting. > Good thing i

[GENERAL] Why is an ISO-8859-8 database allowing values not within that set?

2012-07-21 Thread Herouth Maoz
I am using Postgresql 8.3.14 on our reporting system. There are scripts that collect data from many databases across the firm into this database. Recently I added tables from a particular database which has encoding UTF-8. My dump procedure says \encoding ISO-8859-8 \copy ( SELECT ... ) to file

Re: [GENERAL] Why is an ISO-8859-8 database allowing values not within that set?

2012-07-22 Thread Herouth Maoz
ith my encoding (asterisks or whatever). Thank you, Herouth On 21/07/2012, at 15:36, Craig Ringer wrote: > On 07/21/2012 04:59 PM, Herouth Maoz wrote: >> I am using Postgresql 8.3.14 on our reporting system. There are scripts that >> collect data from many databases across the firm into

[GENERAL] I want your opinion on how to do something.

2012-09-04 Thread Herouth Maoz
Basically, I have several production databases with various data, and I have a reports database that grabs all necessary data once a day. Now, there is is a new requirement to have some of the data available in the reports database as soon as it is inserted in the production database. Specifica

Re: [GENERAL] Maintaining a materialized view only on a replica

2012-09-05 Thread Herouth Maoz
> Subject changed to describe the problem. Reply in-line. > > On 09/04/2012 07:57 PM, Herouth Maoz wrote: > >> The issue is that when an insert or an update is fired, I can't say >> whether all the segments of the same transaction have been written yet, >> and i

[GENERAL] Index creation takes more time?

2012-09-09 Thread Herouth Maoz
We have tables which we archive and shorten every day. That is - the main table that has daily inserts and updates is kept small, and there is a parallel table with all the old data up to a year ago. In the past we noticed that the bulk transfer from the main table to the archive table takes a

[GENERAL] Is there a way to use "pack" in pl/perl without resorting to pl/perlu?

2012-09-12 Thread Herouth Maoz
I created a function that does some heavy string manipulation, so I needed to use pl/perl rather than pl/pgsql. I'm not experienced in perl, but the function works well when used as an independent perl subroutine - it depends only on its arguments. I use the Encode package (in postgresql config

Re: [GENERAL] Is there a way to use "pack" in pl/perl without resorting to pl/perlu?

2012-09-12 Thread Herouth Maoz
, which is basically what I needed for the time being. I suspect it's less efficient than unpack, and I hope the function I created won't be too slow for use inside a trigger. Thanks, Herouth On 12/09/2012, at 17:47, Tom Lane wrote: > Herouth Maoz writes: >> I created a functio

Re: [GENERAL] Index creation takes more time?

2012-09-17 Thread Herouth Maoz
s to run for an hour, and I'm sending this hour's worth of stats. I'm attaching the stats files in tarballs. I'm not sure what I'm supposed to look at. Thanks for your time, Herouth -הודעה מקורית- מאת: Craig Ringer [mailto:ring...@ringerc.id.au] נשלח: ב 17/09/2

Re: [GENERAL] Index creation takes more time?

2012-09-18 Thread Herouth Maoz
I think you hit the nail right on the head when you asked: > I wonder if they have different encoding/collations. [headdesk]Of course. One of the requirements of the upgrade was to change the database encoding to unicode, because previously it was in an 8-bit encoding and we couldn't handle int

Re: [GENERAL] Index creation takes more time?

2012-09-19 Thread Herouth Maoz
On 18/09/2012, at 20:19, Jeff Janes wrote: > I think the one below will show an even larger discrepancy. You are > doing 2 casts for each comparison, > so I think the casts overhead will dilute out the comparison. > > select count(distinct foo) from ( select cast(random() as varchar(14)) as foo

[GENERAL] Questions about connection clean-up and "invalid page header"

2010-01-24 Thread Herouth Maoz
Hi Everybody. I have two questions. 1. We have a system that is accessed by Crystal reports which is in turned controlled by another (3rd party) system. Now, when a report takes too long or the user cancels it, it doesn't send a cancel request to Postgres. It just kills the Crystal process tha

Re: [GENERAL] Questions about connection clean-up and "invalid page header"

2010-01-25 Thread Herouth Maoz
Scott Marlowe wrote: You can shorten the tcp_keepalive settings so that dead connections get detected faster. Thanks, I'll ask my sysadmin to do that. Might be, but not very likely. I and many others run pgsql in production environments where it handles thousands of updates / inserts per

Re: [GENERAL] Questions about connection clean-up and "invalid page header"

2010-01-25 Thread Herouth Maoz
Greg Stark wrote: On Mon, Jan 25, 2010 at 8:15 AM, Scott Marlowe wrote: Is there a parameter to set in the configuration or some other means to shorten the time before an abandoned backend's query is cancelled? You can shorten the tcp_keepalive settings so that dead connections get

Re: [GENERAL] Questions about connection clean-up and "invalid page header"

2010-01-25 Thread Herouth Maoz
Greg Stark wrote: On Mon, Jan 25, 2010 at 11:37 AM, Herouth Maoz wrote: The tcp_keepalive setting would only come into play if the remote machine crashed or was disconnected from the network. That's the situation I'm having, so it's OK. Crystal, being a Windows applica

[GENERAL] stopping processes, preventing connections

2010-03-03 Thread Herouth Maoz
whole server, and without causing any harm to the database or memory corruption? Something I can call from within SQL? I run the nightly script from a linux user which is not "postgres", so I'd prefer a way that doesn't require using "kill". Thank you, Herouth Maoz

Re: [GENERAL] stopping processes, preventing connections

2010-03-03 Thread Herouth Maoz
On Mar 3, 2010, at 18:01 , Josh Kupershmidt wrote: > > On Wed, Mar 3, 2010 at 8:31 AM, Herouth Maoz wrote: > > First, the easy part - regarding allowing/disallowing queries. Is it possible > to GRANT or REVOKE access to tables based on the originating IP? > > I

Re: [GENERAL] stopping processes, preventing connections

2010-03-17 Thread Herouth Maoz
On Mar 3, 2010, at 18:01 , Josh Kupershmidt wrote: > Though next time you see a query which doesn't respond to > pg_cancel_backend(), try gathering information about the query and what the > backend is doing; either you're doing something unusual (e.g. an app is > restarting the query automati

Re: [GENERAL] stopping processes, preventing connections

2010-03-17 Thread Herouth Maoz
On Mar 17, 2010, at 13:34 , Craig Ringer wrote: > On 17/03/2010 6:32 PM, Herouth Maoz wrote: >> >> On Mar 3, 2010, at 18:01 , Josh Kupershmidt wrote: >> >>> Though next time you see a query which doesn't respond to >>> pg_cancel_backend(), try gather

Re: [GENERAL] stopping processes, preventing connections

2010-03-17 Thread Herouth Maoz
On Mar 17, 2010, at 14:56 , Craig Ringer wrote: > On 17/03/2010 8:43 PM, Herouth Maoz wrote: >> >> On Mar 17, 2010, at 13:34 , Craig Ringer wrote: >> >>> On 17/03/2010 6:32 PM, Herouth Maoz wrote: >>>> >>>> On Mar 3, 2010, at 18:01 , Jo

Re: [GENERAL] stopping processes, preventing connections

2010-03-20 Thread Herouth Maoz
quoth Greg Smith: Herouth Maoz wrote: Aren't socket writes supposed to have time outs of some sort? Stupid policies notwithstanding, processes on the client side can disappear for any number of reasons - bugs, power failures, whatever - and this is not something that is supposed to ca

Re: [GENERAL] stopping processes, preventing connections

2010-03-20 Thread Herouth Maoz
? Scott Marlowe: On Sat, Mar 20, 2010 at 11:44 AM, Herouth Maoz wrote: The server version is 8.3.1. Migration to a higher version might be difficult as far as policies go, if there isn't a supported debian package for it, but if you can point out a version where this has been fi

[GENERAL] auto vacuum

2010-04-14 Thread Herouth Maoz
Hi all. We had a crisis this week that was resolved by tuning pg_autovacuum for a particular table. The table is supposed to contain a small number of items at any given point in time (typically around 10,000-30,000). The items are inserted when we send out a message, and are selected, then del

Re: [GENERAL] auto vacuum

2010-04-14 Thread Herouth Maoz
First, I'd like to thank Bill and Alvaro as well as you for your replies. Quoting Tom Lane: Hmm. Given the churn rate on the table, I'm having a very hard time believing that you don't need to vacuum it pretty dang often. Maybe the direction you need to be moving is to persuade autovac to vacu

Re: [GENERAL] auto vacuum

2010-04-14 Thread Herouth Maoz
ציטוט Bill Moran: In response to Herouth Maoz : Did I understand the original problem correctly? I thought you were saying that _lack_ of analyzing was causing performance issues, and that running vacuum analyze was taking too long and causing the interval between analyze runs to be too

[GENERAL] Lengthy deletion

2011-11-28 Thread Herouth Maoz
Hi. I was instructed to delete old records from one of the tables in our production system. The deletion took hours and I had to stop it in mid-operation and reschedule it as a night job. But then I had to do the same when I got up in the morning and it was still running. The odd thing about i

Re: [GENERAL] Lengthy deletion

2011-11-29 Thread Herouth Maoz
On 29/11/2011, at 09:13, Tom Lane wrote: > "Herouth Maoz" writes: >> I was instructed to delete old records from one of the tables in our >> production system. The deletion took hours and I had to stop it in >> mid-operation and reschedule it as a night job. Bu

[GENERAL] How do clients failover in hot standby/SR?

2012-02-01 Thread Herouth Maoz
We are looking at a replication solution aimed at high availability. So we want to use PostgreSQL 9's streaming replication/hot standby. But I seem to be missing a very basic piece of information: suppose the primary is host1 and the secondary is host2. Suppose that when host1 fails host2 detect

[GENERAL] Copy/delete issue

2008-12-17 Thread Herouth Maoz
I have a strange situation that occurs every now and again. We have a reports system that gathers all the data from our various production systems during the night, where we can run heavy reports on it without loading the production databases. I have two shell scripts that do this nightly transfe

Re: [GENERAL] Copy/delete issue

2008-12-21 Thread Herouth Maoz
Adrian Klaver wrote: > > > Are you sure the problem is not in "$datefield" = "*" . That the script that > formats the data file is not correctly adding "*" to the right file. Seems > almost like sometimes the second CMD is being run against the table that the > first CMD should be run on. In ot

Re: [GENERAL] Copy/delete issue

2008-12-23 Thread Herouth Maoz
Adrian Klaver wrote: > On Sunday 21 December 2008 1:49:18 am Herouth Maoz wrote: > >> Adrian Klaver wrote: >> >>> >>> >>> Are you sure the problem is not in "$datefield" = "*" . That the script >>> that formats the

[GENERAL] Slow update

2009-01-21 Thread Herouth Maoz
Hello. I have a daily process that synchronizes our reports database from our production databases. In the past few days, it happened a couple of times that an update query took around 7-8 hours to complete, which seems a bit excessive. This is the query: UPDATE rb SET service = b.service

Re: [GENERAL] Slow update

2009-01-21 Thread Herouth Maoz
Marc Mamin wrote: > Hello, > > - did you vacuum your tables recently ? > > - What I miss in your query is a check for the rows that do not need > to be udated: > > AND NOT (service = b.service >AND status = b.status > AND has_notification = gateway_id NOT IN (4,

Re: [GENERAL] Slow update

2009-01-21 Thread Herouth Maoz
Filip Rembiałkowski wrote: > > 1. which postgres version? 8.3.1 > 2. can you post results of EXPLAIN ANALYZE (please note it actually > executes the query)? > Well, if it executes the query it's a problem. I might be able to do so during the weekend, when I can play with the scripts and get away

Re: [GENERAL] Slow update

2009-01-21 Thread Herouth Maoz
Grzegorz Jaśkiewicz wrote: > On Wed, Jan 21, 2009 at 12:55 PM, Herouth Maoz wrote: > >> Well, if it executes the query it's a problem. I might be able to do so >> during the weekend, when I can play with the scripts and get away with >> failures, but of course the

Re: [GENERAL] Slow update

2009-02-09 Thread Herouth Maoz
Filip Rembiałkowski wrote: > > 2009/1/21 Herouth Maoz <mailto:hero...@unicell.co.il>> > > Hello. > > I have a daily process that synchronizes our reports database from > our production databases. In the past few days, it happened a > couple o

Re: [GENERAL] Slow update

2009-02-09 Thread Herouth Maoz
Grzegorz Jaśkiewicz wrote: > On Mon, Feb 9, 2009 at 12:50 PM, Herouth Maoz wrote: > >> I hope someone can clue me in based on the results of explain analyze. >> > > Did you have a chance to run vmstat on it, and post it here ? Maybe - > if db resides on the sam

Re: [GENERAL] Slow update

2009-02-15 Thread Herouth Maoz
Alban Hertroys wrote: > On Feb 9, 2009, at 2:07 PM, Grzegorz Jaśkiewicz wrote: > >> On Mon, Feb 9, 2009 at 12:50 PM, Herouth Maoz >> wrote: >>> I hope someone can clue me in based on the results of explain analyze. >> >> Did you have a chance to run vmstat

Re: [GENERAL] WWW: user gallery

1998-06-21 Thread Herouth Maoz
uch easier to fill, and it's not the sort of CGI that will draw 10,000 hits an hour... Just remember to make the ACTION a fully-qualified URL, so that the mirrors won't complain. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma

Re: [GENERAL] Emptying a database.

1998-10-13 Thread Herouth Maoz
ill be the best basis for the new production database. The "creation" script also has the benefit of being full of comments which explain what is hapenning, what the fields are, etc. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma

Re: [GENERAL] Making NULLs visible.

1998-10-13 Thread Herouth Maoz
| 200 30 | I am null! | 300 40 | David | 400 50 | I am null! | 500 And so on... So, if someone wants \N, he'll put '\\N' in the NVL function, and if they want NULL, they'll put 'NULL', etc. NVL will be usefull for lots of stuff... Not only for this... Hero

Re: [GENERAL] Emptying a database.

1998-10-13 Thread Herouth Maoz
) echo "Now restoring $table" psql $1 < $table.dmp end # # restore sequences # foreach seq ( $seqs ) echo "Now restoring sequence $seq" psql $1 < $seq.dmp ; end (Sorry, the first shell languague I learned is csh, so that's what I use).

Re: [GENERAL] datetime problems

1998-10-21 Thread Herouth Maoz
E the_date BETWEEN '1998-08-01' AND '1998-08-31'; Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma

Re: [GENERAL] datetime problems

1998-10-21 Thread Herouth Maoz
of the day. Better use: WHERE the_date >= '1998-08-01' AND the_date < '1998-09-01'; Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma

Re: [GENERAL] datetime problems

1998-10-21 Thread Herouth Maoz
'). Again, I recommend doing the >=, < thing rather than 'between', because 'between' will also allow the actual value of 1998-09-01 (for example) to be included. It's a close interval, rather than a half-open one. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma

Re: [GENERAL] datetime problems

1998-10-21 Thread Herouth Maoz
nverting integer to text.) Now, your queries will be something like: SELECT * FROM annex_log WHERE sunday_of_date( login_start ) = sunday_of_date( 'now' ); If a week doesn't start on Sunday in your culture, you'll have to take the result of the dow, add the appropriate number of da

[GENERAL] Re: [SQL] Reading and writing at the same time

1998-10-25 Thread Herouth Maoz
thus, each of the updates ani inserts in it is a separate transaction. When that happens, the reads (from your psql frontend) and the writes (from your C) are interspersed, because the lock only holds while a transaction is active. The next update in your C program may wait until the read in PSQL has b

Re: [GENERAL] Getting input from email...

1998-10-26 Thread Herouth Maoz
the line. The command can be any old script - in this case a script which parses its input (an email message) and places it in the appropriate tables of your database. That's how the "vacation" program works. Use "man forward" on your machine to see how to handle a .for

Re: [GENERAL] Expensive query

1998-11-01 Thread Herouth Maoz
ging to a NOT EXISTS rather than a NOT IN query would help: select id from users where NOT EXISTS ( select * from events where userid = id and code = 'some code' ) and NOT EXISTS ( select * from even

Re: [GENERAL] Case insensitive "contains" search

1998-11-09 Thread Herouth Maoz
in case-sensitive. (6 rows) testing=> select * from test2 where t ~* 'test'; t This is a mere test line Survival of the fittest is the Jungle Law. Testimony does not contain it in case-sensitive. (3 rows) Herouth -- Herouth Maoz,

Re: [GENERAL] PostgreSQL - multiuser.

1998-11-09 Thread Herouth Maoz
en I want to shut down or start up the postmaster. I use my own to create users and databases. And for the web server to access data, I grant permission to the specific tables within the database, which the web server needs to read/write, to the user "httpd" under which the webserver runs. So

Re: [GENERAL] Incrementing a Serial Field

1998-11-09 Thread Herouth Maoz
e \N (capital N) stands for null, and will cause Postgres to use the default value for that field. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma

Re: [GENERAL] alter table ?

1998-11-15 Thread Herouth Maoz
you can fill the "definition file" with comments which will help you understand what you meant a year afterwards. It's a tradition I kept from the time we used Oracle in one of my former jobs. I think it's a practice taught in basic Oracle training, but it's good for any dat

[GENERAL] Regression problem

1998-11-16 Thread Herouth Maoz
plpgsql .. failed Thanks, Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma

Re: [GENERAL] equivalent of sqlload?

1998-11-29 Thread Herouth Maoz
ave, though. Are you sure you dropped all the indices? When you declare a primary key it declares a unique index, so watch out for that as well. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma

Re: [GENERAL] Typecasting datetype as date. How do I cope withNULLs?

1998-11-29 Thread Herouth Maoz
| date +-- This year |01-02-1998 Next year |03-15-1999 Nothing | Last year |05-12-1997 More nothing| (5 rows) That is, convert to abstime, and then to date... Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma

Re: [GENERAL] Deadlock on Linux

1998-12-01 Thread Herouth Maoz
es, and its manpage explains all about deadlocks. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma

Re: [GENERAL] Backend cache invalidation initialization failed... HUH?

1998-12-06 Thread Herouth Maoz
h 6.3, which broke Solaris 2.5.1 compatibility. Which would mean that I'll have to say goodbye to Postgres, especially since the mailing lists (I posted mine to this [GENERAL] list as well as the ADMIN list and got no response of any kind). It would be a real shame. Herouth -- Herouth M

Re: [GENERAL] decimal_part() function

1998-12-15 Thread Herouth Maoz
's what you expect in the negative numbers, you're home free. If not, you can use some other operator combination. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma

Re: [GENERAL] Problem under FreeBSD 2.2.6

1998-05-20 Thread Herouth Maoz
html#2.5 I seem to recall that in addition to shared memory it also requires semaphores to be enabled in the kernel. Right or wrong? If right, should be added to the FAQ. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma

[GENERAL] Re: [INTERFACES][HACKERS] atttypmod now 32 bits, interface change

1998-07-15 Thread Herouth Maoz
ented (speaking from the point of view of a user who doesn't know what the plans are for 6.4, of course). Herouth (PS. This thread doesn't really have anything to do with the interfaces list, does it? I redirected the crosspost to "general".) -- Herouth Maoz, Internet developer

Re: [GENERAL] Re: Displaying Image BLOBs

1999-01-31 Thread Herouth Maoz
s useful for those who want to display database results on an HTML page. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma

Re: [GENERAL] viewing/editing function definitions

1999-01-31 Thread Herouth Maoz
- and this is that if you have a table that relies on this function for default or constraint, I think you'll run into a problem. This is probably because the new function definition has a different OID. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem proje

[GENERAL] A forward-compatible pg_dump?

1999-01-31 Thread Herouth Maoz
ll it dump grants as well? Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma

Re: [GENERAL] slow inserts and updates on large tables

1999-02-17 Thread Herouth Maoz
At 16:10 +0200 on 17/2/99, Jim Mercer wrote: > > > 3) Back to the issue of INSERTS - copies are faster. If you can transform > >the data into tab-delimited format as required by COPY, you save a lot > >of time on parsing, planning etc. > > this sorta defeats the purpose of putting the da

Re: [GENERAL] slow inserts and updates on large tables

1999-02-17 Thread Herouth Maoz
insert updated data back? (Assuming you don't have a separate update for each line). Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma

Re: [GENERAL] daily check for expired data ?

1999-03-14 Thread Herouth Maoz
At 22:48 +0200 on 11/3/99, Ralf Weidemann wrote: > > how could I do an automatic daily check > to delete some expired data ? I mean > can I have a cron functionality in post- > gresql ? You don't need to have cron functionality in postgresql when you have cron functionality in cron. :) What yo

Re: [GENERAL] The value returned by autoinc ?

1999-03-15 Thread Herouth Maoz
ession. That is, it won't work if you use it before the insertion (because the sequence didn't give you a number yet). It will also give you the correct number even if between the INSERT and the SELECT, another process or another connection also made an insert. Herouth -- Herouth Maoz

Re: [GENERAL] The value returned by autoinc ?

1999-03-15 Thread Herouth Maoz
you make the call to currval - the correct value is already available to you. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma

Re: [GENERAL] fork() bad

1999-03-22 Thread Herouth Maoz
the bottleneck is wider. You know, like you would treat any shared object in an inter-process environment? Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma

[GENERAL] Re: Why Postgres (was Re: [HACKERS] custom types and optimization)

1998-06-01 Thread Herouth Maoz
as all the interfaces we need, it supports transactions and locks, it is becoming more ANSI compatible with every version update, and it seems to perform well enough. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma

  1   2   >