[GENERAL] Weird unique constraint

2010-05-11 Thread Mike Christensen
I have the following constraint which almost works: ALTER TABLE ingredientforms ADD CONSTRAINT ingredientforms_UniqueIngredientForm UNIQUE(IngredientId, FormDisplayName); However, I want to allow rows that have the same IngredientId FormDisplayName /iff/ FormDisplayName is null. If FormDisplayNa

Re: [GENERAL] Pulling data from a constraint def

2010-05-11 Thread A. Kretschmer
In response to Gauthier, Dave : > I have a constraint defined on a table > > constraint design_style_is_invalid check (design_style in > ('rls','sdp','rf','ssa','rom','rpt','analog','sdprpt','clkdist','global')), > > Is there a way to get the valid values in the list from the metadata somehow

Re: [GENERAL] Pulling data from a constraint def

2010-05-11 Thread David Fetter
On Tue, May 11, 2010 at 06:38:59PM -0700, Gauthier, Dave wrote: > Hi: > > I have a constraint defined on a table > > constraint design_style_is_invalid check (design_style in > ('rls','sdp','rf','ssa','rom','rpt','analog','sdprpt','clkdist','global')), > > Is there a way to get the valid val

Re: [GENERAL] can function arguments have the type tablename.columnname%TYPE?

2010-05-11 Thread Sergey Konoplev
Hi, What is the main goal? Aren't you looking for a solution to simplify arguments declaration? If so then what about using this one: CREATE OR REPLACE FUNCTION totnrchange(t table1) RETURNS integer AS $BODY$ DECLARE tot integer; BEGIN select count(resnr) into tot from table1 where resnr =

[GENERAL] Question about Beta for Windows 64 bits

2010-05-11 Thread Luis Guillermo Dangel
Hi guys. I downloaded the windows installer for the Beta version, and noticed when installing that it was installing in the 32 bits program files folder. Is there an installer of PostgreSQL 64 bits for windows? Thanks. Luis

Re: [GENERAL] list of databases in C ? libpq ?

2010-05-11 Thread Reid Thompson
On 5/7/2010 1:48 PM, Alex Hunsaker wrote: On Fri, May 7, 2010 at 11:18, Joao Ferreira gmail wrote: Hello all, I need to write an application in C to read the list of databases currently in the server. very much like a "psql -l"... The first example in the online docs does exactly that... h

Re: [GENERAL] Pulling data from a constraint def

2010-05-11 Thread Josh Kupershmidt
On Tue, May 11, 2010 at 9:38 PM, Gauthier, Dave wrote: > I have a constraint defined on a table > > > > constraint design_style_is_invalid check (design_style in > ('rls','sdp','rf','ssa','rom','rpt','analog','sdprpt','clkdist','global')), > > > > Is there a way to get the valid values in the

[GENERAL] Pulling data from a constraint def

2010-05-11 Thread Gauthier, Dave
Hi: I have a constraint defined on a table constraint design_style_is_invalid check (design_style in ('rls','sdp','rf','ssa','rom','rpt','analog','sdprpt','clkdist','global')), Is there a way to get the valid values in the list from the metadata somehow? Specifically, when someone hits th

Re: [GENERAL] Run Vacuum Through JDBC

