Re: [GENERAL] tsearch partial word

2006-04-18 Thread Hannes Dorbath
On 17.04.2006 21:48, Yudie Pg wrote: Is it possible to search partial word as *like '%...%'* in tsearch? You can create a table with all the unique lexems (see pg_trgm doc on how to do that) use LIKE %% on it, join the matching lexems with | in your ts_query.. It works ok as long as the cou

Re: [GENERAL] select with date_part and month failure....

2006-04-18 Thread A. Kretschmer
am 18.04.2006, um 9:20:50 +0200 mailte P.MO folgendes: > > > Hello > > I have the same problem against various PostgreSQL 8.1.3, 8.0.2 and 7.4.7: > > I have a table containing periodical invoices. it contain's the last time the > invoce was printed and a period in month to be waited before n

Re: [GENERAL] HUGE Stack space is gettiing consumed

2006-04-18 Thread Martijn van Oosterhout
On Tue, Apr 18, 2006 at 12:31:57PM +0530, Mavinakuli, Prasanna (STSD) wrote: > Hello Martijin, > Thx for u'r Suggetions.. > > Here is Complete source code.. Ok, I can't get it to fail. I cleaned up the code because it wouldn't compile as is (g++ 3.3.5 on Debian). I've put the cleaned up version h

Re: [GENERAL] select with date_part and month failure....

2006-04-18 Thread Alban Hertroys
A. Kretschmer wrote: am 18.04.2006, um 9:20:50 +0200 mailte P.MO folgendes: Hello I have the same problem against various PostgreSQL 8.1.3, 8.0.2 and 7.4.7: I have a table containing periodical invoices. it contain's the last time the invoce was printed and a period in month to be waited be

[GENERAL] Thoughts on a Isolation/Security problem.

2006-04-18 Thread Achilleus Mantzios
Hi, i have run into the following problem. Let me describe the context first. When i joined the company(ies) i work for (a group of Shipping Mgmt/ Owenship/Agent companies), the only thing i was told when i started designing the DB/Apps was just one company. So i built everything into one single

Re: [GENERAL] [JDBC] Thoughts on a Isolation/Security problem.

