Re: Install new language - Prev: Re: [GENERAL] Are you frustrated with PostgreSQL

2003-07-16 Thread Robert J. Sanford, Jr.
For some of your Cygwin specific questions you may want to look at the ports
mailing list. They will be more knowledgeable there.

> I would like to thank for those who answer my questions.
> My client have decide to switch from MySQL to PostgreSQL.
> I have successfully installed PostgreSQL with Cygwin on
> my XP laptop. It's a good start. I, however, have some
> other questions.
>
> 1. I am viewing the database from both PostgreSQL manager
>and PgAdmin III. I can see there are three languages
>(C, Internal, SQL) in PostgreSQL, but not in PgAdmin
>III. I login with the same user. Any idea?

I don't use PgAdmin so I can't answer your question.

> 2. Do I have to install new language "pl/pgSQL" in order
>to write functions?

If you are wanting to write them in PL/pgSQL yes. There are several
command-line tools that allow you to do this without getting into the
database itself. You should read the Administrator's Guide PDF document that
can be found ...

Note - if you install any language in template1 all databases that you
create based on template1 from then on out will have those languages
installed by default. If you are like me and create databases based on
template0 you don't get the results you desired...

> 3. When I start PostgreSQL, I found there are at least 4
>instance of postgres.exe running as NT services when
>there is not connection. Each single one use different
>amount of memory. Is that normal?

I haven't used the Cygwin version in a long time but given that there are
multiple pgsql instances running on my Linux box without connections I would
assume that this is the normal mode of operation under Cygwin as well.

> 4. The "stored procedure" term confused me. I did not see
>any "create procedure" statement in the document. I
>used a lot of procedures/packages in Oracle and MS-SQL.
>Are there such things in PostgreSQL? How do I do that
>in PostgreSQL? Just use "Function"?

Just use function. Same basic mode of operation but different name.

>I could not find examples on how to call a "function"
>like "Exec MyFunctionName(..)".

You treat functions as you would

> 5. I start PostgreSQL with the comman "pg_ctl start -D
>/var/pgsql/data" I got the following message: It says
>the database was not shut down properly? What I did
>wrong? I shut down the database with this command
>"pg_ctl stop -D /var/pgsql/data -m immediate" when no
>connection exist.
>
>$LOG: database system was interrupted at 2003-07-15
>  23:59:00 USMST
>LOG:  checkpoint record is at 0/8C17D0
>LOG:  redo record is at 0/8C17D0; undo record is at 0/0;
>  shutdown FALSE
>LOG:  next transaction id: 4428; next oid: 25168
>LOG:  database system was not properly shut down; automatic
>  recovery in progress
>LOG:  ReadRecord: record with zero length at 0/8C1810
>LOG:  redo is not required
>LOG:  database system is ready

Are you still running under Cygwin? Does that work under Cygwin or do you
need to use the services control panel to start/stop? If you try to start
PostgreSQL and there is a .pid in the data directory then it will tell you
that the system was not properly shut down.

> 6. What kind of hardware configuration would you experts recommend
>for application runnng on one stand along machine.
> -- Critical but not 24x7
> -- RedHat 8, 9?
> -- PHP 4
> -- Apache 2
> -- PostgreSQL 7.3.3
> -- ODBC
> -- up to 1500 pages hit and 1000 database hit
>select/update/insert) per minute.
> -- Expect up to 1GB data in the first year
> -- Expect to spend up to US $2000 for hardware (not
>include monitor)

Hit eBay and you can get a decent dual-Xeon with a gig of RAM and some nice
SCSI drives w/ a RAID card.

> Can you image that I got my PostgreSQL setup and running in
> few hours. Cool!

Having software that "just works" is always nice. Certainly makes my life
easier.

rjsjr


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


[GENERAL] SELECT @@IDENTITY

2003-06-23 Thread Robert J. Sanford, Jr.
Okay, I did a quick search through both the general and SQL lists(1,2)
trying to determine if there is a PostgreSQL construct equivalent to
Microsoft SQL Server's "SELECT @@IDENTITY". After performing an insert the
database caches the last sequence number for each connection and the select
retrieves that value. Thus if connection A and connection B each inserted
into the same table they would each know what the value of the sequence was
immediately after their insert.

Is there any direct support for this? I know that I can manually code to
select the nextval of a sequence but the syntactic sugar of SELECT
@@IDENTITY is really nice.

Many thanks!

rjsjr

1 - The only valid query I could find was
http://archives.postgresql.org/pgsql-general/2001-09/msg00523.php which is
unanswered.
2 - The search engine for the archives seems to ignore the "@@" in the
search string so I ended up with a LOT of information on corporate identity
and identity columns.


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


Re: [WAY OT] Re: [GENERAL] PL/java?

2001-09-03 Thread Robert J. Sanford, Jr.

> No offense, but I've been developing under your language 
> since nearly it's public conception... and perl is _great_.
> 
> Frankly, I don't want to argue with you, because you'll 
> simply defend your own creation without reasonably
> evaluating the situation.
> 
> But I think everyone needs to remember that we shouldn't 
> make a decision about this because of everyone's political
> stances behind languages, especially if they haven't had
> development experience with it.

i think that you missed the point that mr. schwartz is trying to
make - anything you can do in java, you _can_ do in perl. in my
opinion, he isn't trying to say that you _should_ do it in perl.
he might do it in perl but, after all, there is more than one
way to get things done :)

one of the things that i find refreshing about perl is its lack
of corporate attitude. perl doesn't have any aspirations to be
anything other than what it is. it isn't being driven by 
corporate marketing forcing it to beat someone else. the only
thing that is driving it is the needs and desires of its
developers to evolve it to meet the needs of its users.

