[GENERAL] Unexplained lock creating table

2006-04-21 Thread Wes
I have a C application (libpq) that uses partitioning. I create parent tables 'header' and 'detail'. The application reads opens multiple connections, creates the child tables, and uses COPY to import the data: open connection 1 begin create table header_1 COPY into header_1 open conn

Re: [GENERAL] COPY command documentation

2006-04-21 Thread Bruce Momjian
I have added the following patch for 8.2 that suggests using E'' strings and doubling backslashes used as path separators, and backpatched the later suggestion to 8.1. Thanks. --- Oisin Glynn wrote: > I have driven myself t

Re: [GENERAL] Debian package for freeradius_postgresql module

2006-04-21 Thread Nicolas Baradakis
Tyler MacDonald wrote: > I see this continuining to be a problem for the postgresql community > given how many GPLed projects use libpq. freeradius might be fixable with a > change in their license, but for postgresql to continue to be reasonably > usable by GPLed projects, either OpenSSL's

Re: [GENERAL] Daylight Savings Time

2006-04-21 Thread Terry Lee Tucker
On Friday 21 April 2006 05:47 pm, Tom Lane <[EMAIL PROTECTED]> thus communicated: --> Terry Lee Tucker <[EMAIL PROTECTED]> writes: --> > I need to know if there is a convienient way of establishing whether DST is --> > active within a function dealing with adjusting timestamps to other time -->

Re: [GENERAL] Daylight Savings Time

2006-04-21 Thread Tom Lane
Terry Lee Tucker <[EMAIL PROTECTED]> writes: > I need to know if there is a convienient way of establishing whether DST is > active within a function dealing with adjusting timestamps to other time > zones. The problem is that if I have the following timestamp: > '04/21/2006 17:05 EDT' > and I us

[GENERAL] Daylight Savings Time

2006-04-21 Thread Terry Lee Tucker
Hello List: I need to know if there is a convienient way of establishing whether DST is active within a function dealing with adjusting timestamps to other time zones. The problem is that if I have the following timestamp: '04/21/2006 17:05 EDT' and I use the timezone() function in the followi

Re: [GENERAL] temp tables problem

2006-04-21 Thread Jim C. Nasby
On Thu, Apr 20, 2006 at 09:21:27PM -0700, [EMAIL PROTECTED] wrote: > just to add on that, there is only one user for the db. so both > application accesses use the same db username and password. the web app > automatically logs into the db in with the one username and password > for both remote and

Re: [GENERAL] Setup for large database

2006-04-21 Thread Jim C. Nasby
On Thu, Apr 20, 2006 at 06:02:17PM -0700, [EMAIL PROTECTED] wrote: > 1) How anal should I be about my hardware setup? I have about 15 300GB > 10K RPM SCSI drives, 4 of which I can directly attach to the server and > the rest one the FC array. Should I just put the OS and transaction > logs on the

Re: [GENERAL] Setup for large database

2006-04-21 Thread Jim C. Nasby
On Fri, Apr 21, 2006 at 11:34:00AM -0400, Vivek Khera wrote: > As for partitioning based on octet, you should look at your > distribution of addresses and decide if it scatters the data evenly > enough for you. A much more important question: how will you be querying the data? Partitioning is

Re: [GENERAL] IDT timezone

2006-04-21 Thread Brandon Metcalf
t == [EMAIL PROTECTED] writes: t> "Brandon Metcalf" <[EMAIL PROTECTED]> writes: t> > What is the best way to handle timestamps with a timezone of IDT? I t> > see that I could modify src/backend/utils/adt/datetime.c to support t> > IDT, but what is the best solution? t> Right at the moment,

Re: [GENERAL] IDT timezone

2006-04-21 Thread Tom Lane
"Brandon Metcalf" <[EMAIL PROTECTED]> writes: > What is the best way to handle timestamps with a timezone of IDT? I > see that I could modify src/backend/utils/adt/datetime.c to support > IDT, but what is the best solution? Right at the moment, that's the only solution. We've wanted for awhile t

Re: [GENERAL] A few questions about ltree