2006-04-18 Thread Markus Schaber
Hi, Achilleus, Achilleus Mantzios wrote: > Now i am thinking of restructuring the whole architecture as: > - Create one EAR app for every mgmt company > - Create one DB USER for every mgmg company > - Create one SCHEMA (same as the USER) for every mgmt company > (mgmtcompany1,mgmtcompany2,etc...

Re: [GENERAL] [SQL] Thoughts on a Isolation/Security problem.

2006-04-18 Thread Luckys
how about having a company table, and company_code column across all relevant table, although you'll have to modify your application also, which would be an additional clause in the WHERE condition e.g where company_code = 'which company user has logged in'. The user has to specify while logging u

Re: [GENERAL] [JDBC] Thoughts on a Isolation/Security problem.

2006-04-18 Thread Achilleus Mantzios
O Markus Schaber έγραψε στις Apr 18, 2006 : > Hi, Achilleus, > > Achilleus Mantzios wrote: > > > Now i am thinking of restructuring the whole architecture as: > > - Create one EAR app for every mgmt company > > - Create one DB USER for every mgmg company > > - Create one SCHEMA (same as the USER

Re: [GENERAL] [SQL] Thoughts on a Isolation/Security problem.

2006-04-18 Thread Achilleus Mantzios
O Luckys έγραψε στις Apr 18, 2006 : > how about having a company table, and company_code column across all > relevant table, although you'll have to modify your application also, which > would be an additional clause in the WHERE condition e.g where company_code > = 'which company user has logged

Re: [GENERAL] [JDBC] Thoughts on a Isolation/Security problem.

2006-04-18 Thread Markus Schaber
Hi, Achilleus, Achilleus Mantzios wrote: [schema trickery] > Why do you think its ugly after all? It is not ugly to split such things via schemas per se, but it is ugly to use this schema trick together with a bunch of views, rules and triggers to "upgrade" a legacy single-deployment application

Re: [GENERAL] 21 bit number for sequence

2006-04-18 Thread Shoaib Mir
Thanks Dawid. I also used something similar to that kind of approach and its working for me./ShoaibOn 4/18/06, Dawid Kuroczko < [EMAIL PROTECTED]> wrote:On 4/15/06, Shoaib Mir <[EMAIL PROTECTED]> wrote: Actually that is the application requirment to use 21 bit numbers as porting it from Oracle wh

Re: [GENERAL] Curious UDP packets

2006-04-18 Thread Magnus Hagander
> > > omega kernel: Shorewall:all2all:REJECT:IN= OUT=lo SRC=x.x.x.x > > > DST=x.x.x.x LEN=1016 TOS=0x00 PREC=0x00 > > > TTL=64 ID=21629 DF PROTO=UDP SPT=32769 DPT=32769 LEN=996 > > > > The PostgreSQL stats collector uses UDP over a random > loopback port. > > It should normally use localhost, t

[GENERAL] i have a core file on running gdb the op

2006-04-18 Thread surabhi.ahuja
  this is the op on running gdb.   Is it possible that i can send the core file?       Type "show copying" to see the conditions.There is absolutely no warranty for GDB.  Type "show warranty" for details.This GDB was configured as "i386-redhat-linux-gnu"...(no debugging symbols found)...    

Re: [GENERAL] Syntax Help Requested -- RESOLVED

2006-04-18 Thread Rich Shepard
On Mon, 17 Apr 2006, Tom Lane wrote: You didn't show us any attempt to create anything in contacts ... To tie off the end of this thread, the application scripts have mixed case names as well as no primary key values in some tables. The developers can now see exactly what changes are necessa

Re: [GENERAL] Vacuuming of indexes on tables.

2006-04-18 Thread Tom Lane
elein <[EMAIL PROTECTED]> writes: > Much later in the day, a vacuum analyze of the > db showed that all of the indexes for that table > required significant vacuuming, although the > table did not. What do you mean by that exactly? If it's just that the index pages emptied by one VACUUM aren't

[GENERAL] Query to check existence of stored procedure?

2006-04-18 Thread Alexander Scholz
Hi Newsgroup, I need a query which can check for the existence of a certain stored procedure. (The pendant for MS SQL is IF EXISTS (SELECT * FROM "sysobjects" WHERE "id" = object_id(N'"MyTestStoredProcedure"') and OBJECTPROPERTY("id", N'IsProcedure') = 1) ... ) Any help would be appreciated! :-

[GENERAL] recovery with pg_xlog

2006-04-18 Thread jayati . biswas
We want to prepare a backup machine (for disaster management) by passing only the ARCHIVEDIR directory from another online machine - both the machines have Postgresql installed. We have sent PGLOG and ARCHIVEDIR but the recovery is not successful unless we send the FULL DATA Directory. Is it po

[GENERAL] Give me some suggestion

2006-04-18 Thread usanee tuangrathooradee
Hello,    I 'm a new  postgresql user and now I have some problem about it.    I'm not sure this problem is a bug of postgresql or not.    My problem is I have to read a text file ,processing and keep it into database.    Each text file is about 50,000 records, the process can be insert,update and

Re: [GENERAL] HUGE Stack space is gettiing consumed

2006-04-18 Thread Mavinakuli, Prasanna (STSD)
Hello Martijin, Thx for u'r Suggetions.. Here is Complete source code.. Desc about following code Code has a function named as queryDB, which makes a connection to our DB and then tries to query Particular table which has huge string in it's field. If this method called from main thread th

Re: [GENERAL] Query to check existence of stored procedure?

2006-04-18 Thread Nikolay Samokhvalov
select proname from pg_catalog.pg_proc where proname = 'my_proc_name'; On 4/18/06, Alexander Scholz <[EMAIL PROTECTED]> wrote: > Hi Newsgroup, > > I need a query which can check for the existence of a certain stored > procedure. > > (The pendant for MS SQL is > > IF EXISTS (SELECT * FROM "sysobjec

Re: [GENERAL] Query to check existence of stored procedure?

2006-04-18 Thread A. Kretschmer
am 18.04.2006, um 8:26:49 +0200 mailte Alexander Scholz folgendes: > Hi Newsgroup, > > I need a query which can check for the existence of a certain stored > procedure. proname in pg_proc. select count(*) from pg_proc where proname = 'your_function'; HTH, Andreas -- Andreas Kretschmer(K

Re: [GENERAL] i have a core file on running gdb the op

2006-04-18 Thread Tom Lane
"surabhi.ahuja" <[EMAIL PROTECTED]> writes: > (gdb) bt > #0 0xe410 in ?? () > #1 0x426c2d17 in ?? () > #2 0x0820d40a in yycheck () > #3 0x080a56be in cookDefault () > #4 0x080a59b1 in RelationTruncateIndexes () > #5 0x080a608b in UpdateIndexRelation () > #6 0x080a2b97 in recordDependency

Re: [GENERAL] Give me some suggestion

2006-04-18 Thread Alban Hertroys
usanee tuangrathooradee wrote: Hello, I 'm a new postgresql user and now I have some problem about it. I'm not sure this problem is a bug of postgresql or not. My problem is I have to read a text file ,processing and keep it into database. Each text file is about 50,000 records, the

Re: [GENERAL] Query to check existence of stored procedure?

2006-04-18 Thread Jim Buttafuoco
don't forget about schema's, you will need to join with pg_namespace.oid and pg_proc.pronamespace -- Original Message --- From: "A. Kretschmer" <[EMAIL PROTECTED]> To: pgsql-general@postgresql.org Sent: Tue, 18 Apr 2006 16:14:25 +0200 Subject: Re: [GENERAL] Query to check existen

[GENERAL] Using pg_dump and pg_restore

2006-04-18 Thread Mark
Hi I am looking for some help here. I have 2 servers, one as master and one as a "warm spare". The master server runs 4 postgres DBs. Our intention (until we can get full replication and syncing between postgres DBs) is to regularly dump all DBs on the master, copy them to the warm spare

Re: [GENERAL] Using pg_dump and pg_restore

2006-04-18 Thread Tom Lane
Mark <[EMAIL PROTECTED]> writes: > So far we have tried normal switches on the end of pg_dump, including > -Fc, -c, C, with corresponding switches on the pg_restore command. When > the restore actually executes, it does not fully drop the DB prior to > restoration so any test tables added to th

[GENERAL] Weird error updating table

2006-04-18 Thread Brendan Duddridge
Hi,Today we received a very odd error from our PostgreSQL database:"update category_product set product_is_active = p.is_active, product_status_code = p.status_code from product p where category_product.product_id = p.product_id  and category_id = 1001415;">:    Next exception:SQL State:XX000 -- er

Re: [GENERAL] Thoughts on a Isolation/Security problem

2006-04-18 Thread Marc Munro
You are talking about row-level security. Different users must be able to see different subsets of data. This sounds like a job for Veil: http://veil.projects.postgresql.org/ Veil allows you to implement row-level access controls based upon any criteria you can define. In your case, this woul

Re: [GENERAL] [JDBC] [SQL] Thoughts on a Isolation/Security problem.

2006-04-18 Thread Mark Lewis
On Tue, 2006-04-18 at 14:32 +0300, Achilleus Mantzios wrote: > Thanx for your thoughts, but this would require touching > 173 tables + > 2,594 SQL statements in a sum of 324 programs (which sum into 125,085 > lines of code) We did a very similar conversion to the one proposed here a couple of ye

Re: [GENERAL] Vacuuming of indexes on tables.

2006-04-18 Thread elein
On Tue, Apr 18, 2006 at 09:50:04AM -0400, Tom Lane wrote: > elein <[EMAIL PROTECTED]> writes: > > Much later in the day, a vacuum analyze of the > > db showed that all of the indexes for that table > > required significant vacuuming, although the > > table did not. > > What do you mean by that e

Re: [GENERAL] Weird error updating table

2006-04-18 Thread Tom Lane
Brendan Duddridge <[EMAIL PROTECTED]> writes: > Next exception:SQL State:XX000 -- error code: 0 -- msg: ERROR: > could not read from hash-join temporary file: Unknown error: 0 > Any one know what that could mean? It seems to imply unexpected end-of-file while reading from a temp file ... u

Re: [GENERAL] Vacuuming of indexes on tables.

2006-04-18 Thread Tom Lane
elein <[EMAIL PROTECTED]> writes: > The order of events seems to be vacuum indexes and then vacuum the > table. Wouldn't we get more bang if we vacuumed the table and then > the indexes? No, the problem is that we can't recycle removed index pages until we are certain there are not any transactio

[GENERAL] PostgreSQL and the OCFS2 filesystem

2006-04-18 Thread Ploski, Karen L
Title: PostgreSQL and the OCFS2 filesystem The change log for Kernel Stable Build 2.6.16 indicates that OCFS2 has been integrated into the kernel. (See http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.16  and http://www.linux-watch.com/news/NS3447236466.html). I've searched the Po

[GENERAL] Partial indexes

2006-04-18 Thread elein
In 8.1.2. Table contains columns: keyp1 not null, keyp2 not null, keyp3 nullable. The queries will be separated into two kinds: one on those rows where keyp3 is null and the second on where keyp3 is not null. I think I want to: create unique index pk on table tbl (keyp1, keyp2);

Re: [GENERAL] PostgreSQL and the OCFS2 filesystem

2006-04-18 Thread Tom Lane
"Ploski, Karen L" <[EMAIL PROTECTED]> writes: > Now that OCFS2 is part of the kernel, the licensing issue would seem to > have been put to rest. Exactly how do you think that changes its GPL status? > Does the fact that OCFS2 is now part of the > kernel help reduce the size of the work effort req

Re: [GENERAL] Partial indexes

2006-04-18 Thread Tom Lane
elein <[EMAIL PROTECTED]> writes: > I think I want to: > create unique index pk on table tbl (keyp1, keyp2); > create unique index range on table tbl (keyp1, keyp2, keyp3) where > keyp3 is not null; > Are these indexes redundant given uniqueness requirement and the type of > queries

[GENERAL] Bulk inserts within a Perl script?

2006-04-18 Thread Kynn Jones
I have a Perl script that is supposed to make a large number of inserts in a PostgreSQL database.  Performing individual inserts with SQL's INSERT command is too slow, however, I can use a "COPY ... from stdin" approach that is fast enough.  Basically, I fork a psql process (yes, I'm on unix) and h

Re: [GENERAL] Bulk inserts within a Perl script?

2006-04-18 Thread Steve Atkins
On Apr 18, 2006, at 4:03 PM, Kynn Jones wrote: I have a Perl script that is supposed to make a large number of inserts in a PostgreSQL database. Performing individual inserts with SQL's INSERT command is too slow, however, I can use a "COPY ... from stdin" approach that is fast enough. B

Re: [GENERAL] Bulk inserts within a Perl script?

2006-04-18 Thread Tom Lane
"Kynn Jones" <[EMAIL PROTECTED]> writes: > So I'm back at the drawing board. How can I make fast bulk inserts into a > PostgreSQL database from within a Perl script? The simplest and most effective thing you can do is to wrap many inserts into a single transaction block. After that, if you're us

Re: [GENERAL] Bulk inserts within a Perl script?

2006-04-18 Thread Teodor Sigaev
$dbi->do("COPY TABLE FROM stdin;"); for(;;) { $dbi->func( "$idd\t$tid\n", 'putline'); } $dbi->func("\\.\n", 'putline'); $dbi->func('endcopy'); I don't known what about modern versions of DBI and DBD::Pg, but it worked at 2001 year :) Kynn Jones wrote: I have a Perl script that is suppose

Re: [GENERAL] Partial indexes

2006-04-18 Thread Florian G. Pflug
Tom Lane wrote: elein <[EMAIL PROTECTED]> writes: I think I want to: create unique index pk on table tbl (keyp1, keyp2); don't you want create unique inde pk on table tbl (keyp1, keyp2) where keyp3 is null here? create unique index range on table tbl (keyp1, keyp2, keyp3) wher

Re: [GENERAL] PostgreSQL and the OCFS2 filesystem

2006-04-18 Thread Christopher Browne
Martha Stewart called it a Good Thing when [EMAIL PROTECTED] ("Ploski, Karen L") wrote: > The change log for Kernel Stable Build 2.6.16 indicates that OCFS2 has been > integrated into the kernel. > > (See http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.16  and > http://www.linux-watch.c

Re: [GENERAL] Partial indexes

2006-04-18 Thread elein
On Wed, Apr 19, 2006 at 03:51:27AM +0200, Florian G. Pflug wrote: > Tom Lane wrote: > >elein <[EMAIL PROTECTED]> writes: > >>I think I want to: > >>create unique index pk on table tbl (keyp1, keyp2); > don't you want > create unique inde pk on table tbl (keyp1, keyp2) where keyp3 is null > here

Re: [GENERAL] Weird error updating table

2006-04-18 Thread Brendan Duddridge
Hi Tom, We actually have plenty of storage free. Our database server is connected to an Xserve RAID. Filesystem Size Used Avail Capacity Mounted on /dev/disk1s3745G21G 725G 3%/Volumes/nitro1.1 /dev/disk2s3745G 4.1G 741G 1%/Volumes/nitro1.2 We store the

[GENERAL] Categories and Sub Categories (Nested)

2006-04-18 Thread Martin Kuria
Hi, I have a postgresql database Table Categories which has the structure like this Cat_ID | Parent_ID | Name 1 | 0 | Automobiles 2 | 0 | Beauty & Health 3 | 1 | Bikes 4 | 1 | Cars 5 | 3 | Suzuki 6 | 3 | Yamaha 7 | 0 | Clothes According to the above Databa

Re: [GENERAL] catch SQLException, error code for Foeign key violation,

2006-04-18 Thread surabhi.ahuja
Title: Re: [GENERAL] catch SQLException, error code for Foeign key violation, Thanks . in java i can catch SQL Exception,    what is the way to capture such exception in Cpp, are there any examples available for this?   right now in cpp, i do this   rStatus = PQresultStatus(result);   but

Re: [GENERAL] Thoughts on a Isolation/Security problem

2006-04-18 Thread Achilleus Mantzios
O Marc Munro έγραψε στις Apr 18, 2006 : > You are talking about row-level security. Different users must be able > to see different subsets of data. > > This sounds like a job for Veil: http://veil.projects.postgresql.org/ > > Veil allows you to implement row-level access controls based upon