Tom Lane | 1 May 2007 01:44
Picon

Re: pgsql and Mac OS X

Michael Glaesemann <grzm <at> seespotcode.net> writes:
> On Apr 30, 2007, at 16:39 , Tom Lane wrote:
>> Yeah, Apple uses Postgres as a part of Remote Desktop, but I don't  
>> think
>> they intend it for general use --- it deliberately uses a nonstandard
>> port to avoid conflicting with a regular PG server.

> Really? I've had the Remote Desktop postgres instance prevent others  
> from starting on the default port. Matter of fact, I see that it  
> started up on 5432 just right now. I wonder if the Remote Desktop  
> doesn't check if something else is running on 5432 on startup and use  
> another port if it's already in use. Note that I don't think the  
> Remote Desktop postgres instance starts on system startup; from  
> observation it looks like Remote Desktop needs to be launched for its  
> postgres server to start.

Hmm ... the default port wired into the executables definitely seems to
be 5433:

Mini:~ tgl$ /System/Library/CoreServices/RemoteManagement/rmdb.bundle/bin/psql
psql: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/private/var/db/RemoteManagement/RMDB/.s.PGSQL.5433"?

Mini:~ tgl$ /System/Library/CoreServices/RemoteManagement/rmdb.bundle/bin/postmaster --help
/System/Library/CoreServices/RemoteManagement/rmdb.bundle/bin/postmaster is the PostgreSQL server.
...
  -p PORT         port number to listen on (default 5433)
...

(Continue reading)

John DeSoi | 1 May 2007 02:07
Favicon

Re: pgsql and Mac OS X

You can get libpq (and psql) from the pgEdit distribution. Just right  
click on the application and choose "Show Package Contents".

You'll find these files in Contents/MacOS/bin

John

http://pgedit.com/public/pgedit/pgEdit_mac_1.3.dmg

On Apr 30, 2007, at 3:28 PM, Tom Allison wrote:

> I'm trying to find the binaries for pgsql (the client) for Mac OSX.
> Is there any way to get these without installing all of postgres on  
> a computer?
>
> I'm not going to use postgres on my MacBook, just connect to it.

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

novnov | 1 May 2007 07:51
Picon

IF function?


Does postgresql have a built in IF function that allows one to eval a
condition and return one or another value? Like:

IIF(mybooleanfield = true, "It's true", "It's not true")

--

-- 
View this message in context: http://www.nabble.com/IF-function--tf3673523.html#a10264910
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

David Fetter | 1 May 2007 07:57
Gravatar

Re: IF function?

On Mon, Apr 30, 2007 at 10:51:36PM -0700, novnov wrote:
> 
> Does postgresql have a built in IF function that allows one to eval a
> condition and return one or another value? Like:
> 
> IIF(mybooleanfield = true, "It's true", "It's not true")

It has CASE, as in

CASE foo WHEN true THEN 'It''s true' ELSE 'It''s not true' END;

Cheers,
D
--

-- 
David Fetter <david <at> fetter.org> http://fetter.org/
phone: +1 415 235 3778        AIM: dfetter666
                              Skype: davidfetter

Remember to vote!
Consider donating to PostgreSQL: http://www.postgresql.org/about/donate

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org/

Harpreet Dhaliwal | 1 May 2007 07:59
Picon

Re: IF function?

IF ( condition here)
 -- to do
ELSE
  -- to
END IF


On 5/1/07, novnov <novnovice <at> gmail.com> wrote:

Does postgresql have a built in IF function that allows one to eval a
condition and return one or another value? Like:

IIF(mybooleanfield = true, "It's true", "It's not true")


--
View this message in context: http://www.nabble.com/IF-function--tf3673523.html#a10264910
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Paul Lambert | 1 May 2007 09:24
Picon

PG Books

I've come across a couple of books on PG that appear interesting and was 
wondering if others have read them and what their thoughts are. (Excuse 
me if this topic has already been covered previously)

Practical PostgreSQL - Command Prompt
PostgreSQL - Bruce Momjian

I know Bruce and the CP folks are regular posters here and I am 
certainly aware of their in depth knowledge on PG so as far as knowing 
that the books would be reliable in the information they give I have no 
problems there.

At the moment my usage of PG is fairly basic, a bunch of tables that 
contains a replication of data in our primary application which is 
loaded by a single application and used by our customers with MS Access, 
Crystal Reports and other tools to generate reports. I.e. in effect to 
our customers it's a read only database and any data being put in has 
already been subjected to constraint testing etc by the primary (non PG) 
database so I haven't set up any foreign keys, triggers/functions, 
views, sequences etc. Really the only thing in use is basic data in 
tables with some indexes to make reports quicker.

I want to start expanding the usage and getting into the guts of proper 
performance tuning (right now all PG installations are using the default 
parameters - the only thing that has been changed is the pg_hba file to 
allow access) and these books look like they might be worth reading to 
understand a bit more about how all this works.

