[GENERAL] help

2006-04-06 Thread karthick muthu
hello hai, I am new to linux,now i have a job to maintain database using postgre in debian,so i want to know the completebasic details about how to use this. thanking you

[GENERAL] how to select second heigest salary...

2006-04-06 Thread deepak pal
hi how to select second heigest salary from employeetable field are id,name ,salary...plz help-- Deepak PalSoftware DeveloperWicenet ltd.Pune(M.H)

Re: [GENERAL] how to select second heigest salary...

2006-04-06 Thread A. Kretschmer
am 06.04.2006, um 10:19:21 +0530 mailte deepak pal folgendes: hi how to select second heigest salary from employee table field are id,name ,salary...plz help *untested* select id, name, salary from employee order by salary desc limit 1 offset 1;

Re: [GENERAL] help

2006-04-06 Thread Paolo Sala
karthick muthu scrisse in data 04/06/06 07:54: hello hai, I am new to linux,now i have a job to maintain database using postgre in debian,so i want to know the completebasic details about how to use this. thanking you There are very useful manual online: http://www.postgresql.org/docs/

Re: [GENERAL] full join question...

2006-04-06 Thread Jonas F. Henriksen
Thanks Tom, that worked great!! Regards Jonas:)) On Wed, 2006-04-05 at 15:09 -0400, Tom Lane wrote: Jonas F. Henriksen [EMAIL PROTECTED] writes: Well, the problem is I want the result on one row for each depth, so it will fit nicely into a table, like this: depth measuretype1_value

Re: [GENERAL] % tsearch gendict

2006-04-06 Thread Teodor Sigaev
$ ./config.sh config.sh : bad sustitution Simple workaround: take dictionary generated on Gentoo. I'll look at the problem, but I suspect that reason is a difference with Sun and GNU environment (echo, sed and so on). -- Teodor Sigaev E-mail: [EMAIL

Re: [GENERAL] [Slightly OT] data model books/resources?

2006-04-06 Thread Michael Glaesemann
On Apr 1, 2006, at 0:19 , Robert Treat wrote: On Thursday 30 March 2006 03:03, Aaron Glenn wrote: Anyone care to share the great books, articles, manifestos, notes, leaflets, etc on data modelling they've come across? Ideally I'd like to find a great college level book on data models, but I

[GENERAL] pgcrypto-crypt

2006-04-06 Thread AKHILESH GUPTA
dear all, i want to encrypt and decrypt one of the fields in my table (i.e-password field) i have searched and with the help of pgcrypto package, using function crypt, i am able to encrypt my data, but there is nothing which i found to decrypt that same data, plz anybody give me the function to

Re: [GENERAL] pgcrypto-crypt

2006-04-06 Thread chris smith
On 4/6/06, AKHILESH GUPTA [EMAIL PROTECTED] wrote: dear all, i want to encrypt and decrypt one of the fields in my table (i.e-password field) i have searched and with the help of pgcrypto package, using function crypt, i am able to encrypt my data, but there is nothing which i found to

Re: [GENERAL] stored proc vs sql query string

2006-04-06 Thread Sean Davis
On 4/6/06 12:12 AM, surabhi.ahuja [EMAIL PROTECTED] wrote: i have heard somewhere that writing a stored procedure, is much better than firing a sql query(such as select * from table_name) onto the database. is it true and if yes how? This isn't going to be true most of the time, I think.

[GENERAL] autovacuum settings

2006-04-06 Thread Jebus
I am totally new to postgres and I wondering what settings should I be using for autovacuum ? For now I just uncommented all the defaults, is this good enough ? The database is not large but it is a web database so there is a lot of inserts and updates. autovacuum = on #

Re: [GENERAL] Why postgres install requires physical access to

2006-04-06 Thread Andrus
There's always VNC: http://www.realvnc.com/ That way Windows won't know you're not sitting in front of it, and if you've got to access it from across the country on a linux or BSD or MAC box, it still works. VNC requires additional port to be opened. I have no free opened ports in W2K

[GENERAL] Userid error

2006-04-06 Thread Dick Kniep
Hi list, We are using Linux SuSE 9.3 with psycopg 1.18 and postgresql 7.4.8. Sometimes we get the following error message on varying queries: 2006-01-18 13:19:17,807 ERROR SQLDict 185 Fout in Select ERROR:  user with ID 322 does not exist SELECT per_id, per_naam1, per_naam2,