2006-04-21 Thread Stephan Szabo
On Fri, 21 Apr 2006, Alban Hertroys wrote: > Stephan Szabo wrote: > >>SQL> CREATE TABLE ltree_test (path ltree PRIMARY KEY REFERENCES > >>ltree_test(path)); > >>NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index > >>"ltree_test_pkey" for table "ltree_test" > >>CREATE TABLE > >>SQL> INS

Re: [GENERAL] A few questions about ltree

2006-04-21 Thread Teodor Sigaev
Is it really necessary to insert an 'empty' record for the root node? The 'a' record from my experiments seems to be quite suited for the task, unless I'm missing something. The root should be and it will be unremovable, because of foreign keys. But it can be, of course, not empty. alter

[GENERAL] IDT timezone

2006-04-21 Thread Brandon Metcalf
What is the best way to handle timestamps with a timezone of IDT? I see that I could modify src/backend/utils/adt/datetime.c to support IDT, but what is the best solution? Basically, I have an application where I'm grabbing the timezone from the output of date(1) and appending that to a timestamp

Re: [GENERAL] A few questions about ltree

2006-04-21 Thread Alban Hertroys
Stephan Szabo wrote: SQL> CREATE TABLE ltree_test (path ltree PRIMARY KEY REFERENCES ltree_test(path)); NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "ltree_test_pkey" for table "ltree_test" CREATE TABLE SQL> INSERT INTO ltree_test VALUES ('a'::ltree); INSERT 84117368 1 SQL> INSE

Re: [GENERAL] A few questions about ltree

2006-04-21 Thread Stephan Szabo
On Fri, 21 Apr 2006, Alban Hertroys wrote: > Teodor Sigaev wrote: > >> Maybe something along the lines of the following is possible?: > > > > Exact, it's for what ltree was developed. > > Cool, looks like it is what I need then. > > > contrib_regression=# select 'a.b.c' <@ 'a.b'::ltree; > > ?colu

Re: [GENERAL] Odd transaction timestamp sequence issue

2006-04-21 Thread Tom Lane
Jeff Amiel <[EMAIL PROTECTED]> writes: > I thought: > "Each transaction sees a snapshot (database version) as of its > starttime, no matter what other transactions are doing while it runs" That's a correct statement in SERIALIZABLE mode, but in the default READ COMMITTED mode, it's more complicat

Re: [GENERAL] A few questions about ltree

2006-04-21 Thread Alban Hertroys
Teodor Sigaev wrote: We've been experimenting with a table containing a branch 'a', 'a.b' and 'a.b.c', but deleting 'a.b' didn't cause a constraint violation. SQL> CREATE TABLE ltree_test (path ltree PRIMARY KEY REFERENCES ltree_test(path)); Sorry, only by using triggers on insert/delete/

Re: [GENERAL] Setup for large database

2006-04-21 Thread Vivek Khera
On Apr 20, 2006, at 9:02 PM, [EMAIL PROTECTED] wrote: 1) How anal should I be about my hardware setup? I have about 15 300GB 10K RPM SCSI drives, 4 of which I can directly attach to the server and the rest one the FC array. Should I just put the OS and transaction logs on the direct attac

Re: [GENERAL] Odd transaction timestamp sequence issue

2006-04-21 Thread Jeff Amiel
it is done using now() But what I don't understand is how the transaction that started first could 'see' the record that hadn't been changed yet by the initial update to 'COMPLETE'? I thought: "Each transaction sees a snapshot (database version) as of its starttime, no matter what other tr

Re: [GENERAL] Odd transaction timestamp sequence issue

