Re: [GENERAL] RETURN QUERY SELECT & TYPE

2010-08-09 Thread Pavel Stehule
Hello 2010/8/10 screamge : > Here is code of first procedure: > CREATE TYPE some_item AS > (id integer, > title character varying, > ... > ); > > > CREATE OR REPLACE FUNCTION some_func (integer) RETURNS some_item AS > ... > itemid ALIAS for $1; > resulter some_item%rowtype; > > ... > SELECT INTO r

[GENERAL] RETURN QUERY SELECT & TYPE

2010-08-09 Thread screamge
Here is code of first procedure: CREATE TYPE some_item AS (id integer, title character varying, ... ); CREATE OR REPLACE FUNCTION some_func (integer) RETURNS some_item AS ... itemid ALIAS for $1; resulter some_item%rowtype; ... SELECT INTO resulter n_id, t_title FROM some_table WHERE n_id = ite

Re: [GENERAL] pgtune

2010-08-09 Thread Sim Zacks
On 09-Aug-2010 6:40 PM, tuanhoanganh wrote: > What is the name of DW in --type=DW > Sorry for my English. > > Tuan Hoang Anh DW = data warehouse. I don't think you have to apologize for your English. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your su

Re: [GENERAL] Win Server 2003: postgres can't logon

2010-08-09 Thread Scott Marlowe
On Mon, Aug 9, 2010 at 6:23 PM, Mabry Tyson wrote: > We would appreciate any help in resolving this problem so we can use the > minimally privileged postgres account for logging in as the PostgreSQL > service under Windows. > > On a Windows Server 2003 server SP2 (not part of a domain), we had a >

Re: [GENERAL] Win Server 2003: postgres can't logon

2010-08-09 Thread Craig Ringer
On 10/08/10 08:23, Mabry Tyson wrote: > The PostgreSQL 8.3.1 Service is set to be started by logon as "postgres" > (as configured by the MS installer). The postgres does have the "Can > login as a service" privilege. The error we get is Event 553: Reason: > User not allowed to logon at this com

[GENERAL] Win Server 2003: postgres can't logon

2010-08-09 Thread Mabry Tyson
We would appreciate any help in resolving this problem so we can use the minimally privileged postgres account for logging in as the PostgreSQL service under Windows. On a Windows Server 2003 server SP2 (not part of a domain), we had a PostgreSQL 8.3.1 server that was running fine. The site'

Re: [GENERAL] pg 9.0, streaming replication, fail over and fail back strategies

2010-08-09 Thread Fujii Masao
On Tue, Aug 10, 2010 at 7:10 AM, Kyle R. Burton wrote: > Is there any way to get PostgreSQL to bind to a new ip address and > interface without actually shutting it down?  If it could, would I > need to break all the current (read only) client connections to get > them to reconnect and have the ab

Re: [GENERAL] pg 9.0, streaming replication, fail over and fail back strategies

