Re: [GENERAL] Using Postgresql as application server

2011-08-16 Thread Sim Zacks
On 08/15/2011 11:50 PM, Chris Travers wrote: On Mon, Aug 15, 2011 at 1:44 PM, Darren Duncan wrote: I believe that it is ideal for Postgres to be computationally complete in that one *could* use it to implement a complete application. That isn't to say one should do this as a matter of course,

Re: [GENERAL] Any idea about using \COPY in ECPG statement

2011-08-16 Thread John R Pierce
On 08/16/11 11:28 PM, Siva Palanisamy wrote: Hi All, Does anybody have an idea about how to write \COPY command as an ECPG statement? are you a broken record? I've answered this several times now. COPY TO STDOUT and capture the output with |PQgetCopyData| or whatever the equi

Re: [GENERAL] Any idea about using \COPY in ECPG statement

2011-08-16 Thread Pavel Stehule
Hello its' not possible. But you don't need a superuser account for COPY necessary. You can use a SECURITY DEFINER functions. Regards Pavel Stehule 2011/8/17 Siva Palanisamy : > Hi All, > > > > Does anybody have an idea about how to write \COPY command as an ECPG > statement? > > > > EXEC SQL \

[GENERAL] Any idea about using \COPY in ECPG statement

2011-08-16 Thread Siva Palanisamy
Hi All, Does anybody have an idea about how to write \COPY command as an ECPG statement? EXEC SQL \COPY tablename to 'sample.csv' DELIMITERS ',' CSV HEADER I want to perform the above psql command using an ECPG statement. No way of using COPY due to not availability of a super-user account. Cou

Re: [GENERAL] Using Postgresql as application server

2011-08-16 Thread Sim Zacks
On 08/16/2011 03:06 AM, Craig Ringer wrote: On 15/08/2011 10:36 PM, Merlin Moncure wrote: On Sat, Aug 13, 2011 at 2:30 PM, Andreas Joseph Krogh wrote: No, PG has never, and will never, act as an application-server. Why in the world not? The biggest reason is safety. Beyond that, the lack of

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

2011-08-16 Thread Chris Travers
On Tue, Aug 16, 2011 at 10:33 PM, Siva Palanisamy wrote: > Hi All, > > > > I want to have a psql command ‘\COPY’ inside a function. By default, this > command works as such. But, not inside a function. Please guide me. > I don't think that works I think you have to use SQL commands since, well, t

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

2011-08-16 Thread Siva Palanisamy
Hi All, I want to have a psql command '\COPY' inside a function. By default, this command works as such. But, not inside a function. Please guide me. Thanks and Regards, Siva. ::DISCLAIMER:: --

Re: [GENERAL] How to give \COPY inside a function

2011-08-16 Thread John R Pierce
On 08/16/11 10:03 PM, Siva Palanisamy wrote: Hi John, I would like to add that I was not given the super user privilege to perform COPY command. If so, I wouldn't see \COPY command at all! Could you please guide me briefly on how to use \COPY command for my usage to write the output into a .C

Re: [GENERAL] How to give \COPY inside a function

2011-08-16 Thread Siva Palanisamy
Hi John, I would like to add that I was not given the super user privilege to perform COPY command. If so, I wouldn't see \COPY command at all! Could you please guide me briefly on how to use \COPY command for my usage to write the output into a .CSV file inside a function? Thanks and Regards,

Re: [GENERAL] Using Postgresql as application server

2011-08-16 Thread c k
In this war no one is looking at APEX from oracle. Oracle have implemented the whole webserver to DBMS gateway and web development and a web based business solutions in the database it self. They are using pl/sql for this. Many users are using it and found it stable and scalable. Important is that

Re: [GENERAL] How to give \COPY inside a function

2011-08-16 Thread Siva Palanisamy
Hi John, I can understand that we can't use \COPY command directly in a function. Could you please brief me your alternative solution with a sample piece of code or any useful link? Thanks and Regards, Siva. -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-ge

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

2011-08-16 Thread David Johnston
On Aug 16, 2011, at 14:29, Merlin Moncure wrote: > On Tue, Aug 16, 2011 at 8:33 AM, Harald Fuchs wrote: >> In article >> , >> Lauri Kajan writes: >> >>> I have also tried: >>> select >>> *, getAttributes(a.id) >>> from >>> myTable a >> >>> That works almost. I'll get all the fields from my