2006-04-21 Thread Martijn van Oosterhout
On Fri, Apr 21, 2006 at 09:43:55AM -0500, Jeff Amiel wrote: > PostgreSQL 8.1.2 on i386-portbld-freebsd6.0, compiled by GCC cc (GCC) > 3.4.4 [FreeBSD] 20050518 > > We have triggers on each of our tables that create audit table entries > on each insert/update/delete. > The audit table (in additio

Re: [GENERAL] Triggers and Transactions

2006-04-21 Thread Terry Lee Tucker
On Thursday 20 April 2006 12:25 pm, "Chris Coleman" <[EMAIL PROTECTED]> thus communicated: --> Hi, --> --> I have a question about how much of a trigger is in a transaction. --> I've read the docs and googled around but can't seem to find a --> concrete answer. --> --> I have two triggers that are

Re: [GENERAL] A few questions about ltree

2006-04-21 Thread Teodor Sigaev
We've been experimenting with a table containing a branch 'a', 'a.b' and 'a.b.c', but deleting 'a.b' didn't cause a constraint violation. SQL> CREATE TABLE ltree_test (path ltree PRIMARY KEY REFERENCES ltree_test(path)); NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "ltree_t

Re: [GENERAL] Odd transaction timestamp sequence issue

2006-04-21 Thread Tom Lane
Jeff Amiel <[EMAIL PROTECTED]> writes: > For example, for id 210210 we have an audit trail that looks like this... > audit_idrecord_idwhen columnold_val > new_val > ----- --- --- > --- > 1

[GENERAL] Odd transaction timestamp sequence issue

2006-04-21 Thread Jeff Amiel
PostgreSQL 8.1.2 on i386-portbld-freebsd6.0, compiled by GCC cc (GCC) 3.4.4 [FreeBSD] 20050518 We have triggers on each of our tables that create audit table entries on each insert/update/delete. The audit table (in addition to containing information about the change that was made) contains a

Re: [GENERAL] psql: FATAL: missing or erroneous pg_hba.conf file

2006-04-21 Thread Tom Lane
Mark Sargent <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] ~]$ psql template1 > psql: FATAL: role "racket" does not exist > Which confuses me, as local all all trust should allow me to connect, > no? No, it allows you to claim that you are any database user you want to claim you are. The def

Re: [GENERAL] psql: FATAL: missing or erroneous pg_hba.conf file

2006-04-21 Thread Mark Sargent
Tom Lane wrote: That's short one "all": you need type, database, user, method columns (but no address column for "local"). Hi All, yes, Tom, you're correct. Someone mailed me directly(thank you), with a link to their site's tut on authentication, and I picked up on it straight away. Seems t

[GENERAL] Setup for large database

2006-04-21 Thread [EMAIL PROTECTED]
Couple of questions. I have a project that promises to generate a very large database of network-style data (think banners, flows, etc). I was fortunate enough to fall into some kick ass hardware (quad Opteron, 16GB RAM, 3+ TB of fibre channel HDs). As I'm still in the design phase, I was wonder

Re: [GENERAL] tomcat postgresql connectivity error

2006-04-21 Thread dsids
Yes I did a search on Google but it didnt give me any clues.. Although the database is now working fine. The only thing I did was to change the statement with which i created postgresql logfile... I would do./.../usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data >> /usr/local/pgs

[GENERAL] Notification EXTRA data

2006-04-21 Thread news.postgresql.org
sql-notify.html : Higher-level mechanisms can be built by using tables in the database to pass additional data (beyond a mere notification name) from notifier to listener(s). How ? root2=> select * from pg_listener ; relname | listenerpid | notification -+-+--

[GENERAL] temp tables problem