2010-08-09 Thread Jeff Davis
On Mon, 2010-08-09 at 19:32 -0400, Kyle R. Burton wrote: > That is an excellent suggestion! It just didn't occur to me. I've > tried googling how to forward a port and am not having much success > (rinetd worked, but I feel like I should be able to get iptables to > work - do you have any pointer

Re: [GENERAL] change owner strange behavior

2010-08-09 Thread Tom Lane
David Galkowski writes: > In order to consolidate two users, user1 and user2, in the database I > changed the owner of all tables and views that user2 owned to be owned > by user1. I then revoked all remaining privileges from user2 and > dropped the role. During this process I changed both table

Re: [GENERAL] pg 9.0, streaming replication, fail over and fail back strategies

2010-08-09 Thread Kyle R. Burton
>> Is there any way to get PostgreSQL to bind to a new ip address and >> interface without actually shutting it down?  If it could, would I >> need to break all the current (read only) client connections to get >> them to reconnect and have the ability to write?  (am I confused about >> this?) > >

[GENERAL] change owner strange behavior

2010-08-09 Thread David Galkowski
In order to consolidate two users, user1 and user2, in the database I changed the owner of all tables and views that user2 owned to be owned by user1. I then revoked all remaining privileges from user2 and dropped the role. During this process I changed both table1 and view1 (that selects from ta

Re: [GENERAL] pg 9.0, streaming replication, fail over and fail back strategies

2010-08-09 Thread Scott Marlowe
On Mon, Aug 9, 2010 at 4:10 PM, Kyle R. Burton wrote: > Hello, > After I had moved the VIP from the master to the slave, I had to > restart (not just reload) the postgres daemon to get it to start Not surprising as you say. > Is there any way to get PostgreSQL to bind to a new ip address and > i

[GENERAL] pg 9.0, streaming replication, fail over and fail back strategies

2010-08-09 Thread Kyle R. Burton
Hello, I'm new to the list and not even sure if this is the right place to be posting this... I've worked through the documentation for postgres 9.0 (beta2) and have successfully set up a master and hot slave configured with streaming replication (and xlog shipping).  That configuration seems to

Re: [GENERAL] How to reference a subquery column alias?

2010-08-09 Thread José María Terry Jiménez
Hello Sergey Thanks by your answer, this worked after i add at the end an AS xxx clause, because an error telling me something about subqueries in FROM must have an alias, so i did it: SELECT *, min_caudal + max_caudal AS diferencia FROM ( ...your expression... ) AS temp and worked Best, S

Re: [GENERAL] Is there a way to bypass sql?

2010-08-09 Thread Rodrigo E . De León Plicet
On Mon, Aug 9, 2010 at 1:39 PM, samantha wrote: > I have been digging into NoSQL of late (...) Be wary of DBAs Running with Scissors... http://www.pgcon.org/2010/schedule/attachments/141_PostgreSQL-and-NoSQL.pdf -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make chan

Re: [GENERAL] How to reference a subquery column alias?

2010-08-09 Thread Sergey Konoplev
Hi, Just wrap your expression with another SELECT and operate with the aliases like SELECT *, min_caudal + max_caudal AS diferencia FROM ( ...your expression... ) 2010/8/9 José María Terry Jiménez : > Hello > > Yesterday a list user solved me a problem with a sententence with two > subqueries. T

[GENERAL] Hector Beyers wants to stay in touch on LinkedIn

2010-08-09 Thread Hector Beyers
LinkedIn Hector Beyers requested to add you as a connection on LinkedIn: -- Andrew, I'd like to add you to my professional network on LinkedIn. - Hector Beyers Accept invitation from Hector Beyers http://www.linkedin.com/e/v74zw8-gcns1qml-31/A

[GENERAL] How to reference a subquery column alias?

2010-08-09 Thread José María Terry Jiménez
Hello Yesterday a list user solved me a problem with a sententence with two subqueries. The solution was this: SELECT remota_id,min(hora),max(hora), (SELECT caudal FROM historicos WHERE remota_id=ooo.remota_id AND hora=min(ooo.hora)) as min_caudal, (SELECT caudal FROM historicos WHERE remota

Re: [GENERAL] Is there a way to bypass sql?

2010-08-09 Thread Merlin Moncure
On Mon, Aug 9, 2010 at 2:39 PM, samantha wrote: > I have been digging into NoSQL of late.  For navigational queries it would > be great if there was a way to bypass SQL and directly pull from an > identifier for a record or arbitrary byte stream.  Does postgresql directly > support such ability?  

Re: [GENERAL] Is there a way to bypass sql?

2010-08-09 Thread Pavel Stehule
hello 2010/8/9 samantha : > I have been digging into NoSQL of late.  For navigational queries it would > be great if there was a way to bypass SQL and directly pull from an > identifier for a record or arbitrary byte stream.  Does postgresql directly > support such ability?   What is the closest t

[GENERAL] Is there a way to bypass sql?

2010-08-09 Thread samantha
I have been digging into NoSQL of late. For navigational queries it would be great if there was a way to bypass SQL and directly pull from an identifier for a record or arbitrary byte stream. Does postgresql directly support such ability? What is the closest that you could come? - samantha

Re: [GENERAL] MySQL versus Postgres

2010-08-09 Thread Tom Lane
"Joshua J. Kugler" writes: > On Monday 09 August 2010, Joshua D. Drake elucidated thus: >> The actual requirement is: >> >> Thou shall not use a privelaged user, e.g; Administrator or UID = 0. >> >> Not only is that a reasonable default, MySQL is broken because of >> theirs. > Hmm...I've always

[GENERAL] Problem with dumps

2010-08-09 Thread Bill Christensen
Hi folks, I'm building a new server with postgres/phppgadmin, and having trouble getting the dumps to work properly. This is my first time installing postgres, so I very well may have missed something. I just corrected the paths to pg_dump and pg_dumpall. By the way, what's "relog" mean in

Re: [GENERAL] MySQL versus Postgres

2010-08-09 Thread Joshua J. Kugler
On Monday 09 August 2010, Joshua D. Drake elucidated thus: > On Mon, 2010-08-09 at 10:09 -0600, Scott Ribe wrote: > > It's not a requirement, just a reasonable default. > > The actual requirement is: > > Thou shall not use a privelaged user, e.g; Administrator or UID = 0. > > Not only is that a rea

Re: [GENERAL] MySQL versus Postgres

2010-08-09 Thread Joshua J. Kugler
On Monday 09 August 2010, Randal L. Schwartz elucidated thus: > > "Joshua" == Joshua J Kugler writes: > > Joshua> I'll add in a "me too" only to say that I am someone that > learns Joshua> best by example. > > Keep in mind though that there are three primary learning modes: > - example > - con

Re: [GENERAL] MySQL versus Postgres

2010-08-09 Thread Joshua D. Drake
On Mon, 2010-08-09 at 10:09 -0600, Scott Ribe wrote: > It's not a requirement, just a reasonable default. The actual requirement is: Thou shall not use a privelaged user, e.g; Administrator or UID = 0. Not only is that a reasonable default, MySQL is broken because of theirs. Joshua D. Drake -

Re: [GENERAL] MySQL versus Postgres

2010-08-09 Thread Randal L. Schwartz
> "Joshua" == Joshua J Kugler writes: Joshua> I'll add in a "me too" only to say that I am someone that learns Joshua> best by example. Keep in mind though that there are three primary learning modes: - example - concept - structure Do not overemphasize the example mode at the cost of prese

Re: [GENERAL] MySQL versus Postgres

2010-08-09 Thread Scott Ribe
It's not a requirement, just a reasonable default. On Aug 7, 2010, at 11:09 AM, Martin Gainty wrote: > 3)eliminate the requirement to create a postgres user to execute the server > binaries..I guess i never understood that requirement -- Scott Ribe scott_r...@elevated-dev.com http://www.elev

Re: [GENERAL] pgtune

2010-08-09 Thread tuanhoanganh
What is the name of DW in --type=DW Sorry for my English. Tuan Hoang Anh On Mon, Aug 9, 2010 at 6:21 PM, Amitabh Kant wrote: > 2010/8/9 Sim Zacks > > >> >> I just found out about pgtune and am trying it out on my server. >> >> >> I have 2.5 questions: >> >> 1) Are these settings the maximum th

Re: [GENERAL] InitDB: Bad system call

2010-08-09 Thread Thom Brown
On 9 August 2010 13:56, Amitabh Kant wrote: > On Mon, Aug 9, 2010 at 6:01 PM, Thom Brown wrote: >> >> See http://www.postgresql.org/docs/9.0/static/kernel-resources.html >> and the section under NetBSD/OpenBSD. >> >> -- >> Thom Brown >> Registered Linux user: #516935 >> > > Thom > > Not sure if i

Re: [GENERAL] InitDB: Bad system call

2010-08-09 Thread Amitabh Kant
On Mon, Aug 9, 2010 at 6:01 PM, Thom Brown wrote: > > See http://www.postgresql.org/docs/9.0/static/kernel-resources.html > and the section under NetBSD/OpenBSD. > > -- > Thom Brown > Registered Linux user: #516935 > > Thom Not sure if it's a typo, but shouldn't he be looking under FreeBSD secti

Re: [GENERAL] InitDB: Bad system call

2010-08-09 Thread Thom Brown
On 9 August 2010 12:56, Torsten Zühlsdorff wrote: > Hello, > > i've just compiled a new Jail at my FreeBDS 7.0-STABLE machine and trying to > get PostgreSQL 9.0 Beta 4 running. Compiling etc works fine. > > But when i call the initdb, i get "Bad System Call" messages. Here is the > output: > > $ /

[GENERAL] InitDB: Bad system call

2010-08-09 Thread Torsten Zühlsdorff
Hello, i've just compiled a new Jail at my FreeBDS 7.0-STABLE machine and trying to get PostgreSQL 9.0 Beta 4 running. Compiling etc works fine. But when i call the initdb, i get "Bad System Call" messages. Here is the output: $ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data -d Runnin

Re: [GENERAL] pgtune

2010-08-09 Thread Amitabh Kant
2010/8/9 Sim Zacks > > > I just found out about pgtune and am trying it out on my server. > > > I have 2.5 questions: > > 1) Are these settings the maximum that the server will handle, if it is > strictly dedicated to postgresql? Meaning if I am running other stuff on > the server as well, this w

[GENERAL] pgtune

2010-08-09 Thread Sim Zacks
I just found out about pgtune and am trying it out on my server. I have 2.5 questions: 1) Are these settings the maximum that the server will handle, if it is strictly dedicated to postgresql? Meaning if I am running other stuff on the server as well, this would be a bad idea. 1a) If I have