Can anyone who has read the books let me know if you have found them to 
be valuable reference tools for someone who is relatively novice at PG 
(but not at databases in general) - Note: Praise from the books authors 
will be considered marginally bias and therefore untrustworthy :)

I know, I could have written a two line email asking this question, but 
sometimes I like to go on and on and on and on.

Thanks for your input though.

--

-- 
Paul Lambert
Database Administrator
AutoLedgers

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Guillaume Lelarge | 1 May 2007 10:10
Favicon
Gravatar

Re: PG Books

Paul Lambert a écrit :
> I've come across a couple of books on PG that appear interesting and was 
> wondering if others have read them and what their thoughts are. (Excuse 
> me if this topic has already been covered previously)
> 
> Practical PostgreSQL - Command Prompt
> PostgreSQL - Bruce Momjian
> 
> [...] 
> Can anyone who has read the books let me know if you have found them to 
> be valuable reference tools for someone who is relatively novice at PG 
> (but not at databases in general) - Note: Praise from the books authors 
> will be considered marginally bias and therefore untrustworthy :)
> 

I've read both of them and found them really interesting 3 or 4 years 
ago. Sadly, they are quite old ("PostgreSQL: Introduction and Concepts" 
published in 2000, 2002 for "Practical PostgreSQL"). You may better look 
at this list :
   http://www.postgresql.org/docs/books/

"Beginning Databases with PostgreSQL" is a really good intro.

Regards.

--

-- 
Guillaume.
<!-- http://abs.traduc.org/
      http://lfs.traduc.org/
      http://docs.postgresqlfr.org/ -->

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Magnus Hagander | 1 May 2007 10:19

Re: pgsql and Mac OS X

Tom Lane wrote:
> Michael Glaesemann <grzm <at> seespotcode.net> writes:
>> On Apr 30, 2007, at 16:39 , Tom Lane wrote:
>>> Yeah, Apple uses Postgres as a part of Remote Desktop, but I don't  
>>> think
>>> they intend it for general use --- it deliberately uses a nonstandard
>>> port to avoid conflicting with a regular PG server.
> 
>> Really? I've had the Remote Desktop postgres instance prevent others  
>> from starting on the default port. Matter of fact, I see that it  
>> started up on 5432 just right now. I wonder if the Remote Desktop  
>> doesn't check if something else is running on 5432 on startup and use  
>> another port if it's already in use. Note that I don't think the  
>> Remote Desktop postgres instance starts on system startup; from  
>> observation it looks like Remote Desktop needs to be launched for its  
>> postgres server to start.
> 
> Hmm ... the default port wired into the executables definitely seems to
> be 5433:

Not being a Mac user myself, I do seem to recall having read somewhere
that they changed this at some point. That early versions had it in
5432, but it was changed to 5433 in newer ones.

//Magnus

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Alban Hertroys | 1 May 2007 10:36
Picon

Re: Selecting from a function(x,y) returning a row-type(sum, prod)

Tom Lane wrote:
> "A. Kretschmer" <andreas.kretschmer <at> schollglas.com> writes:
>> am  Mon, dem 30.04.2007, um 15:45:18 +0200 mailte Heiko Klein folgendes:
>>> How can I do the following:
>>>
>>> select * from myvals, sum_n_product(myvals.x, myvals.y);
> 
>> select x, y, sum_n_product(x,y) from myvals;

> regression=# select x,y,(f).* from
> regression-#   (select *, sum_n_product(x,y) as f from myvals offset 0) ss;

If you really just want to calculate product and sum, it may be easier
to write just:

select x, y, x + y as sum, x * y as prod from myvals;

No need for fancy SP's in that case.
--

-- 
Alban Hertroys

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org/

Martijn van Oosterhout | 1 May 2007 11:36
Favicon

Re: [HACKERS] SOS, help me please, one problem towards the postgresql developement on windows

On Mon, Apr 30, 2007 at 11:05:35AM +0800, shieldy wrote:
> thankyou for your reply.
> I added it to the backend, because the internal ones such as box_intersect()
> function is keeped at there. so in my opinion, I just need to add a function
> to the files, and then compile it. then we can use it as the internal ones.
> bytheway, what's the backend file used for? I just didnot quite understand
> the postgresql.  and your meaning " place it in a module" , how should i
> do??

First, please reply to the list, not to me directly.

Secondly, just because you add it to the backend doesn't mean you can
use it straight away. There are thousands of functions in postgresql you
can't access from SQL, you have to declare them. See here:

http://www.postgresql.org/docs/8.2/interactive/xfunc-internal.html

Finally, by putting it in the backend you have to rebuild postgres
every time you want to change a function. Complete waste of time as
postgres can load external modules. See here:

http://www.postgresql.org/docs/8.2/interactive/xfunc-c.html

Or better, just read the whole "Extending SQL" section.

http://www.postgresql.org/docs/8.2/interactive/extend.html

Have a nice day,
--

-- 
Martijn van Oosterhout   <kleptog <at> svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Gmane