Re: [GENERAL] Using Postgresql as application server

2011-08-16 Thread Chris Travers
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 the way, I think the opposite of > you: security information rel

Re: [GENERAL] Using Postgresql as application server

2011-08-16 Thread Merlin Moncure
On Tue, Aug 16, 2011 at 4:04 PM, Chris Travers wrote: > On Tue, Aug 16, 2011 at 12:31 PM, Merlin Moncure wrote: > >>> Who enforces security and how? >> >> *) http wrapper (example node.js): check security in the wrapper. >> presumably your application server would be keeping sessions state >

Re: [GENERAL] INSERTing rows from external file

2011-08-16 Thread Rich Shepard
On Tue, 16 Aug 2011, David Johnston wrote: Your INSERT statement is syntactically incorrect; the error has nothing to do with PSQL other than the fact that PSQL is reporting the error to you. David, I see that now. Odds are you are wrapping your Boolean input with single quotes and the em

Re: [GENERAL] INSERTing rows from external file

2011-08-16 Thread David Johnston
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Rich Shepard Sent: Tuesday, August 16, 2011 6:14 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] INSERTing rows from external file On Tue, 16 Aug 2011, Chris Trav

Re: [GENERAL] INSERTing rows from external file

2011-08-16 Thread Scott Ribe
On Aug 16, 2011, at 4:13 PM, Rich Shepard wrote: > Here's the full statement for the last row: > > psql:chem_too.sql:5517: ERROR: invalid input syntax for type boolean: "" > LINE 1: ...NS','1996-11-21','Potassium','0.94988','mg/L','','','','... >

Re: [GENERAL] INSERTing rows from external file

2011-08-16 Thread Rich Shepard
On Tue, 16 Aug 2011, Greg Smith wrote: Sounds like a problem with your file. Messing up CR/LF characters when moving things between Windows and UNIX systems is a popular one. Proof it works: Greg, Excel file imported into LibreOffice and converted to .ods. Columns marked and saved as .csv

Re: [GENERAL] INSERTing rows from external file

2011-08-16 Thread Rich Shepard
On Tue, 16 Aug 2011, Chris Travers wrote: What kind of error? Chris, Here's the full statement for the last row: psql:chem_too.sql:5517: ERROR: invalid input syntax for type boolean: "" LINE 1: ...NS','1996-11-21','Potassium','0.94988','mg/L','','','','...

Re: [GENERAL] INSERTing rows from external file

2011-08-16 Thread David Johnston
>> -Original Message- >> From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Rich Shepard >> Sent: Tuesday, August 16, 2011 5:34 PM >> To: pgsql-general@postgresql.org >> Subject: [GENERAL] INSERTing rows from external file >> >>I have a fil

Re: [GENERAL] INSERTing rows from external file

2011-08-16 Thread Greg Smith
On 08/16/2011 05:34 PM, Rich Shepard wrote: I have a file with 5500 rows formated as 'INSERT INTO (column_names) VALUES ;' that I thought I could read using psql from the command line. However, the syntax, 'psql < filename.sql' throws an error at the beginning of the first INSERT statement

Re: [GENERAL] INSERTing rows from external file

2011-08-16 Thread Chris Travers
On Tue, Aug 16, 2011 at 2:34 PM, Rich Shepard wrote: >  I have a file with 5500 rows formated as 'INSERT INTO > (column_names) VALUES ;' that I thought I could read using psql from > the command line. However, the syntax, 'psql < filename.sql' > throws an error at the beginning of the first INSE

Re: [GENERAL] backup-strategies for large databases

2011-08-16 Thread Greg Smith
On 08/13/2011 05:44 PM, MirrorX wrote: at the moment, the copy of the PGDATA folder (excluding pg_xlog folder), the compression of it and the storing of it in a local storage disk takes about 60 hours while the file size is about 550 GB. the archives are kept in a different location so that not a

Re: [GENERAL] get old versions (8.3.8 or 8.4.1)

2011-08-16 Thread raghu ram
2011/8/16 Vítor Carvalho > Hi, > > ** ** > > I need install the version 8.3.8 or 8.4.1 of the PostgreSQL in one SLES 10, > where can I get one of this versions? > > > Below are links to download the source module of PostgreSQL 8.3.8 & PoatgreSQL 8.4.1 : * * *ftp://ftp-archives.postgresql