Re: [GENERAL] Can database run a script automatically at start up?

2010-08-09 Thread Szymon Guz
2010/8/9 Frank Church > Can PostgresSQL be setup to automtatically run a script at start up? > > I need something to run at start up in case the database crashed or > some programs did not close their databases properly on shutdown. > > /voipfc > > -- > Sent via pgsql-general mailing list (pgsql-

[GENERAL] Can database run a script automatically at start up?

2010-08-09 Thread Frank Church
Can PostgresSQL be setup to automtatically run a script at start up? I need something to run at start up in case the database crashed or some programs did not close their databases properly on shutdown. /voipfc -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make change

Re: [GENERAL] MySQL versus Postgres

2010-08-09 Thread Sandeep Srinivasa
On Mon, Aug 9, 2010 at 2:28 PM, Michael A. Peters wrote: > > > I have 4x6 cards that I write the postgresql way of doing what I use to do > with MySQL so that I can easily reference them when I need to. > > Should I sit down and read a book and go through the exercises? > Yes. But I need to get stu

Re: [GENERAL] Accessing a database via AJAX scripts - solved

2010-08-09 Thread Glen Eustace
The solution to my problems involved both of the issues Tom identified. 1. Proc::Daemon::Init() call closed the libpq connection in the parent. Solution: deliberately close connection before call and open in the child after the call. 2. The status updates were being written inside

Re: [GENERAL] MySQL versus Postgres

2010-08-09 Thread Michael A. Peters
> > On Aug 8, 2010, at 2:45 AM, Torsten Zühlsdorff wrote: > *snip* > > I understand and appreciate your position. Thanks for the > clarification. > > While I believe that this thread has, for all intents and purposes, > run its course (and I look forward to reading the documentation it > informs)

Re: [GENERAL] MySQL versus Postgres

2010-08-09 Thread Craig Ringer
On 09/08/10 14:54, Sandeep Srinivasa wrote: > > The way I see it - for those who want to truly learn, there is the > documentation. For those who dont, there are ORMs. Ha, I wish! Despite being rather comfortable with SQL I've been using the Hibernate ORM system in a project to try to reduce so

Re: [GENERAL] MySQL versus Postgres

2010-08-09 Thread Thomas Kellerer
Sandeep Srinivasa wrote on 09.08.2010 08:54: The way I see it - for those who want to truly learn, there is the documentation. For those who dont, there are ORMs. Another of those ORM myths ;) ORMs are not an alternative to learning SQL or understand how a DBMS works. You need to be good at SQ

Re: [GENERAL] MySQL versus Postgres

2010-08-09 Thread Sandeep Srinivasa
On Mon, Aug 9, 2010 at 12:15 PM, Allan Kamau wrote: > > There may be worry of "copy and paste" without proper understanding of > the code and concepts but this may be mitigated IMHO by fact that it > seems unlikely that when presented with a case to solve, simple "copy > and paste" of several com