and i do almost all of my server-side development in java!

> Alex> How would you go about synchronizing session data on 10
> Alex> application servers running mod_perl _without_ using the
> Alex> database to "mirror" that data in memory? It's not very
> Alex> difficult to do it in Java.

are you saying that it isn't very difficult for you to go out
and write this yourself in java or are you saying that it isn't
difficult for you to use what someone else has already written?

if the former and if you want to do something like this in perl
you can start with reading the section in the camel book on tcp
clients and servers. if you feel that tcp has too high of an
overhead then you can read the section on udp clients and servers.

if the latter, look on cpan and if what you want isn't there then
you can step and contribute.

ohmigod, i'm defending perl and guess what? i _still_ do almost
all of my server-side development in java!

> Alex> However, mod_perl is absolutely slower than most any 
> Alex> > j2ee application. If all you are doing is keeping
> Alex> a session variable to count number of hits on a web
> Alex> page, then sure, perl is more than sufficient,
> Alex> possibly faster. But when you start doing anything
> Alex> of importance, enterprise level stuff, you need
> Alex> something scalable in ways java can go, but perl
> Alex> just doesn't seem to have _easy_ or sometimes
> Alex> _existant_ ways to implement.

i don't like language bigots. i just don't. most languages are
quite capable and anyone that denies the viability of one
language is generally uninformed. just because perl doesn't get
the four-color glossy press that java gets doesn't mean that it
isn't capable it just means it doesn't get the four-color glossy
press. just because you don't see something arrive in your box
every day trumpeting perl doesn't mean it can't do what you want
and do it well. it just means that there isn't anyone out there
blowing the horn in your ear.

we have already seen on this topic someone spouting off that
java was way too slow, that c++ was sooo much better, that
having a jvm included in the distribution would make postgres
hog memory and crash unexpectedly. all of this without any
links to nice evidence. all of this while degrading java based
on the performance of one application (tomcat) that pretty much
everyone agrees is a dog.

personally, i see a _lot_ of similarities between his issues with
java and your issues with perl. 7-11 burritos.

rjsjr


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



RE: [GENERAL] why no stored procedures?

2001-08-14 Thread Robert J. Sanford, Jr.

Jan Wieck responded in an irritated manner thusly:

> What exactly do you mean with "there are no stored
> procedures"?

i won't pretend to know what what the original poster
had in mind when asking his question but i'm a newbie
at postgres and i have some confusion as to how a
function maps to a stored procedure. the big question
in my mind is how i can treat the results from a
function as a table. i can't. i posted a message to
the pgsql-sql list which i have included below. this
tells me that postgres _does not_ support stored
procedures in the manner that those of us coming from
microsoft sql server and/or oracle.

thanks!

rjsjr

> i'm reading the postgres documentation and i'm specifically
> interested in creating stored procedures so that i can keep
> as much of the business logic in the database as possible.
> while reading 13.1.3 (SQL Functions on Composite Types) in
> the Programmer's Guide i come across the phrase...
>"When calling a function that returns a row, we cannot
>retrieve the entire row. We must either project an
>attribute out of the row or pass the entire row into
>another function.
>   SELECT name(new_emp()) AS nobody;"

Unfortunately, PostgreSQL functions do not yet return result
sets.  This is on the "todo" list but unfortunately requires
an overhaul of how postgresql functions work.

-Josh Berkus

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Jan Wieck
> Sent: Tuesday, August 14, 2001 9:51 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [GENERAL] why no stored procedures?
>
>
> [EMAIL PROTECTED] wrote:
> > Hey guys,
> >
> > Is there any reason why there are no stored procedures
> for postgresql or
> > does this have to do with the ability to add your own procedural
> > language?
>
> What   exactly   do  you  mean  with  "there  are  no  stored
> procedures"?
>
> I mean, we have more  procedural  languages  than  any  other
> database  and  with  the  upcoming  v7.2  we  will  even have
> reference cursors for PL/pgSQL to pass them into and  out  of
> functions. So could you detail your question please?
>
>
> Jan
>
> --
>
> #===
> ===#
> # It's easier to get forgiveness for being wrong than for
> being right. #
> # Let's break this rule - forgive me.
>#
> #==
> [EMAIL PROTECTED] #
>
>
>
> _
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> ---(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 4: Don't 'kill -9' the postmaster



RE: [GENERAL] postgreSQL on windows2000

2001-08-14 Thread Robert J. Sanford, Jr.

yes you can. go to http://sources.redhat.com/cygwin/lists.html and
download the cygnus windows tool kit. the binary install comes with
postgres pre-built so if you don't want to build it yourself you
don't have to.

after you install cygwin you will need to read the postgres config
document found in c:\cygwin\usr\doc\cygwin\postgresql-7.1.2.readme.
note you don't want the readme that is in usr\doc, you have to go
to usr\doc\cygwin.

for more support on postgres on win2k you should subscribe to the
pgsql-cygwin mailing list.

from what i have seen and read there aren't any really good win32
gui front ends. i have heard good things about pgaccess (a tcl/tk
ms access replacement) but have not yet installed it. 

good luck and have fun!

rjsjr

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of news.skynet.be
> Sent: Tuesday, August 07, 2001 6:28 AM
> To: [EMAIL PROTECTED]
> Subject: [GENERAL] postgreSQL on windows2000
> 
> 
> Hi,
> 
> I'm new to linux and postgresql.  We use a windows2000 server and I'm
> wondering how I can run postgresql on it.  Is there a front-end available
> too?
> 
> Can anyone give me some explainations or give a site with all the info?
> 
> Thanks,
> 
> Eli
> 
> 
> 
> ---(end of broadcast)---
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
> 

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

http://www.postgresql.org/search.mpl