[GENERAL] MetaData

2001-03-14 Thread Dan Lyke
Renaud Tthonnart writes: > Could someone give me some explaination about the metatable(s) of > PostgreSQL? > Where is it and is there to find in it? A good way is to start psql with "-E", it'll then show you the queries it makes from the metatables when you do things like "\d table". Dan --

[GENERAL] Bug in my ( newbie ) mind?

2001-02-20 Thread Dan Lyke
Christopher Sawtell writes: > chris=# select phone_prefix.prefix order by random() limit 1 || '-' || > lpad((random()*1)::int, 4, '0')::text as "Phone Number"; > ERROR: parser: parse error at or near "||" This sure won't fix everything, but at the very least you need to parenthesize that fi

Re: [GENERAL] Re: A How-To: PostgreSQL from Tcl via ODBC

2001-02-20 Thread Dan Lyke
Tom Lane writes: > Re-run configure, and watch to make sure that it finds bison this time. > You'll need flex too, if you intend to build from CVS sources. And if you're going to use the ODBC drivers under Linux (or any other OS that links C "strings" into read only memory) you'll need pretty rec

[GENERAL] A How-To: PostgreSQL from Tcl via ODBC

2001-02-19 Thread Dan Lyke
A friend asked me to figure out how to access PostgreSQL from Tcl via ODBC. For posterity, here's the step by step "how I did it" that I emailed to him. I don't know Tcl, this was just about getting the compile options correct and doing the proper sysadminning to make things work. Comments, sugge

Re: [GENERAL] Connection pooling

2001-01-25 Thread Dan Lyke
Gilles DAROLD writes: > With Apache/mod_perl it is very simple to enable DB connection > persistance. > > in your perl script : > > use vars qw($dbh); > > $dbh ||= DBI::connect($datasrc, $dbuser, $dbpwd); Even better, Apache::DBI will pool across Perl programs, and you don't have to change any

[GENERAL] 'enum' equivalent?

2001-01-22 Thread Dan Lyke
Steve Leibel writes: > I'm converting a mysql database to postgres. Is there an equivalent > for the enum data type? No, but you can put the enum data in a separate table and join them. This also makes the operation of adding entries to the enum list better defined. Dan

[GENERAL] Selective Auto-Timestamp [using triggers?]

2001-01-11 Thread Dan Lyke
Rajit Singh writes: > The thing is, I also want to be able to update the timestamp field > if I want to... Here's my solution: CREATE FUNCTION updated_stamp () RETURNS OPAQUE AS 'BEGIN IF NEW.updated ISNULL THEN NEW.updated := ''now''; END IF; RETURN N

[GENERAL] Why PostgreSQL is not that popular as MySQL?

2000-12-04 Thread Dan Lyke
Raymond Chui writes: > I am wonder why most of people choose MySQL in Linux > world rather than PostgreSQL? I normally stay out of the advocacy wars, but as a recent convert I figure I'll pipe up. I switched to PostgreSQL as the back-end to my services at http://www.flutterby.com/ from MySQL whe