2006-04-21 Thread sconeek
hi all, i am working on a java based web application. this application connects to a postgres DB. now within some pages i am using temp tables to perform some calculation. when i access these pages locally it works fine. however when i access the web app remotely (as in over the web or on the netw

[GENERAL] Triggers and Transactions

2006-04-21 Thread Chris Coleman
Hi, I have a question about how much of a trigger is in a transaction. I've read the docs and googled around but can't seem to find a concrete answer. I have two triggers that are designed to work together, one is a before trigger and one is an after. If the before trigger succeeds then it will

Re: [GENERAL] temp tables problem

2006-04-21 Thread sconeek
just to add on that, there is only one user for the db. so both application accesses use the same db username and password. the web app automatically logs into the db in with the one username and password for both remote and local access. ---(end of broadcast)-

Re: [GENERAL] HUGE Stack space is gettiing consumed

2006-04-21 Thread Mavinakuli, Prasanna (STSD)
Hello Martijin, I am not able to make it ..Code what u sent is *not* giving desired result.. That is -when we try to fetch huge data in a thread routine it says "could not receive data from server: Error 0" If it was in main thread then it goes thorugh..I.e It's able to get the huge data. Envi

Re: [GENERAL] primary keys

2006-04-21 Thread Patrick TJ McPhee
In article <[EMAIL PROTECTED]>, Klint Gore <[EMAIL PROTECTED]> wrote: % works for me on version 8.1.3 % % SELECT attname % FROM pg_index %JOIN pg_class ON (indrelid = pg_class.oid) %JOIN pg_attribute ON (attrelid = pg_class.oid) % WHERE indisprimary IS TRUE %AND attnum = any(indkey)

Re: [GENERAL] psql: FATAL: missing or erroneous pg_hba.conf file

2006-04-21 Thread Tom Lane
Mark Sargent <[EMAIL PROTECTED]> writes: > # TYPE DATABASEUSERCIDR-ADDRESS METHOD > # "local" is for Unix domain socket connections only > local all trust That's short one "all": you need type, database, user, method columns (but no address column for "local").

Re: [GENERAL] How to replace rows in table so that foreign key rows

2006-04-21 Thread Stephan Szabo
On Fri, 21 Apr 2006, Andrus wrote: > > ... and there doesn't appear (for > > non-match partial constraints) seem to be a special case for the > > referenced row coming back into existance as far as I can tell either. > > > Or, if you're willing to patch, I think a first order approximation of > >

Re: [GENERAL] psql: FATAL: missing or erroneous pg_hba.conf file

2006-04-21 Thread Mark Sargent
Harald Armin Massa wrote: Mark, and what exactly is there in server log? LOG: missing field in file "/var/lib/pgsql/data/pg_hba.conf" at end of line 67 FATAL: missing or erroneous pg_hba.conf file HINT: See server log for details. psql: FATAL: missing or erroneous pg_hba.conf file

Re: [GENERAL] How to replace rows in table so that foreign key rows

2006-04-21 Thread Andrus
> ... and there doesn't appear (for > non-match partial constraints) seem to be a special case for the > referenced row coming back into existance as far as I can tell either. > Or, if you're willing to patch, I think a first order approximation of > what you want might be to remove the special ca

Re: [GENERAL] A few questions about ltree

2006-04-21 Thread Alban Hertroys
Teodor Sigaev wrote: Maybe something along the lines of the following is possible?: Exact, it's for what ltree was developed. Cool, looks like it is what I need then. contrib_regression=# select 'a.b.c' <@ 'a.b'::ltree; ?column? -- t (1 row) How would you use this to constrain a

Re: [GENERAL] setting the environment locale - linux, windows

2006-04-21 Thread Tomi NA
On 4/21/06, Martijn van Oosterhout wrote: > On Fri, Apr 21, 2006 at 03:34:27PM +0200, Tomi NA wrote: > > On 4/21/06, Martijn van Oosterhout wrote: > > > You need to look at your LC_COLLATE settings. LC_COLLATE and LC_CTYPE > > > are fixed at initdb and constant across the DB. > > > > So, if I wer

Re: [GENERAL] A few questions about ltree

2006-04-21 Thread Teodor Sigaev
That's the "classical" way, which is also used in our current implementation with integers instead of ltrees, but it's not very easy to query efficiently (at least ordering seems to remain a problem). That (with integer ids) is classic way to support graph structure, ltree was develop speciall

Re: [GENERAL] GiST index slower than seqscan

2006-04-21 Thread Teodor Sigaev
When I said full text, I meant substring. Please correct me if I am wrong, but tsearch would be useful for finding words in a paragraph, not characters in a word (or small group of words) ... If I had fields 'Hello World!', 'Low Tide', and 'Following Day' they would all be hits for a search on

Re: [GENERAL] setting the environment locale - linux, windows

2006-04-21 Thread Martijn van Oosterhout
On Fri, Apr 21, 2006 at 03:34:27PM +0200, Tomi NA wrote: > On 4/21/06, Martijn van Oosterhout wrote: > > You need to look at your LC_COLLATE settings. LC_COLLATE and LC_CTYPE > > are fixed at initdb and constant across the DB. > > So, if I were to backup my database, clear the data directory, > r

[GENERAL] A few questions about ltree

2006-04-21 Thread Alban Hertroys
Yesterday ltree was mentioned to be a good system for tree structured table data. I and a colleague of mine have been playing around with the examples and the (rather sparse) documentation, but we're stuck on a few questions... How does one guarantee referential integrity using ltrees? It does

Re: [GENERAL] setting the environment locale - linux, windows

2006-04-21 Thread Tomi NA
On 4/21/06, Martijn van Oosterhout wrote: > On Fri, Apr 21, 2006 at 12:49:31AM +0200, Tomi NA wrote: > > This is probably somewhat offtopic, but it does relate to postgresql so... > > Problem summary: I have a UTF-8 encoded database running on linux on > > which upper() and lower() string function

Re: [GENERAL] setting the environment locale - linux, windows

2006-04-21 Thread Martijn van Oosterhout
On Fri, Apr 21, 2006 at 12:49:31AM +0200, Tomi NA wrote: > This is probably somewhat offtopic, but it does relate to postgresql so... > Problem summary: I have a UTF-8 encoded database running on linux on > which upper() and lower() string functions ignore locale specific > characters. You need to

Re: [GENERAL] GiST index slower than seqscan

2006-04-21 Thread CG
--- Teodor Sigaev <[EMAIL PROTECTED]> wrote: > > In case you're unfamiliar with this particular horse, I'm using ltree to > create > > a full text index on some <= 50 char long fields for a lookup table. The > idea > > was to be able to tear through tons of data quickly finding case > insensitiv

Re: [GENERAL] psql: FATAL: missing or erroneous pg_hba.conf file

2006-04-21 Thread Harald Armin Massa
Mark,and what exactly is there in server log? psql: FATAL:  missing or erroneous pg_hba.conf file HINT:  See server log for details. Reading your words I assume you made a typing error while editing pg_hba.confHarald-- GHUM Harald Massapersuadere et programmareHarald Armin MassaReinsburgstraße 202

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

2006-04-21 Thread Jim Buttafuoco
nice, this could be put into a plpgsql function with error handling. -- Original Message --- From: "Jim C. Nasby" <[EMAIL PROTECTED]> To: Alexander Scholz <[EMAIL PROTECTED]> Cc: pgsql-general@postgresql.org Sent: Fri, 21 Apr 2006 00:54:51 -0500 Subject: Re: [GENERAL] Query to ch

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

2006-04-21 Thread Jim Buttafuoco
then this will not work. -- Original Message --- From: "Jim C. Nasby" <[EMAIL PROTECTED]> To: Jim Buttafuoco <[EMAIL PROTECTED]> Cc: Alexander Scholz <[EMAIL PROTECTED]>, pgsql-general@postgresql.org Sent: Fri, 21 Apr 2006 00:51:17 -0500 Subject: Re: [GENERAL] Query to check exist

Re: [GENERAL] How to replace rows in table so that foreign key rows

2006-04-21 Thread Stephan Szabo
On Thu, 20 Apr 2006, Stephan Szabo wrote: > On Thu, 20 Apr 2006, Andrus wrote: > > > I want to replace ( delete and insert) records in master table . > > I delete and insert record with same primary key. > > I want that foreign key records are not deleted. > > > > I tried > > > > begin; > > create

Re: [GENERAL] sudo-like behavior

2006-04-21 Thread Agent M
Sorry, but you misunderstand- nowhere am I interested in the role's password. My previous suggestion was to add a password to set session authorization itself so that if the authorization were to be reset, it would need to be done with that password; the password itself could be machine-generat

[GENERAL] psql: FATAL: missing or erroneous pg_hba.conf file

2006-04-21 Thread Mark Sargent
Hi All, new here, and pgsql in general. I currently use MySQL and now need to know pgsql. I have set it up on my Linux box, CentOS 4-3, using an RPM from Dag Wieer's repos. I am getting the following, [EMAIL PROTECTED] lib]$ psql template1 psql: FATAL:  missing or erroneous pg_hba.conf file HINT: