Re: [GENERAL] join between a table and function.

2011-08-17 Thread Lauri Kajan
Thanks for every one for help. I got it to work. The reason i used a function is that it calculates the values/attributes from several tables in a pretty complex way. I tried to do this by a view first but couldn't do it. I think it's impossible. The function is always supposed to return only one

Re: [GENERAL] Query regarding PostGre database

2011-08-17 Thread Craig Ringer
On 18/08/2011 11:52 AM, Navin Chandra wrote: Hi, I am an application developer, want to use ‘PostGre’ as backend. May I know what is the maximum possible number of concurrent users? Your acknowledgement will be highly appreciated. You seem to have replied to yourself. Eh? There's no such thin

Re: [GENERAL] Query regarding PostGre database

2011-08-17 Thread Scott Marlowe
On Wed, Aug 17, 2011 at 9:52 PM, Navin Chandra wrote: > Hi, > > I am an application developer, want to use ‘PostGre’ as backend. May I know > what is the maximum possible number of concurrent users? > Your acknowledgement will be highly appreciated. FYI, we call it PostgreSQL or pgsql around here

Re: [GENERAL] Query regarding PostGre database

2011-08-17 Thread John R Pierce
On 08/17/11 8:52 PM, Navin Chandra wrote: I am an application developer, want to use ‘PostGre’ as backend. Please note, there is no such thing as PostGre. There is PostgreSQL, sometimes called Postgres for short. May I know what is the maximum possible number of concurrent users? A better

[GENERAL] Query regarding PostGre database

2011-08-17 Thread Navin Chandra
Hi, I am an application developer, want to use 'PostGre' as backend. May I know what is the maximum possible number of concurrent users? Your acknowledgement will be highly appreciated. Thanks & Regards, Navin Pandit Gurgaon- 122 001 (India) From: selenama...@gmail.com [mailto:selenama...@

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread Chris Travers
On Wed, Aug 17, 2011 at 9:38 PM, Sim Zacks wrote: > The point was not whether I have a bug in an external application, the point > is that I need an external application which creates more overhead and > another point of failure in the application stack. > 1) Not sure how an external python scri

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread Sim Zacks
On 08/17/2011 05:34 PM, Scott Ribe wrote: On Aug 17, 2011, at 1:05 AM, Sim Zacks wrote: One problem we have with LISTEN/NOTIFY (and I haven't found the cause for this yet) is every once in a while my daemon stops listening. It may be after a month of use or l

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread Sim Zacks
On 08/17/2011 06:13 PM, Chris Travers wrote: On Tue, Aug 16, 2011 at 11:53 PM, Sim Zacks wrote: We are doing this same sort of thing now. If the transaction goes through, the email record gets written to a table. We have a cron job that calls a database func

Re: [GENERAL] Type casting text to Numeric - Query Error

2011-08-17 Thread Vikram A
Dear Pavel, Thank you. Now it is not possible to use separate columns. The same works at MYSQL with out casting. But here it is so. We have used CAST and works fine. Thank you vikram From: Pavel Stehule To: Vikram A Cc: PGSQL - Genearal Sent: Wednesday, 17

Re: [GENERAL] streaming replication: one problem & several questions

2011-08-17 Thread Fujii Masao
On Thu, Aug 18, 2011 at 4:26 AM, Lonni J Friedman wrote: > I wish I knew.  All the documentation out there always focuses on > setting up a restore command, as if there would be a huge disaster if > it wasn't done.  Is it safe to simply make wal_keep_segments really > large, and skip the restore_c

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread Craig Ringer
On 18/08/2011 12:35 AM, John R Pierce wrote: On 08/17/11 7:40 AM, Merlin Moncure wrote: GRANT/REVOKE only constrain read/write privileges to a database. at a table level, and even distinguishing between INSERT (writing new data) and UPDATING (updating existing data). Column level, actually

Re: [GENERAL] Failover architecture

2011-08-17 Thread Tatsuo Ishii
> Of course, Is there any easy way to do that?  If so, then what > happens when pgpool tries forward an INSERT to the master while > it's in read-only mode? Assuming "read-only mode" is a database running in read-only transaction mode(like standby), you will get errors someth

Re: [GENERAL] streaming replication: one problem & several questions

2011-08-17 Thread Lonni J Friedman
On Mon, Aug 15, 2011 at 9:34 PM, Fujii Masao wrote: > On Thu, Aug 11, 2011 at 7:19 AM, Lonni J Friedman wrote: >> First the problem.  On *only* one of the two standby servers, I'm >> seeing errors like the following whenever I issue any SQL commands on >> the master which write (insert, update, e

Re: [GENERAL] Not Seeing Syntax Error

2011-08-17 Thread Rich Shepard
On Wed, 17 Aug 2011, David Johnston wrote: To be honest I was too and maybe I somehow implied that to you. Anyway, I believe if you are dealing with CSV import then you are correct but apparently SQL is not as forgiving. I use a third-party application to import my CSV usually so whether that

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread John R Pierce
On 08/17/11 7:40 AM, Merlin Moncure wrote: GRANT/REVOKE only constrain read/write privileges to a database. at a table level, and even distinguishing between INSERT (writing new data) and UPDATING (updating existing data). you can get even finer granularity, using functions with SECURITY_DEF

Re: [GENERAL] Not Seeing Syntax Error

2011-08-17 Thread David Johnston
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Rich Shepard Sent: Wednesday, August 17, 2011 12:27 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] Not Seeing Syntax Error On Wed, 17 Aug 2011, Thom Brown wrote:

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread Chris Travers
On Wed, Aug 17, 2011 at 7:40 AM, Merlin Moncure wrote: > > GRANT/REVOKE only constrain read/write privileges to a database. > Application level security is typically much finer grained than that. > Also, I using SQL roles for actual user roles is not typically done > for various reasons.  General

Re: [GENERAL] Not Seeing Syntax Error

2011-08-17 Thread Rich Shepard
On Wed, 17 Aug 2011, Thom Brown wrote: The error message points to the problem. No value, not even NULL, has been specified for 5th column. Either put DEFAULT or NULL in there. You can't put nothing. I was under the impression (obviously wrong) that a blank field was accepted as a NULL.

Re: [GENERAL] Failover architecture

2011-08-17 Thread Craig Ringer
I can't help so much with the Pg replication specific parts, but this I can answer: On 17/08/2011 9:25 PM, Reuven M. Lerner wrote: restart streaming, it goes back into read-write mode. Is there a way (other than Bucardo, which doesn't seem to fit the bill for this project), is ther

Re: [GENERAL] Failover architecture

2011-08-17 Thread John R Pierce
On 08/17/11 6:25 AM, Reuven M. Lerner wrote: * Once the slave has been promoted to master, we have a single server, and a single point of failure. Is there any simple way to get the former master to become a slave? I assume that it would need to start the whole becoming-a-slave p

Re: [GENERAL] Connection Error during Pg_restore

2011-08-17 Thread Craig Ringer
On 17/08/2011 7:02 PM, Rebecca Clarke wrote: Hi there I'm doing a restore of a large table. The backup file is 18gb. When I run the restore after sometime it comes up with this error while it is restoring the data. pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (d

Re: [GENERAL] Not Seeing Syntax Error

2011-08-17 Thread Thom Brown
On 17 August 2011 16:49, Rich Shepard wrote: > For several INSERT INTO rows I get a syntax error when the quant column is > NULL for one specific parameter. I don't see my error. Here is an example > row: > > psql:insert.sql:8: ERROR: syntax error at or near "," > LINE 1: ...ALUES ('9609-0759',

[GENERAL] Not Seeing Syntax Error

2011-08-17 Thread Rich Shepard
For several INSERT INTO rows I get a syntax error when the quant column is NULL for one specific parameter. I don't see my error. Here is an example row: psql:insert.sql:8: ERROR: syntax error at or near "," LINE 1: ...ALUES ('9609-0759','BC-1.5','1996-09-19','Arsenic',,'mg/L');

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread Chris Travers
On Tue, Aug 16, 2011 at 11:53 PM, Sim Zacks wrote: > We are doing this same sort of thing now. If the transaction goes through, > the email record gets written to a table. We have a cron job that calls a > database function that processes all emails that have not been processed > yet. If the tran

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread Merlin Moncure
On Tue, Aug 16, 2011 at 6:14 PM, Chris Travers wrote: > On Tue, Aug 16, 2011 at 3:51 PM, Merlin Moncure wrote: > >> >> /shrug.  pretty much every project I've ever worked on application >> security has been ad hoc, database driven, not very complicated, and >> not a performance bottleneck.  By th

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread Scott Ribe
On Aug 17, 2011, at 1:05 AM, Sim Zacks wrote: > One problem we have with LISTEN/NOTIFY (and I haven't found the cause for > this yet) is every once in a while my daemon stops listening. It may be after > a month of use or longer, and may be caused by the database being restarted > or something

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread Scott Ribe
On Aug 17, 2011, at 12:53 AM, Sim Zacks wrote: > In your scenario, if you send the NOTIFY message and then you roll back the > transaction, the helper application will still send the email. How? NOTIFY doesn't get delivered until the transaction commits. -- Scott Ribe scott_r...@elevated-dev.c

[GENERAL] Stored procedure name

2011-08-17 Thread Murat Kabilov
Hi, Is there any way to get current stored procedure name? Best Regards,

Re: [GENERAL] How to install PGCRYPTO in PostgreSQL9

2011-08-17 Thread Andre Lopes
Thanks for the reply. I have installed with the user "postgres" and it worked. Thanks! 2011/8/17 Adrian Klaver : > On Wednesday, August 17, 2011 6:44:31 am Andre Lopes wrote: >> I have installed and tried to import the SQL, but I got this: >> >> [code] >> [andre@andre public]$ psql -d 420 -f >> /

Re: [GENERAL] How to install PGCRYPTO in PostgreSQL9

2011-08-17 Thread Adrian Klaver
On Wednesday, August 17, 2011 6:44:31 am Andre Lopes wrote: > I have installed and tried to import the SQL, but I got this: > > [code] > [andre@andre public]$ psql -d 420 -f > /usr/pgsql-9.0/share/contrib/pgcrypto.sql SET > psql:/usr/pgsql-9.0/share/contrib/pgcrypto.sql:197: ERROR: permission >

Re: [GENERAL] How to install PGCRYPTO in PostgreSQL9

2011-08-17 Thread Andre Lopes
I have installed and tried to import the SQL, but I got this: [code] [andre@andre public]$ psql -d 420 -f /usr/pgsql-9.0/share/contrib/pgcrypto.sql SET psql:/usr/pgsql-9.0/share/contrib/pgcrypto.sql:9: ERROR: permission denied for language c psql:/usr/pgsql-9.0/share/contrib/pgcrypto.sql:14: ERRO

Re: [GENERAL] How to install PGCRYPTO in PostgreSQL9

2011-08-17 Thread Devrim GÜNDÜZ
On Wed, 2011-08-17 at 06:28 -0700, Andre Lopes wrote: > > I am using CentOS and PostgreSQL9. I have an application that uses > Pgcrypto. I have googled but I am not sure how can I install this in > PostgreSQL9. If you are using RPMS, then install -contrib RPM, and then install pgcrypto using pgc

[GENERAL] How to install PGCRYPTO in PostgreSQL9

2011-08-17 Thread Andre Lopes
Hi, I am using CentOS and PostgreSQL9. I have an application that uses Pgcrypto. I have googled but I am not sure how can I install this in PostgreSQL9. Someone can give me a clue on this? Best Regards, -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to yo

[GENERAL] Failover architecture

2011-08-17 Thread Reuven M. Lerner
Hi, everyone.  I'm working on a project that is already using PostgreSQL 9.0, including streaming replication.  I'm trying to help them figure out a good architecture for ensuring stability and failover under a variety of conditions, and wanted to ask the community for su

Re: [GENERAL] Type casting text to Numeric - Query Error

2011-08-17 Thread Raymond O'Donnell
On 17/08/2011 13:17, Vikram A wrote: > Hi there, > > I have the following definitions, > > 1. CREATE TABLE Sampletemp ( Sampleid serial NOT NULL, SampleText > character varying(50), CONSTRAINT Sampletemp_id PRIMARY KEY (Sampleid)); > > 2. Insert into Sampletemp (SampleText) values ('Mr. Raja'),

Re: [GENERAL] Type casting text to Numeric - Query Error

2011-08-17 Thread Pavel Stehule
Hello 2011/8/17 Vikram A : > Hi there, > I have the following definitions, > 1. CREATE TABLE Sampletemp ( Sampleid serial NOT NULL,  SampleText character > varying(50), CONSTRAINT Sampletemp_id PRIMARY KEY (Sampleid)); > 2. Insert into Sampletemp (SampleText) values ('Mr. Raja'),('Mr. > Alex'),('1

[GENERAL] Type casting text to Numeric - Query Error

2011-08-17 Thread Vikram A
Hi there, I have the following definitions, 1. CREATE TABLE Sampletemp ( Sampleid serial NOT NULL,  SampleText character varying(50), CONSTRAINT Sampletemp_id PRIMARY KEY (Sampleid)); 2. Insert into Sampletemp (SampleText) values ('Mr. Raja'),('Mr. Alex'),('1000'),('2500'),('555'); 3. select

Re: [GENERAL] Change master to standby

2011-08-17 Thread alexondi
Thank you for the answer! -- View this message in context: http://postgresql.1045698.n5.nabble.com/Change-master-to-standby-tp4703925p4707810.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make

Re: [GENERAL] Change master to standby

2011-08-17 Thread Fujii Masao
On Tue, Aug 16, 2011 at 6:55 PM, Alexander Perepelica wrote: > Can I change server mode master to slave (standby) without restarting? Which replication tool do you use? If streaming replication, the answer is "No". You need to shutdown the master, make a fresh base backup from new master, create

[GENERAL] Connection Error during Pg_restore

2011-08-17 Thread Rebecca Clarke
Hi there I'm doing a restore of a large table. The backup file is 18gb. When I run the restore after sometime it comes up with this error while it is restoring the data. pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry 3022; 0 4287406059 TAB

[GENERAL] Run server recovery

2011-08-17 Thread alexondi
Hi! Can I on server which is master (already work) run recovery mode: 1. start server 2. change recovery.conf 3. reload config ? -- View this message in context: http://postgresql.1045698.n5.nabble.com/Run-server-recovery-tp4707673p4707673.html Sent from the PostgreSQL - general mailing list arch

Re: [GENERAL] Run server recovery

2011-08-17 Thread alexondi
Or recovery mode start only when server load? -- View this message in context: http://postgresql.1045698.n5.nabble.com/Run-server-recovery-tp4707673p4707685.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing list (pgsql-general@postgres

Re: [GENERAL] How to write a psql command inside a function?

2011-08-17 Thread Siva Palanisamy
Hi Chris, I don't have super-user. So I knew I can go with only \COPY command. I want to export the data from a table to a .CSV file. It worked fine when this command is used as a stand-alone. Now, I want to embed this line inside a function. Is there any alternative way for my requirement? Ple

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread Sim Zacks
On 08/16/2011 07:04 AM, Darren Duncan wrote: Chris Travers wrote: On Mon, Aug 15, 2011 at 3:47 PM, Darren Duncan wrote: I believe we basically have all the foundation already, with maybe procedures executable outside transactions being the last major part. Why is this desirable? Why is it mo