Re: [GENERAL] stored proc vs sql query string

2006-04-06 Thread Merlin Moncure
i have heard somewhere that writing a stored procedure, is much better than firing a sql query(such as select * from table_name) onto the database. is it true and if yes how? stored procedures (functions on postgresql) eliminate a lot of overhead. they also provide a lot of covenience of

Re: [GENERAL] stored proc vs sql query string

2006-04-06 Thread Kenneth Downs
Merlin Moncure wrote: It has been more or less proven that functional, declaritive style coding has less errors and is more reliable than mixed sql/procedural applciation code given developers with equal skill. I did not know there were empirical studies on this, I would love to be able to

Re: [GENERAL] FAQ 1.1

2006-04-06 Thread Jim Nasby
On Apr 3, 2006, at 11:23 PM, Chris Browne wrote: [EMAIL PROTECTED] (Jim Nasby) writes: On Mar 31, 2006, at 4:17 AM, Dave Page wrote: Given the tendency people have to remove the capitalised bits to get 'postgre', we'd probably end up with 'ostres' Man I hate when people do that. I think we

[GENERAL] Upcalls (sort of) from the database

2006-04-06 Thread Don Y
Hi, I wasn't prepared to ask this question, yet : but all the talk of stored procedures, etc. suggests this might be a good time to venture forth... Humor me: assume I have done the analysis and *know* this to be correct for my situation : I want to embed a good deal of the invariant

Re: [GENERAL] Upcalls (sort of) from the database

2006-04-06 Thread Bernhard Weisshuhn
Don Y wrote: Hi, I wasn't prepared to ask this question, yet : but all the talk of stored procedures, etc. suggests this might be a good time to venture forth... Humor me: assume I have done the analysis and *know* this to be correct for my situation : I want to embed a good deal of the

Re: [GENERAL] Upcalls (sort of) from the database

2006-04-06 Thread Don Y
Bernhard Weisshuhn wrote: Don Y wrote: [snip] For example, the title may match an existing entry -- but the author may be different (e.g., misspelled, or some other author listed on a book having multiple authors, etc.). Ideally, I would like the database to suspend the INSERT, ask for

Re: [GENERAL] Upcalls (sort of) from the database