[GENERAL] INSERTing rows from external file

2011-08-16 Thread Rich Shepard
I have a file with 5500 rows formated as 'INSERT INTO (column_names) VALUES ;' that I thought I could read using psql from the command line. However, the syntax, 'psql < filename.sql' throws an error at the beginning of the first INSERT statement. In the INSERT manual page I see no example

Re: [GENERAL] Using Postgresql as application server

2011-08-16 Thread Chris Travers
On Tue, Aug 16, 2011 at 12:31 PM, Merlin Moncure wrote: >>> >> Who enforces security and how? > > *) http wrapper (example node.js): check security in the wrapper. > presumably your application server would be keeping sessions state > independently of database session and would do verification on

Re: [GENERAL] [] Using Postgresql as application server

2011-08-16 Thread Steve Atkins
On Aug 16, 2011, at 11:42 AM, John R Pierce wrote: > > this whole discussion reminds me of the old adage... > >if your only tool is a hammer, every problem looks like a nail. I'm amazed nobody has mentioned http://www.sqlonrails.org/ yet. Cheers, Steve -- Sent via pgsql-general maili

Re: [GENERAL] Using Postgresql as application server

2011-08-16 Thread Merlin Moncure
On Tue, Aug 16, 2011 at 1:47 PM, Chris Travers wrote: > On Tue, Aug 16, 2011 at 11:08 AM, Merlin Moncure wrote: > >> why not?  if you are serving http, just put thin connection pooler in >> your http server (node.js would be great for that).  if you are >> serving libpq directly, you can pool wit

Re: [GENERAL] get old versions (8.3.8 or 8.4.1)

2011-08-16 Thread Scott Marlowe
2011/8/16 Vítor Carvalho > > Hi, > > I need install the version 8.3.8 or 8.4.1 of the PostgreSQL in one SLES 10, > where can I get one of this versions? Why? If you want older versions that aren't packaged anymore, you'll have to check them out from the source tree at the main pg repository. -

[GENERAL] get old versions (8.3.8 or 8.4.1)

2011-08-16 Thread Vítor Carvalho
Hi, I need install the version 8.3.8 or 8.4.1 of the PostgreSQL in one SLES 10, where can I get one of this versions? Regards, Vítor Carvalho Senior Technical Consultant Technical Consulting Direction [Description: cid:image001.jpg@01CB3FB8.599FD350] Telf: (+351) 217 816 640 Tlm: (+351) 919 91

Re: [GENERAL] Using Postgresql as application server

2011-08-16 Thread Chris Travers
On Tue, Aug 16, 2011 at 11:08 AM, Merlin Moncure wrote: > why not?  if you are serving http, just put thin connection pooler in > your http server (node.js would be great for that).  if you are > serving libpq directly, you can pool with pgbouncer. > Who enforces security and how? Best Wishes, C

Re: [GENERAL] [] Using Postgresql as application server

