[GENERAL] User privileges in web database applications

2006-06-29 Thread Antonis Christofides
Hi, Most web database applications I've seen use a system separate from the rdbms's user database for managing user privileges. For example, there may be a "users" table, or there may be external authentication with, say, LDAP. Or, for example, in MoinMoin (an extensible wiki, where apps can be

Re: [GENERAL] empty text fields

2006-06-29 Thread Alban Hertroys
Leif B. Kristensen wrote: 0 = before (date1), 1 = say (date1), 2 = ca. (date1), 3 = exact (date1), 4 = after (date1), 5 = between (date1) and (date2), 6 = (date1) or (date2), 7 = from (date1) to (date2). This kind of reeks like a begin/end date and an acc

Re: [GENERAL] Strange Behavior with Serializable Transcations

2006-06-29 Thread Simon Riggs
On Wed, 2006-06-28 at 21:20 +0200, Martijn van Oosterhout wrote: > On Wed, Jun 28, 2006 at 02:48:01PM -0400, Brad Nicholson wrote: > > I'm seeing something fairly unintuitive about serializable transactions. > > > > Taking the following test case: > > > > > http://www.postgresql.org/docs/8.1/in

Re: [GENERAL] Strange Behavior with Serializable Transcations

2006-06-29 Thread Martijn van Oosterhout
On Thu, Jun 29, 2006 at 01:21:19PM +0100, Simon Riggs wrote: > The issue is the difference between start of transaction and time when > the serializable snapshot is taken. Since BEGIN and other commands may > be issued as separate network requests it makes sense to defer taking > the snapshot until

Re: [GENERAL] User privileges in web database applications

2006-06-29 Thread Alvaro Herrera
Antonis Christofides wrote: > But I think that checking user privileges at the database level is > better. I think it's simpler and more secure, and if later you also > want to create nonweb apps, you won't have any more > authentication/privilege headaches. For this reason, in a web app > I've

Re: [GENERAL] Strange Behavior with Serializable Transcations

2006-06-29 Thread Simon Riggs
On Thu, 2006-06-29 at 14:27 +0200, Martijn van Oosterhout wrote: > On Thu, Jun 29, 2006 at 01:21:19PM +0100, Simon Riggs wrote: > > The issue is the difference between start of transaction and time when > > the serializable snapshot is taken. Since BEGIN and other commands may > > be issued as sepa

[GENERAL] PHPpgadmin and user privileges

2006-06-29 Thread Alain Roger
Hi,I would like to provide access to PostgreSQL via PHPpgadmin.basically when user will enter login + password, he will connect directly to his database.what i've done till now, it does not work. when user enter login and password, phppgadmin returns "Login failed".my user hasfor profile "kmt_admin

[GENERAL] phppgadmin

2006-06-29 Thread Alain Roger
Hi,I installed PHPpgadmin and there is a strange behavior.everytime that i select an object (database, table, schema,..) phppgadmin asks me to enter my login and password.why did it not keep this information from 1st connection ? thanks a lot,Alain

Re: [GENERAL] PHPpgadmin and user privileges

2006-06-29 Thread Nikolay Samokhvalov
On 6/29/06, Alain Roger <[EMAIL PROTECTED]> wrote: Hi, I would like to provide access to PostgreSQL via PHPpgadmin. basically when user will enter login + password, he will connect directly to his database. what i've done till now, it does not work. when user enter login and password, phppgad

[GENERAL] Script for reading flat file without delimiters

2006-06-29 Thread Mehdi Aboulkassim
Hy everybody,   I have to write a function that takes a flat file name in parameter and load a table with the file information.   I think that it has to read the file line per line and parse each one to retreive each column data.   There is NO DELIMITERS between fields.   Can someone help.

Re: [GENERAL] Script for reading flat file without delimiters

2006-06-29 Thread Tino Wildenhain
Mehdi Aboulkassim schrieb: Hy everybody, I have to write a function that takes a flat file name in parameter and load a table with the file information. Which programming languages do you plan to use? I think that it has to read the file line per line and parse each one to retreive each co

Re: [GENERAL] Script for reading flat file without delimiters

2006-06-29 Thread Michael Fuhr
On Thu, Jun 29, 2006 at 03:10:03PM +0200, Mehdi Aboulkassim wrote: > I have to write a function that takes a flat file name in parameter > and load a table with the file information. Does it matter if this function runs on the server side or in the client? > I think that it has to read the fi

[GENERAL] pg_restore: [archiver] could not open input file

2006-06-29 Thread lbolognini
Hi all, I'm not able to restore a pg 8.1 database. The dump has been generated with pg_dump. I tried with both absolute and relative path but it doesnt find the file. Any clue? C:\www\foo.com\trunk\db>pg_restore -h localhost -U postgres -W mySecretPassword script.sql pg_restore: [archiver] could

[GENERAL] Upgrade problem

2006-06-29 Thread Nik
I am trying to upgrade from 8.1.3 to 8.1.4 on Windows XP. I am a user with admin rights and I am able to install programs, services and such. I used the same account to install Postgres in the first place. However, when I try to run the upgrade batch file, it goes through most of the installation (

Re: [GENERAL] pg_restore: [archiver] could not open input file

2006-06-29 Thread Tom Lane
[EMAIL PROTECTED] writes: > C:\www\foo.com\trunk\db>pg_restore -h localhost -U postgres -W > mySecretPassword script.sql I don't think you're supposed to put the password on the command line like that. It's probably taking "mySecretPassword" as the file name to read. rega

Re: [GENERAL] User privileges in web database applications

2006-06-29 Thread John DeSoi
On Jun 29, 2006, at 3:37 AM, Antonis Christofides wrote: The benefit of this solution is that I avoid reconnecting to the database on each request, having instead a persistent connection as user "postgres". But it is also a resource liability. How do you know if the user will make another r

Re: [GENERAL] phppgadmin

2006-06-29 Thread Robert Treat
On Thursday 29 June 2006 08:59, Alain Roger wrote: > Hi, > > I installed PHPpgadmin and there is a strange behavior. > everytime that i select an object (database, table, schema,..) phppgadmin > asks me to enter my login and password. > > why did it not keep this information from 1st connection ? >

Re: [GENERAL] Script for reading flat file without delimiters

2006-06-29 Thread Tino Wildenhain
Mehdi Aboulkassim schrieb: If I had to write it in java, I wouldn't mail this issue. I somewhat a Neophyte in Postrgres that's why I need your help. I've searched in the netbut I haven't found a script in Plpgsql that can read a file. Can you tell me if we can do this in Plpgsql? No you c

[GENERAL] Database connectivity using a unix shell

2006-06-29 Thread Jasbinder Bali
Hi I need to connect to the postgres database using my unix shell. How should i go about it? Is libpq going to be helpful here?   Thanks and regards, ~Jas

Re: [GENERAL] Database connectivity using a unix shell

2006-06-29 Thread Richard Broersma Jr
> I need to connect to the postgres database using my unix shell. > How should i go about it? > Is libpq going to be helpful here? If postgres is install on the unix server, you can use the postgreSQL client that installs with the server. it is called psql. Regards, Richard Broersma Jr. -

Re: [GENERAL] Database connectivity using a unix shell

2006-06-29 Thread Scott Marlowe
On Thu, 2006-06-29 at 10:24, Jasbinder Bali wrote: > Hi > I need to connect to the postgres database using my unix shell. > How should i go about it? > Is libpq going to be helpful here? There is a shell interface for postgresql called psql. If you have postgresql installed on a box, then the psq

Re: [GENERAL] Database connectivity using a unix shell

2006-06-29 Thread Jasbinder Bali
in my bash script where and how do i specify the database connection parameters ~Jas  On 6/29/06, Scott Marlowe <[EMAIL PROTECTED]> wrote: On Thu, 2006-06-29 at 10:24, Jasbinder Bali wrote:> Hi> I need to connect to the postgres database using my unix shell. > How should i go about it?> Is libpq go

Re: [GENERAL] Database connectivity using a unix shell

2006-06-29 Thread Scott Marlowe
On Thu, 2006-06-29 at 11:08, Jasbinder Bali wrote: > > On 6/29/06, Scott Marlowe <[EMAIL PROTECTED]> wrote: > On Thu, 2006-06-29 at 10:24, Jasbinder Bali wrote: > > > Hi > > > I need to connect to the postgres database using my unix shell. > > > How should i go about it? > > > Is libpq

Re: [GENERAL] Database connectivity using a unix shell

2006-06-29 Thread Jasbinder Bali
isn't my normal bash script different from psql. In a bash script how wud u specify the db parameters  On 6/29/06, Scott Marlowe <[EMAIL PROTECTED]> wrote: On Thu, 2006-06-29 at 11:08, Jasbinder Bali wrote:>> On 6/29/06, Scott Marlowe < [EMAIL PROTECTED]> wrote:> On Thu, 2006-06-29 at 10:24

Re: [GENERAL] Database connectivity using a unix shell

2006-06-29 Thread Scott Marlowe
On Thu, 2006-06-29 at 11:29, Jasbinder Bali wrote: > isn't my normal bash script different from psql. > In a bash script how wud u specify the db parameters Look at how I'm doing it here: > > > query="select * from sometable"; > > > a=`echo $query|psql -tq dbname`; Note that I'm

Re: [GENERAL] Database connectivity using a unix shell

2006-06-29 Thread Alan Hodgson
On Thursday 29 June 2006 09:08, "Jasbinder Bali" <[EMAIL PROTECTED]> wrote: > in my bash script where and how do i specify the database connection > parameters man psql -- Alan ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner wil

Re: [GENERAL] Database connectivity using a unix shell

2006-06-29 Thread Richard Broersma Jr
> isn't my normal bash script different from psql. > In a bash script how wud u specify the db parameters This link might have something that you would like? http://www.psn.co.jp/PostgreSQL/pgbash/index-e.html Regards, Richard Broersma Jr. ---(end of broadcast)-

Re: [GENERAL] Database connectivity using a unix shell

2006-06-29 Thread elein
This is a variation of the same: a=`psql -U postgres -h my.host.dom -Atc "select col1 from sometable where col2=6" dbname` echo $a Note that the -U and -h can specify the user name and hostname if necessary. -A gets the data unaligned -t gets the data without the decorations -c "query" specifie

Re: [GENERAL] Database connectivity using a unix shell

2006-06-29 Thread Chris Browne
[EMAIL PROTECTED] ("Jasbinder Bali") writes: > in my bash script where and how do i specify the database connection > parameters There are three ways: 1. You can store them in environment variables: PGDATABASE=my_database PGPORT=8901 PGUSER=superman PGHOST=some.host.somewhere export PGDATABASE

Re: [GENERAL] Database connectivity using a unix shell

2006-06-29 Thread Jasbinder Bali
What if I don't have a shell script and instead of that I have a C code and need to connect to the postgres database. How do i accomplish this? do i still need to call this psql clinet interface or there is some other way to do it.. ~JasOn 6/29/06, Scott Marlowe <[EMAIL PROTECTED]> wrote: On Thu, 2

Re: [GENERAL] Database connectivity using a unix shell

2006-06-29 Thread Peter Wilson
Are you just asking random questions? What do you actually want to do? You've asked how to access Postres from a shell - now you're using 'C'. Are you going to work your way through Java, Perl and a host of others. All of this information is *very* clearly available in the manual at: http://www.

Re: [GENERAL] Database connectivity using a unix shell

2006-06-29 Thread Richard Broersma Jr
> What if I don't have a shell script and instead of that I have a C code and > need to connect to the postgres database. > How do i accomplish this? do i still need to call this psql clinet interface > or there is some other way to do it.. In this case you could use ecpg: http://www.postgresql.or

Re: [GENERAL] User privileges in web database applications

2006-06-29 Thread Tim Hart
I'm coming in a bit late to this conversation, so forgive me if I've missed something. Isn't this problem the reason that connection pools were created? In a connection pool, connections are only associated with a particular user for the duration of a transaction. Once the transaction is complet

Re: [GENERAL] Strange Behavior with Serializable Transcations

2006-06-29 Thread Qingqing Zhou
"Tom Lane" <[EMAIL PROTECTED]> wrote > > Right, the snapshot does not become set until you do a non-utility > command (normally, SELECT/INSERT/UPDATE/DELETE). This is a feature, not > a bug, because it lets the transaction take table locks before its > snapshot becomes set. > Hm, mostly I unders

Re: [GENERAL] Strange Behavior with Serializable Transcations

2006-06-29 Thread Tom Lane
"Qingqing Zhou" <[EMAIL PROTECTED]> writes: > "Tom Lane" <[EMAIL PROTECTED]> wrote >> Right, the snapshot does not become set until you do a non-utility >> command (normally, SELECT/INSERT/UPDATE/DELETE). This is a feature, not >> a bug, because it lets the transaction take table locks before its

Re: [GENERAL] psql -h host ...

2006-06-29 Thread Chris
James wrote: Thanks all for the reply. Once pg_hba.conf is modified, do I have to run pg_ctl reload ? If in doubt check the documentation :) http://www.postgresql.org/docs/8.1/static/client-authentication.html#AUTH-PG-HBA-CONF "The pg_hba.conf file is read on start-up and when the main server

[GENERAL] finding gps within polygon

2006-06-29 Thread blackwater dev
Hello,Does anyone have a good tutorial on finding gps points within a polygon?  I need to be able to pass in a list of gps coordinates and let postgres return to me matching cities from my cities table that are within that polygon. Thanks!

Re: [GENERAL] Strange Behavior with Serializable Transcations

2006-06-29 Thread Qingqing Zhou
"Tom Lane" <[EMAIL PROTECTED]> wrote > > It can, but there are cases where you want the lock to be taken before > the snapshot is set. Otherwise, there could be committed changes in the > database that you can't see in your snapshot. I think there are some > examples in the manual, or check the

Re: [GENERAL] Strange Behavior with Serializable Transcations

2006-06-29 Thread Bruno Wolff III
On Thu, Jun 29, 2006 at 14:27:30 +0200, Martijn van Oosterhout wrote: > On Thu, Jun 29, 2006 at 01:21:19PM +0100, Simon Riggs wrote: > > The issue is the difference between start of transaction and time when > > the serializable snapshot is taken. Since BEGIN and other commands may > > be issued

[GENERAL] phppgadmin

2006-06-29 Thread Alain Roger
Hi,I'm back on my problem with PHPpgadmin.. :-(when i log in for the first time, the server icon of servers list, is changing to Loadingand it is back on "not connected" server, but i've access to my database normally. each time that i click on some items (create database, accounts, create tabl