[SQL] Installing pgplsql on postgresql ver. 7.4 on os x 10.3

2003-12-29 Thread beyaRecords - The home Urban music
HI,
after my initial message yesterday asking how to use stored procedures 
in postgresql, it has become clear to me that I need to run a script 
called createlang to install pgplsql into template 1 database.
I am running postgresql 7.4 on os x 10.3. Postgresql is situated in 
directory /usr/local/pgsql. I have been unable to locate the createlang 
script so my question is how do I intsall pgplsql on version 7.4 on OS 
X 10.3?

regards

Uzo
On 29 Dec 2003, at 02:02, Christopher Browne wrote:
[EMAIL PROTECTED] (beyaRecords - The home Urban music) wrote:
I am new to this list and the world of postgreSQL, and would like to
know how create stored procedures in postgreSQL.
Have you considered looking at the documentation?

It is fairly well documented there.

% man "CREATE FUNCTION"

is quite likely to provide you with the documentation you require.
--
If this was helpful,  rate me
http://www3.sympatico.ca/cbbrowne/postgresql.html
"We have no need   to punish Pascal programmers.  Pascal  programming,
like chastity, is its own punishment.  The only way I could imagine to
make their wretched  state any worse would  be to make them  use Ada."
-- Scott Fahlman
---(end of 
broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html



---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
 joining column's datatypes do not match


Re: [SQL] Installing pgplsql on postgresql ver. 7.4 on os x 10.3

2003-12-29 Thread Michael Fuhr
On Mon, Dec 29, 2003 at 03:13:56PM +, beyaRecords - The home Urban music wrote:
>
> after my initial message yesterday asking how to use stored procedures 
> in postgresql, it has become clear to me that I need to run a script 
> called createlang to install pgplsql into template 1 database.

createlang is a compiled program, not a script.

Whether you need to install plpgsql in template1 or not depends on
what you want to do: if you want all databases created in the future to
automatically have plpgsql, then it makes sense to create the language
in template1.  If you want only certain databases to have plpgsql, then
you might want to create the language in only those databases but not
in template1.  I'm assuming (possibly incorrectly) that you're using
template1 for its intended purpose (database template) and not for
any work.

> I am running postgresql 7.4 on os x 10.3. Postgresql is situated in 
> directory /usr/local/pgsql. I have been unable to locate the createlang 
> script so my question is how do I intsall pgplsql on version 7.4 on OS 
> X 10.3?

You could mess around with CREATE LANGUAGE but createlang is easier.
Where have you looked for createlang?  It's typically installed in
the same directory as the other PostgreSQL programs (psql, createdb,
etc.).  If not, then try running something like "locate createlang"
or "find / -name createlang" to see if you can find it.  It would be
odd for a PostgreSQL installation to be missing some of its utilities,
so I'm guessing it's there somewhere.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


[SQL] 7.4.1 install problems on OS X 10.3

2003-12-29 Thread beyaRecords - The home Urban music
Hi,
I have been forced to re-buid postgresql 7.4.1 but am encountering a 
problem when i do the following:

1. /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data

the error I get is as follows:

fixing permissions on existing directory /usr/local/pgsql/data... ok
creating directory /usr/local/pgsql/data/base... ok
creating directory /usr/local/pgsql/data/global... ok
creating directory /usr/local/pgsql/data/pg_xlog... ok
creating directory /usr/local/pgsql/data/pg_clog... ok
selecting default max_connections... 10
selecting default shared_buffers... 50
creating configuration files... ok
creating template1 database in /usr/local/pgsql/data/base/1... FATAL:  
could not create shared memory segment: Cannot allocate memory
DETAIL:  Failed system call was shmget(key=1, size=1081344, 03600).
HINT:  This error usually means that PostgreSQL's request for a shared 
memory segment exceeded available memory or swap space. To reduce the 
request size (currently 1081344 bytes), reduce PostgreSQL's 
shared_buffers parameter (currently 50) and/or its max_connections 
parameter (currently 10).
The PostgreSQL documentation contains more information about 
shared memory configuration.

initdb: failed

Any ideas as to how I can rectify this, taking into consideration that 
I am a complete novice in the wonderful world of unix ;-)

regards

Uzo

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


Re: [SQL] 7.4.1 install problems on OS X 10.3

2003-12-29 Thread Tom Lane
beyaRecords - The home Urban music <[EMAIL PROTECTED]> writes:
> I have been forced to re-buid postgresql 7.4.1 but am encountering a 
> problem when i do the following:

> creating template1 database in /usr/local/pgsql/data/base/1... FATAL:  
> could not create shared memory segment: Cannot allocate memory
> DETAIL:  Failed system call was shmget(key=1, size=1081344, 03600).

You're out of shared memory.  Did you shut down the old postmaster
before trying this?  The default shared memory size on OS X is not large
enough to run more than one postmaster at a time (unless you reduce
7.4's default shared_buffers and max_connections quite a bit).

If you didn't shut down the old postmaster cleanly (eg you did kill -9
or some such) then the old shared memory segment may still be hanging
around even though it's not in use.  OS X doesn't seem to have ipcs or
ipcrm, so there's no real easy way to check this, and no way to get rid
of such a segment except to reboot :-(.

regards, tom lane

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


[SQL] Get x from path/polygon?

2003-12-29 Thread Daniel Lau
Hi all,

I succeed in extracting x and y value from POINT. Is it also possible to
extract x and y value from PATH and POLYGON?

I tried to get x and y from PATH using the similar method. However, the
machine says the PATH is not an array and does not allow me to do so.

Any hints on this?  Thanks in advance.

regards,
Daniel Lau

On Mon, 22 Dec 2003, Michael Fuhr wrote:

> On Mon, Dec 22, 2003 at 04:54:01PM +0800, Daniel Lau wrote:
> > I am wondering if we are able to extract the x-coordinate from a
> > point-type attribute with SQL. I have been looking for this sort of
> > functions from documents and websites but it seems the function does not
> > exist. Or, any altnernate to do so?
> 
> From the bottom of the Geometric Functions and Operators chapter of
> the documentation:
> 
> "It is possible to access the two component numbers of a point as
> though it were an array with indices 0 and 1.  For example, if t.p
> is a point column then SELECT p[0] FROM t retrieves the X coordinate
> and UPDATE t SET p[1] = ... changes the Y coordinate.  In the same way,
> a value of type box or lseg may be treated as an array of two point
> values."
> 
> http://www.postgresql.org/docs/current/static/functions-geometry.html
> 
> -- 
> Michael Fuhr
> http://www.fuhr.org/~mfuhr/
> 
> ---(end of broadcast)---
> TIP 3: if posting/reading through Usenet, please send an appropriate
>   subscribe-nomail command to [EMAIL PROTECTED] so that your
>   message can get through to the mailing list cleanly
> 


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

   http://archives.postgresql.org