2011-08-16 Thread John R Pierce
this whole discussion reminds me of the old adage... if your only tool is a hammer, every problem looks like a nail. -- john r pierceN 37, W 122 santa cruz ca mid-left coast -- Sent via pgsql-general mailing list (pgsql-general@postgre

Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-16 Thread c k
I want to use the postgresql for exactly the same use. I want to keep my database separate and use another postgresql machine just as application server. Even for load balancing and scaling we can use many techniques mixed to get the work done. Chaitanya Kulkarni On Tue, Aug 16, 2011 at 11:55 PM,

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

2011-08-16 Thread Merlin Moncure
On Tue, Aug 16, 2011 at 8:33 AM, Harald Fuchs wrote: > In article > , > Lauri Kajan writes: > >> I have also tried: >> select >> *, getAttributes(a.id) >> from >>   myTable a > >> That works almost. I'll get all the fields from myTable, but only a >> one field from my function type of attributes

Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-16 Thread Scott Marlowe
On Tue, Aug 16, 2011 at 12:25 PM, Merlin Moncure wrote: > one point that is getting lost in all this that if you are using a > database for an application server, this does not mean it's the same > database as your main database or even on the same machine -- you can > still keep traditional separ

Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-16 Thread Merlin Moncure
On Tue, Aug 16, 2011 at 11:27 AM, Evan Rempel wrote: > Technically it can be done, but just because we can do something does not > mean we should do something. Having said that... > > We have been using a middleware product that shall remain nameless, > that goes against a large commercial databas

Re: [GENERAL] Using Postgresql as application server

2011-08-16 Thread Merlin Moncure
On Tue, Aug 16, 2011 at 12:52 AM, Chris Travers wrote: > On Mon, Aug 15, 2011 at 10:05 PM, Scott Marlowe > wrote: > >> >> Yep.  Also, it's REAL easy to stick a caching layer like memcached >> into the middle tier app layer, but nearly impossible to do so in >> pgsql.  For large systems, this wou

Re: [GENERAL] Compile pgadmin1-1.14.0-beta3 - ctlMenuToolbar

2011-08-16 Thread Guillaume Lelarge
On Sun, 2011-08-14 at 18:26 +0200, Guillaume Lelarge wrote: > On Sun, 2011-08-14 at 12:23 -0400, Colin Beckingham wrote: > > On 08/14/2011 12:16 PM, Guillaume Lelarge wrote: > > > On Sun, 2011-08-14 at 10:45 -0400, Colin Beckingham wrote: > > >> Using OpenSUSE 11.4, kernel 3.0. > > >> wxWidgets ver

Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-16 Thread Chris Travers
I can't let this slide :-D On Tue, Aug 16, 2011 at 9:27 AM, Evan Rempel wrote: > Technically it can be done, but just because we can do something does not > mean we should do something. Having said that... > > We have been using a middleware product that shall remain nameless, > that goes against

Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-16 Thread s...@bestmx.ru
Evan Rempel пишет: Security is near impossible to manage as well. Again, almost everything needs to run as the same user. throw your nameless DMS away, or fire the architect. Scott Marlowe ÐÉÛÅÔ: On Mon, Aug 15, 2011 at 11:33 AM, s...@bestmx.ru šwrote: Scott Marlowe ÐÉÛÅÔ: On Sat, Aug 13,

Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-16 Thread Evan Rempel
Technically it can be done, but just because we can do something does not mean we should do something. Having said that... We have been using a middleware product that shall remain nameless, that goes against a large commercial database that shall also remain nameless. The middleware has been mig

Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-16 Thread Scott Marlowe
2011/8/16 s...@bestmx.ru : > Scott Marlowe пишет: >> >> On Mon, Aug 15, 2011 at 11:33 AM, s...@bestmx.ru  wrote: >>> >>> Scott Marlowe пишет: On Sat, Aug 13, 2011 at 9:57 AM, c k  wrote: > > Dear Postgres users, > from last few months I am reading and searching for can po

Re: [GENERAL] How to give \COPY inside a function

2011-08-16 Thread John R Pierce
On 08/16/11 8:07 AM, Siva Palanisamy wrote: I want to \COPY over COPY command as I am not running as a super/admin user. How to add \COPY command inside a function. The following statement inside a function throws error. \COPY xsa.export_table TO 'export.csv' DELIMITERS ',' CSV HEADER Error

[GENERAL] How to give \COPY inside a function

2011-08-16 Thread Siva Palanisamy
Hi All, I want to \COPY over COPY command as I am not running as a super/admin user. How to add \COPY command inside a function. The following statement inside a function throws error. \COPY xsa.export_table TO 'export.csv' DELIMITERS ',' CSV HEADER Errors are throwing at "\COPY" and no semi-co

Re: [GENERAL] 9.0.4 run configure failed with readline enable on susu linux x86-64

2011-08-16 Thread Tom Lane
Jov writes: > ./configure --prefix=/data/pgsql > --with-includes=/data/readline/include > --with-libraries=/data/readline/lib > failed with: > ... > checking test program... failed > configure: error: > Could not execute a simple test program. This may be a problem > related to locating shared l

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

2011-08-16 Thread David Johnston
The easiest way is to put the function in the SELECT list: Note the use of a CTE to avoid executing getAttributes twice - the (result.attrs) refers to the composite typed column and the ".*" expands it into it component parts. WITH result AS ( SELECT myTable.*, getAttributes(myTable.a) AS a

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

2011-08-16 Thread Harald Fuchs
In article , Lauri Kajan writes: > I have also tried: > select > *, getAttributes(a.id) > from > myTable a > That works almost. I'll get all the fields from myTable, but only a > one field from my function type of attributes. > myTable.id | myTable.name | getAttributes > integer | charact

Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-16 Thread John DeSoi
On Aug 13, 2011, at 2:44 PM, s...@bestmx.ru wrote: > c k wrote: >> Yes, I know that I can not create a simple web application using only >> postgresql because we need a web server to server the html content. > u r wrong. > u CAN! > > there is nginx_htttp_postgresql_module > exactly to connect w

Re: [GENERAL] Check server mode (standby / master)

2011-08-16 Thread Simon Riggs
On Tue, Aug 16, 2011 at 8:46 AM, Alexander Perepelica wrote: > How can I check which mode has a sever: master or slave (standby) after I > setup replication? You can run the query pg_is_in_recovery(), available since 9.0 http://developer.postgresql.org/pgdocs/postgres/functions-admin.html#FUNCTI

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

2011-08-16 Thread Lauri Kajan
Hi Chetan, I checked out your link but still can't figure it out. How could I pass the parameter to the function from another table. If I try to join or select from the function I'll get an error told that I cannot refer to other relations of same query level. -Lauri On Tue, Aug 16, 2011 at 1

Re: [GENERAL] 9.0.4 run configure failed with readline enable on susu linux x86-64

2011-08-16 Thread Jov
Thanks for your reply.I have installed readline from src without default prefix because i have no privelege install lib to /usr, there are include header files and libreadline*.a and also .so installed,so I think it is dev package,right? 在 2011-8-16 下午8:01,"Craig Ringer" 写道: > On 16/08/2011 5:16 PM

Re: [GENERAL] 9.0.4 run configure failed with readline enable on susu linux x86-64

2011-08-16 Thread Craig Ringer
On 16/08/2011 5:16 PM, Jov wrote: but if run configure without any args,it error with: ... checking for -lreadline... no checking for -ledit... no configure: error: readline library not found If you have readline already installed, see config.log for details on the failure. It is possible the co

[GENERAL] Change master to standby

2011-08-16 Thread Alexander Perepelica
Hi! Can I change server mode master to slave (standby) without restarting? Thank you! Alex

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

2011-08-16 Thread Chetan Suttraway
On Tue, Aug 16, 2011 at 1:11 PM, Lauri Kajan wrote: > Hi all, > > I have made a function returning a custom record type that contains two > fields. > Now I want to select from that function. Actually I want to make a > join with a table. > > Let me explain. > > Here is my function: > CREATE TYPE

[GENERAL] 9.0.4 run configure failed with readline enable on susu linux x86-64

2011-08-16 Thread Jov
./configure --prefix=/data/pgsql --with-includes=/data/readline/include --with-libraries=/data/readline/lib failed with: ... checking for the pthreads library -lpthread... yes checking whether pthreads work with --thread-safe... no checking whether pthreads work with -mt... no checking for the pth

Re: [GENERAL] PostgreSQL 'hosting'

2011-08-16 Thread Torsten Zühlsdorff
Dragan Zubac schrieb: Does anybody know if there're any companies offering PostgreSQL 'hosting' ? By 'hosting', I mean you get access to a database to which your application connects remotely and do sql stuff. 'Hosting' company takes care of database maintenance,backup,etc. Have a look at: htt

Re: [GENERAL] Check server mode (standby / master)

2011-08-16 Thread raghu ram
On Tue, Aug 16, 2011 at 1:16 PM, Alexander Perepelica < perepelica.a...@gmail.com> wrote: > Hello! > > How can I check which mode has a sever: master or slave (standby) after I > setup replication? > > You can check the mode of the server using "pg_controldata". [pgsql@test~]$ pg_controldata /usr

[GENERAL] Check server mode (standby / master)

2011-08-16 Thread Alexander Perepelica
Hello! How can I check which mode has a sever: master or slave (standby) after I setup replication? Thank you! Alex

Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-16 Thread s...@bestmx.ru
Scott Marlowe пишет: On Mon, Aug 15, 2011 at 11:33 AM, s...@bestmx.ru wrote: Scott Marlowe пишет: On Sat, Aug 13, 2011 at 9:57 AM, c kwrote: Dear Postgres users, from last few months I am reading and searching for can postgresql used as application server? As postgresql supports many lang

[GENERAL] join between a table and function.

2011-08-16 Thread Lauri Kajan
Hi all, I have made a function returning a custom record type that contains two fields. Now I want to select from that function. Actually I want to make a join with a table. Let me explain. Here is my function: CREATE TYPE attributes AS (class integer, type integer); CREATE OR REPLACE FUNCTION g