2006-04-06 Thread Dawid Kuroczko
On 4/6/06, Don Y [EMAIL PROTECTED] wrote: For example, the title may match an existing entry -- butthe author may be different (e.g., misspelled, or someother author listed on a book having multiple authors, etc.).Ideally, I would like the database to suspend the INSERT, ask for confirmation (and

Re: [GENERAL] stored proc vs sql query string

2006-04-06 Thread Chris Browne
[EMAIL PROTECTED] (surabhi.ahuja) writes: i have heard somewhere that writing a stored procedure, is much better than firing a sql query(such as select * from table_name) onto the database. is it true and if yes how? It can be way more efficient. Consider two alternative ways of handling

[GENERAL] Database lost after reboot

2006-04-06 Thread Diego Manilla Suárez
Hi. I have PostgreSQL 7.4.8 installed on a SuSE Enterprise Server 9. When I create a database, everything works fine until I restart the computer. When I do that, and I try to connect to the database, I get the following message; psql: FATAL: database mydb does not exist DETAIL: The

[GENERAL] Debian package for freeradius_postgresql module

2006-04-06 Thread lmyho
Hello All, We have a project which is built on postgresql and freeradius on debian system. I have installed postgresql-8.1 on the Debian system, and lately freeradius-1.1.0 also. Things seems ok, but when we started to test, we found that the postgresql module of freeradius is missing in the

[GENERAL] Unique constraint or index, case insensitive, on multiple fields

2006-04-06 Thread MargaretGillon
I am on version 7.3. I have been able to build a case insensitive index to keep the refullname column unique with the following: CREATE UNIQUE INDEX resource_refullname ON resource USING btree (upper(refullname) text_ops); However I have a table where I want to allow a duplicate refullname if

Re: [GENERAL] Backup method

2006-04-06 Thread Guy Fraser
On Wed, 2006-05-04 at 22:29 +0100, Simon Riggs wrote: On Wed, 2006-04-05 at 15:42 -0400, Bob Powell wrote: I have a systems admin that is backing up our Linux computers (postgres) by backing up the directory structure. This of course includes all the files that pertain to my postgres

Re: [GENERAL] Database lost after reboot

2006-04-06 Thread Tom Lane
=?ISO-8859-1?Q?Diego_Manilla_Su=E1rez?= [EMAIL PROTECTED] writes: Hi. I have PostgreSQL 7.4.8 installed on a SuSE Enterprise Server 9. When I create a database, everything works fine until I restart the computer. When I do that, and I try to connect to the database, I get the following

Re: [GENERAL] Upcalls (sort of) from the database

2006-04-06 Thread Eric E
Don Y wrote: Hi, I wasn't prepared to ask this question, yet : but all the talk of stored procedures, etc. suggests this might be a good time to venture forth... Humor me: assume I have done the analysis and *know* this to be correct for my situation : I want to embed a good deal of the

Re: [GENERAL] Unique constraint or index, case insensitive, on multiple fields

2006-04-06 Thread Tom Lane
[EMAIL PROTECTED] writes: CREATE UNIQUE INDEX resource_refullname ON resource USING btree (redtid, (upper(refullname) text_ops)); You need something newer than PG 7.3 to do that. 7.3 can't handle functional indexes with more than one column. There are many other good reasons to upgrade

[GENERAL] plgpsql and transactions

2006-04-06 Thread Bill Moseley
In a BEFORE INSERT trigger, depending on input values, I need to lock a table and do a few selects. Of course, the lock table isn't much use if not currently in a transaction. So my question is this: can I tell if I'm inside a transaction or not and issue a BEGIN if not. And then also set a

[GENERAL] The dangers of long running open transactions

2006-04-06 Thread Wayne Schroeder
Summary: Long running transaction from an orphaned database connection caused major slowness on very active and frequently vacuumed tables because vacuum could not remove rows that were newer than the long running transaction. A while ago, I asked for opinions on the effects of long running

Re: [GENERAL] Unique constraint or index, case insensitive, on multiple

2006-04-06 Thread MargaretGillon
Tom Lane [EMAIL PROTECTED] wrote on 04/06/2006 11:33:57 AM: [EMAIL PROTECTED] writes: CREATE UNIQUE INDEX resource_refullname ON resource USING btree (redtid, (upper(refullname) text_ops)); You need something newer than PG 7.3 to do that. 7.3 can't handle functional indexes with more

Re: [GENERAL] plgpsql and transactions

2006-04-06 Thread Terry Lee Tucker
On Thursday 06 April 2006 02:36 pm, Bill Moseley saith: In a BEFORE INSERT trigger, depending on input values, I need to lock a table and do a few selects. Of course, the lock table isn't much use if not currently in a transaction. So my question is this: can I tell if I'm inside a

Re: [GENERAL] Backup method

2006-04-06 Thread Douglas McNaught
Guy Fraser [EMAIL PROTECTED] writes: How do you suggest one does PITR ? It has been a while since I read the Docs, but do not recall any tools that allow one to do such a thing. PITR went in to 8.0 (IIRC); the docs for that version will cover it. -Doug ---(end of

[GENERAL] About checking all dead lock tables

2006-04-06 Thread Emi Lu
Hello, How to check whether a table is locked? Is there a way that I can find all deadlocks under postgresql 8.0.1 ? Thanks alot! Ying Lu ---(end of broadcast)--- TIP 6: explain analyze is your friend

[GENERAL] Running Command Line From Trigger?

2006-04-06 Thread Yudie Pg
I want to execute a command line from trigger function. The reason is I want to execute myperl script from stored procedure. any idea? Yudie

Re: [GENERAL] Running Command Line From Trigger?

2006-04-06 Thread Terry Lee Tucker
On Thursday 06 April 2006 03:48 pm, Yudie Pg saith: I want to execute a command line from trigger function. The reason is I want to execute my perl script from stored procedure. any idea? Yudie Yudie, You might want to write your perl script as a trusted perl funcion and call from your

[GENERAL] Queries with Regular Expressions

2006-04-06 Thread Silas Justiniano
Hello! My queries work fine with Regular Expressions, as: SELECT field FROM table WHERE field ~ 'something'; SELECT field FROM table WHERE field ~* 'something'; SELECT field FROM table WHERE field ~* 'som[i,e]thing'; And it works fine for special characters: SELECT field FROM table WHERE field

Re: [GENERAL] Running Command Line From Trigger?

2006-04-06 Thread Scott Marlowe
On Thu, 2006-04-06 at 14:48, Yudie Pg wrote: I want to execute a command line from trigger function. The reason is I want to execute my perl script from stored procedure. Why not just install perl as a procedural language? It's one of a dozen or more available to you. Then you can write

%Re: [GENERAL] % tsearch gendict

2006-04-06 Thread David Gama Rodrí­guez
Teodor Sigaev wrote: $ ./config.sh config.sh : bad sustitution Simple workaround: take dictionary generated on Gentoo. I'll look at the problem, but I suspect that reason is a difference with Sun and GNU environment (echo, sed and so on). Thank you Teodor What I did was run config.sh

Re: [GENERAL] Queries with Regular Expressions

2006-04-06 Thread John D. Burger
But I just can't make it work correctly using brackets: SELECT field FROM table WHERE field ~* 'ch[aã]o'; It just returns tuples that have 'chao', but not 'chão'. My queries are utf-8 an the database is SQL_ASCII. I suspect the bracketed expression is turning into [aXY], where XY is the

Re: [GENERAL] plgpsql and transactions

2006-04-06 Thread Bill Moseley
On Thu, Apr 06, 2006 at 01:44:57PM -0500, Terry Lee Tucker wrote: Triggers fire inside a transaction. Ah, thanks. Makes sense since each statement is in an implicit transaction. Granted, would help to see the trigger, but these are basically the same? -- fires a trigger that updates more

Re: [GENERAL] Upcalls (sort of) from the database

2006-04-06 Thread Scott Ribe
Ah, OK. More elegant. But, it still moves responsibility for this to the application layer, not the database, itself. I can't see any way of avoiding this :-( Sure, I had a similar problem where newer data is required to specify certain fields, but a legacy application can't provide that

Re: [GENERAL] plgpsql and transactions

2006-04-06 Thread Terry Lee Tucker
On Thursday 06 April 2006 03:27 pm, Bill Moseley saith: On Thu, Apr 06, 2006 at 01:44:57PM -0500, Terry Lee Tucker wrote: Triggers fire inside a transaction. Ah, thanks. Makes sense since each statement is in an implicit transaction. Granted, would help to see the trigger, but these are

[GENERAL] posgresql - oracle

2006-04-06 Thread Mark Harrison
We're got the need to replicate (two-way) some data between postgresql and oracle. Does anybody have versions of pg_dump or equivalents that can go back and forth between the two databases? It would be great if I could get both --schema-only and --data-only functionality from this. Thanks! Mark

Re: [GENERAL] Queries with Regular Expressions

2006-04-06 Thread Tom Lane
John D. Burger [EMAIL PROTECTED] writes: My queries are utf-8 an the database is SQL_ASCII. I suspect the bracketed expression is turning into [aXY], where XY is the two-byte sequence corresponding to ã in UTF8. That's what it looks like to me. You can hardly blame the database for this,

Re: [GENERAL] Queries with Regular Expressions

2006-04-06 Thread Silas Justiniano
John, it worked completely fine! Thank you! I don't understand exactly the difference between [] and () for REs, but I'm starting to study them deeply. Thank you very much! Pg is great! On 4/6/06, John D. Burger [EMAIL PROTECTED] wrote: But I just can't make it work correctly using brackets:

Re: [GENERAL] Debian package for freeradius_postgresql module

2006-04-06 Thread Martijn van Oosterhout
On Thu, Apr 06, 2006 at 10:27:36AM -0700, lmyho wrote: After desperately checking, we were told that debian doesn't distribute the binary module of freeradius for postgresql because of the incompatible license of these two apps! However we can build the debian pkg from the source ourself if

[GENERAL] php to import csv to postgres

2006-04-06 Thread SunWuKung
I am not sure I should be posting this here, but I guess you are the people most likely be able to answer this. I have been looking for a user friendly php script to import csv into Postgres (set separator, preview data, match columns - or any of these). I found many for MySQL but none that

[GENERAL] recovering from a --clean dump

2006-04-06 Thread [EMAIL PROTECTED]
hello, I use an automated script that if it detects a problem in a database uses a dumb from another db to recover data. 'pg_dump -c -h host1 d1 | psql -a -h host2 -d db2 recover_dump 21' now my recover_dump tells me a unix index could`nt be created as the table contains duplicated keys. My

[GENERAL] encode/decode trouble ('invalid input syntax for type bytea'); bug?

2006-04-06 Thread Tobias Herp
Hi, I need to encrypt some fields in my database. The solution I came up with is: - create an additional field w/suffix _encr for every field which must be encrypted; - create update triggers which write the encrypted value into the new field and null into the original field (not null

Re: [GENERAL] case insensitive match in unicode

2006-04-06 Thread SunWuKung
In article [EMAIL PROTECTED], kleptog@svana.org says... On Mon, Mar 27, 2006 at 12:45:05PM +0200, SunWuKung wrote: This sounds like a very interesting concept. It wouldn't be 'case insensitive' just insensitive. The way I imagine it now is a special case of the ~ function. I create

Re: [GENERAL] Debian package for freeradius_postgresql module

2006-04-06 Thread lmyho
After desperately checking, we were told that debian doesn't distribute the binary module of freeradius for postgresql because of the incompatible license of these two apps! However we can build the debian pkg from the source ourself if we need. So Sounds terribly unlikely,

Re: [GENERAL] Debian package for freeradius_postgresql module

2006-04-06 Thread Tyler MacDonald
Martijn van Oosterhout kleptog@svana.org wrote: On Thu, Apr 06, 2006 at 10:27:36AM -0700, lmyho wrote: After desperately checking, we were told that debian doesn't distribute the binary module of freeradius for postgresql because of the incompatible license of these two apps! However

[GENERAL] Large text data

2006-04-06 Thread Antimon
Hi, I need to store text entries and i use text datatype. I want to ask if it will be better to split text and entry information? I mean, i can use a table like, (id, authorid, insertdate, editdate, threadid, textdata) or i can have an entrytexts table (id, entryid, textdata) and a foreign key on

Re: [GENERAL] Backup method

2006-04-06 Thread Guy Fraser
On Thu, 2006-06-04 at 15:21 -0400, Douglas McNaught wrote: Guy Fraser [EMAIL PROTECTED] writes: How do you suggest one does PITR ? It has been a while since I read the Docs, but do not recall any tools that allow one to do such a thing. PITR went in to 8.0 (IIRC); the docs for that

Re: [GENERAL] php to import csv to postgres

2006-04-06 Thread Chris
SunWuKung wrote: I am not sure I should be posting this here, but I guess you are the people most likely be able to answer this. I have been looking for a user friendly php script to import csv into Postgres (set separator, preview data, match columns - or any of these). I found many for

Re: [GENERAL] php to import csv to postgres

2006-04-06 Thread Scott Marlowe
On Thu, 2006-04-06 at 17:27, Chris wrote: SunWuKung wrote: I am not sure I should be posting this here, but I guess you are the people most likely be able to answer this. I have been looking for a user friendly php script to import csv into Postgres (set separator, preview data,

Re: [GENERAL] Cant find temp tables

2006-04-06 Thread Mike Adams
Dave Page wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: 03 April 2006 01:21 ...snip 2) pgAdmin uses a separate connection for query tool windows. Because temp tables exist only for the life of the session, if

Re: [GENERAL] Large text data

2006-04-06 Thread Scott Marlowe
On Thu, 2006-04-06 at 17:18, Antimon wrote: Hi, I need to store text entries and i use text datatype. I want to ask if it will be better to split text and entry information? I mean, i can use a table like, (id, authorid, insertdate, editdate, threadid, textdata) or i can have an entrytexts

Re: [GENERAL] posgresql - oracle

2006-04-06 Thread Joshua D. Drake
Mark Harrison wrote: We're got the need to replicate (two-way) some data between postgresql and oracle. Does anybody have versions of pg_dump or equivalents that can go back and forth between the two databases? It would be great if I could get both --schema-only and --data-only functionality

Re: [GENERAL] Debian package for freeradius_postgresql module

2006-04-06 Thread Chris
lmyho wrote: After desperately checking, we were told that debian doesn't distribute the binary module of freeradius for postgresql because of the incompatible license of these two apps! However we can build the debian pkg from the source ourself if we need. So Sounds terribly

Re: [GENERAL] programatic database dump

2006-04-06 Thread Michael Schmidt
I've been working on this issue lately. There is quite a bit more to a database than the tables (e.g., functions), and I'm not sure how you would go about getting a backup of the entire database through SQL. I've been working on a Java class to do the dump and restore. It doesn't look

Re: [GENERAL] About checking all dead lock tables

2006-04-06 Thread Michael Fuhr
On Thu, Apr 06, 2006 at 03:36:33PM -0400, Emi Lu wrote: How to check whether a table is locked? You can monitor locks by querying the pg_locks view. http://www.postgresql.org/docs/8.0/interactive/monitoring-locks.html http://www.postgresql.org/docs/8.0/interactive/view-pg-locks.html Only a few

Re: [GENERAL] Debian package for freeradius_postgresql module

2006-04-06 Thread Tom Lane
Chris [EMAIL PROTECTED] writes: This is the ref was given: The old / original BSD license is not compatible. http://www.gnu.org/licenses/license-list.html#GPLIncompatibleLicenses Anyway to change this?? So debian users can easily use postgresql and freeradius together... Changing the

Re: [GENERAL] PostgreSQL support on Redhat Advance Server 2.1

2006-04-06 Thread Jim Nasby
On Apr 4, 2006, at 12:45 PM, Tony Caduto wrote: You wrote Unfortunately Red Hat's backwards-compatibility policy forbids dropping new major PG releases into old RHEL branches. So that means I cannot upgrade to Postgresql 8.x on a RedHat9 server? Currently I am using Postgresql 7.3 but was

Re: [GENERAL] Column descriptions - could they be propagated to new tables?

2006-04-06 Thread Jim Nasby
On Apr 5, 2006, at 12:15 PM, Merlin Moncure wrote: On 4/5/06, Clive Page [EMAIL PROTECTED] wrote: Since I discovered the facilities in Postgres for providing and listing column descrptions, I have found them very useful, especially for adding a string showing physical units to my columns.

Re: [GENERAL] sort a referenced list

2006-04-06 Thread Jim Nasby
On Apr 4, 2006, at 3:22 PM, Matthew Peter wrote: Tom Lane [EMAIL PROTECTED] wrote: Matthew Peter writes: What I'm trying to do is create a function that accepts a list then sorts and groups the values (like in sql)... I will have an unique list I can convert it to an array later or leave it

Re: [GENERAL] MediaWiki and Postgresql?

2006-04-06 Thread Jim Nasby
On Apr 4, 2006, at 11:08 AM, Scott Marlowe wrote: On Mon, 2006-04-03 at 06:36, Markus Wollny wrote: Hi [EMAIL PROTECTED] wrote: Has anyone put MediaWiki up using the current version of Postgresql? I have, although our Mediawiki installation is currently not openly accessible. Can't say

Re: [GENERAL] How can i import .backup file into the database

2006-04-06 Thread Jim Nasby
On Apr 4, 2006, at 4:59 AM, venu gopal wrote: Dear List, I am trying to import tables from a file called choro.backup.I have created a db called dhis.Is this not possible to import data from a .backup file.If it is not possible then how can i import the data into my database.Can you

Re: [GENERAL] autovacuum settings

2006-04-06 Thread Jim Nasby
On Apr 6, 2006, at 8:57 AM, Jebus wrote: I am totally new to postgres and I wondering what settings should I be using for autovacuum ? For now I just uncommented all the defaults, is this good enough ? The database is not large but it is a web database so there is a lot of inserts and updates.

Re: [GENERAL] [IDLE IN TRANSACTION] doing a remote pg_dump

2006-04-06 Thread Jim Nasby
On Apr 5, 2006, at 10:47 AM, Dick Wieland wrote: I'm running pgsql 8.1.3 and ran into an unexpected situation running pg_dump remotely. We have 2 LAN's situated some distance apart. I can run pg_dump against machine A on LAN1 from machine B on LAN1 with no problem. But if I try to run it from