2010-05-11 Thread Scott Marlowe
On Mon, May 10, 2010 at 11:38 PM, Yan Cheng CHEOK wrote: > I was wondering, how can I check whether Vacuum operation had been executed > without problem? > > I use the following Java code to execute Vacuum operation > > final Statement st2 = connection.createStatement(); > st2.executeUpdate("VACU

Re: [GENERAL] Moving postgresql data to another computer

2010-05-11 Thread Scott Marlowe
On Tue, May 11, 2010 at 2:16 PM, Donald Catanzaro, PhD wrote: > Good Day All, > > I am a newbie to PostgreSQL and I recently installed it on my desktop > (Windows XP) I created a database fine and worked a bunch of queries.  I am > traveling now and I needed access to my database on my laptop (Win

Re: [GENERAL] Finding rows with text columns beginning with other text columns

2010-05-11 Thread Christoph Zwerschke
Am 10.05.2010 23:34 schrieb Alban Hertroys: > Thinking more on the issue, I don't see a way to prevent the nested > loop as there's no way to decide beforehand what part of the string to > index for b.txt. It depends on a.txt after all. Yes, that seems to be the gist of the matter. I just felt I

Re: [GENERAL] Moving postgresql data to another computer

2010-05-11 Thread Richard Broersma
On Tue, May 11, 2010 at 1:52 PM, Donald Catanzaro, PhD wrote: > Well, needless to say I naively copied the data over. > First off I did not stop the database server (thus violating > http://www.postgresql.org/docs/8.4/interactive/backup-file.html) and I am > not near my desktop.  Does that mean m

Re: [GENERAL] Moving postgresql data to another computer

2010-05-11 Thread Donald Catanzaro, PhD
Hi All, Well, needless to say I naively copied the data over. First off I did not stop the database server (thus violating http://www.postgresql.org/docs/8.4/interactive/backup-file.html) and I am not near my desktop. Does that mean my copy is in essence useless and I have to start over ?

[GENERAL] Moving postgresql data to another computer

2010-05-11 Thread Donald Catanzaro
Good Day All, I am a newbie to PostgreSQL and I recently installed it on my desktop (Windows XP). I am traveling now (laptop is Windows Vista) and I needed access to my database. So before I left, I installed PosgreSQL on the laptop and then copied the data in the PostgreSQL data directory over

Re: [GENERAL] Moving postgresql data to another computer

2010-05-11 Thread Richard Broersma
On Tue, May 11, 2010 at 1:16 PM, Donald Catanzaro, PhD wrote: > I am a newbie to PostgreSQL and I recently installed it on my desktop > (Windows XP) I created a database fine and worked a bunch of queries.  I am > traveling now and I needed access to my database on my laptop (Windows > Vista).  S

[GENERAL] Moving postgresql data to another computer

2010-05-11 Thread Donald Catanzaro, PhD
Good Day All, I am a newbie to PostgreSQL and I recently installed it on my desktop (Windows XP) I created a database fine and worked a bunch of queries. I am traveling now and I needed access to my database on my laptop (Windows Vista). So before I left, I installed PosgreSQL on the laptop

Re: [GENERAL] PostgreSQL 9.0 beta1 and pg_upgrade

2010-05-11 Thread Glen Barber
Bruce Momjian wrote: > Glen Barber wrote: > > Are there plans to have pg_upgrade available in the betas before 9.0 is > > released? > > > > Yes. It will be added to PG 9.0 CVS within 18 hours, and should be in > 9.0 beta2. I am in the middle of adding it to CVS now. > Fantastic news. Thank

Re: [GENERAL] PostgreSQL 9.0 beta1 and pg_upgrade

2010-05-11 Thread Bruce Momjian
Glen Barber wrote: > Hi, > > I was looking for the latest version of pg_migrator, and found in the latest > release notes [1] that this functionality will be in contrib for 9.0. The > 2010-04-30 snapshot of beta1 doesn't yet have pg_upgrade in contrib. > > I've had issues with pg_migrator on Fre

Re: [GENERAL] Run Vacuum Through JDBC

2010-05-11 Thread Kris Jurka
On Mon, 10 May 2010, Yan Cheng CHEOK wrote: I was wondering, how can I check whether Vacuum operation had been executed without problem? final Statement st2 = connection.createStatement(); st2.executeUpdate("VACUUM FULL ANALYZE VERBOSE"); st2.close(); Nothing print out at console. The re

[GENERAL] PostgreSQL 9.0 beta1 and pg_upgrade

2010-05-11 Thread Glen Barber
Hi, I was looking for the latest version of pg_migrator, and found in the latest release notes [1] that this functionality will be in contrib for 9.0. The 2010-04-30 snapshot of beta1 doesn't yet have pg_upgrade in contrib. I've had issues with pg_migrator on FreeBSD, similar to a bug report fil

Re: [GENERAL] can function arguments have the type tablename.columnname%TYPE?

2010-05-11 Thread Guillaume Lelarge
Le 11/05/2010 16:16, Tom Lane a écrit : > Guillaume Lelarge writes: >> Le 11/05/2010 10:28, Dino Vliet a écrit : >>> I'm writing a plpgsql function in pgadminIII and want to know if the >>> arguments can have the following type: >>> >>> tablename.columnname%TYPE > >> No, this construct is only a

Re: [GENERAL] deadlock on simple update

2010-05-11 Thread tv
Well, the reason why deadlock happen is usually uncoordinated access to the same resource - in this case the resouce is a database row. This has nothing to do with the complexity of the queries, but with the order of the updates. According to the log process 8253 waits for 8230, and 8230 waits for

Re: [GENERAL] Full Text Search : Parse date

2010-05-11 Thread Oleg Bartunov
On Tue, 11 May 2010, Micka?l DA ROCHA wrote: Hello, We have a document that contains a date (french date for example) : 28-04-2009 (28 April 2009) In the to_tsvector function, it is noted as : '-04':2 '-2009':3 '28':1 Is it possible to have something like that (a date) : '28-04-2009':1 Does

Re: [GENERAL] Subscription Mess...

2010-05-11 Thread Jerry LeVan
Begin forwarded message: > From: Jerry LeVan > Date: May 11, 2010 9:52:21 AM EDT > To: "pgsql-general@postgresql.org general" > Subject: Subscription Mess... > > Please excuse the intrusion... > > Last week, my subscription to pgsql-general quit coming to my mailbox... > > I logged into my

Re: [GENERAL] 8.3.7, 'cache lookup failed' for a table

2010-05-11 Thread Grzegorz Jaśkiewicz
Having seen that all previous problems went unresolved, heres a bit more info. The system is 32 bit, running on enterprise redhat 4.7. It is slony's slave node, so it will be hit with quite few updates. My guess is that it happened when we ere adding/removing slony to the system for Nth time (due t

Re: [GENERAL] can function arguments have the type tablename.columnname%TYPE?

2010-05-11 Thread Tom Lane
Guillaume Lelarge writes: > Le 11/05/2010 10:28, Dino Vliet a écrit : >> I'm writing a plpgsql function in pgadminIII and want to know if the >> arguments can have the following type: >> >> tablename.columnname%TYPE > No, this construct is only available *inside* a PL/pgsql function body. That

Re: [GENERAL] Workqueue performance

2010-05-11 Thread Tom Lane
Jason Armstrong writes: > My worker processes then 'LISTEN' for the appropriate NOTIFY, select > the rows from the fileworkqueue.job table according to the > 'filetype_id', and transfer them. After processing, it deletes the row > from the workqueue. > When we are processing without the workers r

[GENERAL] 8.3.7, 'cache lookup failed' for a table

2010-05-11 Thread Grzegorz Jaśkiewicz
I got that sort of error on 8.3.7 (can't upgrade really), is it something that can be easily resolved ? I do understand that OID is gone from the pg catalogue , but still in memory. Will restart of database help in this case ? Was it fixed in following revisions ?? (8.3.x, x>7). -- GJ -- Se

[GENERAL] Subscription Mess...

2010-05-11 Thread Jerry LeVan
Please excuse the intrusion... Last week, my subscription to pgsql-general quit coming to my mailbox... I logged into my account at postgresql.org and it showed that I was stilled subscribed. In desperation I changed my email address ( to my gmail account) and the subscription started arriving

Re: [GENERAL] Workqueue performance

2010-05-11 Thread Andy Colson
On 5/11/2010 3:28 AM, Jason Armstrong wrote: I have a performance question with a database workqueue I am working on. I have two tables, the first containing information about files, and the second is a workqueue table with 'jobs', intended for a worker process to transfer the files to another

[GENERAL] Full Text Search : Parse date

2010-05-11 Thread Mickaël DA ROCHA
Hello, We have a document that contains a date (french date for example) : 28-04-2009 (28 April 2009) In the to_tsvector function, it is noted as : '-04':2 '-2009':3 '28':1 Is it possible to have something like that (a date) : '28-04-2009':1 Does a Parser Token Type for date exists ? (« DD

[GENERAL] deadlock on simple update

2010-05-11 Thread Jiří Pavlovský
Hello, I have 8.4.2. I'm getting deadlock when multiple processes try to update a table. Strange is it is a simple table with no triggers firing etc. Just an id and a numerical field to update. So I'm at odds as to what could cause the deadlock? DETAIL: Process 8253 waits for ShareLock on tr

Re: [GENERAL] log database in which error occurs

2010-05-11 Thread Alexander Pyhalov
A. Kretschmer wrote: May 11 01:36:46 pgsql pgsql[73794]: [7-3] STATEMENT: select count(*) from forum_msg where grp_id=6709 (200 ok) ACCEPTED and is_blocked='f' Are there any ways to log database, to which invalid query was issued ? Sure: log_line_prefix = '%t ' # special v

Re: [GENERAL] can function arguments have the type tablename.columnname%TYPE?

2010-05-11 Thread Guillaume Lelarge
Le 11/05/2010 10:28, Dino Vliet a écrit : > [...] > I'm writing a plpgsql function in pgadminIII and want to know if the > arguments can have the following type: > > tablename.columnname%TYPE > No, this construct is only available *inside* a PL/pgsql function body. -- Guillaume. http://www.

[GENERAL] Workqueue performance

2010-05-11 Thread Jason Armstrong
I have a performance question with a database workqueue I am working on. I have two tables, the first containing information about files, and the second is a workqueue table with 'jobs', intended for a worker process to transfer the files to another machine: > create table log.file (id uuid, cre

[GENERAL] can function arguments have the type tablename.columnname%TYPE?

2010-05-11 Thread Dino Vliet
Hi people, I'm writing a plpgsql function in pgadminIII and want to know if the arguments can have the following type: tablename.columnname%TYPE If so, how do I accomplish this in pgadminIII as it doesn't allow me to change the arguments to this type. The function I'm writing looks like this:

Re: [GENERAL] log database in which error occurs

2010-05-11 Thread A. Kretschmer
In response to Alexander Pyhalov : > May 11 01:36:46 pgsql pgsql[73794]: [7-3] STATEMENT: select count(*) > from forum_msg where grp_id=6709 (200 ok) ACCEPTED and is_blocked='f' > > Are there any ways to log database, to which invalid query was issued ? Sure: log_line_prefix = '%t '

[GENERAL] log database in which error occurs

2010-05-11 Thread Alexander Pyhalov
Hello. We have postgresql 8.4 server with about 40 databases. Postgres logs error statements, but it's quite difficult to determine which users on which databases caused error. For example, this is a piece of log: May 11 01:36:46 pgsql pgsql[73794]: [7-1] ERROR: 42601: syntax error at or nea

[GENERAL] Re: Performance issues when the number of records are around 10 Million

2010-05-11 Thread venu madhav
On May 11, 12:03 pm, andreas.kretsch...@schollglas.com ("A. Kretschmer") wrote: > In response to venu madhav : > > > > > Hi all, > >        In my database application, I've a table whose records can > > reach 10M and insertions can happen at a faster rate like 100 > > insertions per second in the p

Re: [GENERAL] initdb fails on Centos 5.4 x64

2010-05-11 Thread Alex Hunsaker
On Mon, May 10, 2010 at 18:04, Tom Lane wrote: > valentin.hoc...@kabelbw.de (Valentin Hocher) writes: >> [ cPanel's "Shell Fork Bomb Protection" actually does this: ] >>         ulimit -n 100 -u 20 -m 20 -d 20 -s 8192 -c 20 -v 20 >> 2>/dev/null > > Just to annotate that: some expe

Re: [GENERAL] Performance issues when the number of records are around 10 Million

2010-05-11 Thread Brian Modra
On 11/05/2010, Sergey Konoplev wrote: > On 11 May 2010 10:18, venu madhav wrote: >> select e.cid, timestamp, s.sig_class, s.sig_priority, s.sig_name, >> e.sniff_ip, e.sniff_channel, s.sig_config, e.wifi_addr_1, >> e.wifi_addr_2, e.view_status, bssid FROM event e, signature s WHERE >> s.sig_id =

Re: [GENERAL] Run Vacuum Through JDBC

2010-05-11 Thread Craig Ringer
On 11/05/10 13:38, Yan Cheng CHEOK wrote: > I was wondering, how can I check whether Vacuum operation had been executed > without problem? > > I use the following Java code to execute Vacuum operation > > final Statement st2 = connection.createStatement(); > st2.executeUpdate("VACUUM FULL ANALYZ

Re: [GENERAL] peer-to-peer replication with Postgres

2010-05-11 Thread Craig Ringer
On 10/05/10 23:20, Vick Khera wrote: > On Sat, May 8, 2010 at 12:12 AM, Mike Christensen wrote: >> What's the best way to do this? Looks like something like pgPool >> might be what I want, but I haven't looked into it deeply yet. > > I don't think your requirement and postgres are consistent wit

Re: [GENERAL] initdb fails on Centos 5.4 x64

2010-05-11 Thread Craig Ringer
On 11/05/10 08:04, Tom Lane wrote: > valentin.hoc...@kabelbw.de (Valentin Hocher) writes: >> [ cPanel's "Shell Fork Bomb Protection" actually does this: ] >> ulimit -n 100 -u 20 -m 20 -d 20 -s 8192 -c 20 -v 20 >> 2>/dev/null > > Just to annotate that: some experimentation

Re: [GENERAL] Performance issues when the number of records are around 10 Million

2010-05-11 Thread A. Kretschmer
In response to venu madhav : > Hi all, >In my database application, I've a table whose records can > reach 10M and insertions can happen at a faster rate like 100 > insertions per second in the peak times. I configured postgres to do > auto vacuum on hourly basis. I have frontend GUI applic