Re: [GENERAL] my C pgm
On Thu, 16 Nov 2000, Lisa Reilman wrote: This program is suppose to have averagefunc that accepts 5 floating point numbers as arguments and return the average to two decimal places. I keep getting syntax errors on lines 6 26 and on line 29 is says unspecified a,b,c,d,e. Not sure what this has to do with PostgreSQL, but this compiled and ran fairly cleanly for me, after I fixed one simple thing. 5 float num1, num2, num3, num4, num4, num5, avg; ^^ No need to make these global variables outside of main. You also declared num4 twice. It ran fine for me then. What C compiler are you using? Brett W. McCoy http://www.chapelperilous.net/~bmccoy/ --- CONGRATULATIONS! Now should I make thinly veiled comments about DIGNITY, self-esteem and finding TRUE FUN in your RIGHT VENTRICLE??
Re: [GENERAL] True ACID under linux (no fsync)?
"Gary Howland (During daytime)" wrote: Just a quickie - I heard that linux does not have a working fsync() call (it has no concept of raw devices). In other words, fsync cannot be used to ensure that data is on disk (try it with a floppy - it returns IMMEDIATELY!!! - long before the write finishes) That's because the mounted drive is buffered in memory, so when you copy a file, you are copying it to memory (which is very fast), and the kernel implicitly syncs with the media when the buffer fills or when an explicit sync is done or when it is unmounted. If there is no working fsync (and fdatasync), why do the Linux man pages claim it to be POSIX.1b compliant? Can you back up your claim with actual documentation? Saying 'I heard' puts it in the realm of urban legendry... Brett W. McCoy http://www.chapelperilous.net --- This is the LAST time I take travel suggestions from Ray Bradbury!
Re: [GENERAL] phpPgAdmin
On Thu, 26 Oct 2000, danyele wrote: Brett and Ron said to me to rebuild php with the --with-pgsql option in the configuration step. I've already did what you recommend but another warning is appearing! Warning: Unable to connect to PostgresSQL server: FATAL 1: SetUserId: user 'password=' is not in 'pg_shadow' in lib.inc.php on line 121 Error - /www/servers/phpPgAdmin/index.php do u know what is it? pg_shadow is part of the authentication PostgreSQL uses. It's looking for a user called 'password=' which obviously doesn't exist -- perhaps your connection string is not formed correctly? Brett W. McCoy http://www.chapelperilous.net --- Space tells matter how to move and matter tells space how to curve. -- Wheeler
Re: [GENERAL] (redefinition) alter table, add foreign key constraint
On Tue, 17 Oct 2000, Matthew Kennedy wrote: A little redefinition of my question is in order. If I try doing this: create table things (name varchar(20), state(2)); create table states (abbreviation varchar(2)); alter table things add foreign key (state) references states (abbreviation); Postgres responds with: NOTICE: ALTER TABLE ... ADD CONSTRAINT will create implicit trigger(s) for FOREIGN KEY check(s) CREATE I am wondering what the implications of postgres using implicit triggers for foreign key constraints are? I guess if there were no implications (ie. implicit triggers were a perfect implimentation of foreign keyt constraints), then there would be no warning message? I don't think of it as a warning message, just informational -- you are creating explicit triggers to handle the referential integrity. You get the same messages when you create a primary key -- you get a notice that an implicit index is being built. Postgres doesn't seem to take the name of a foreign key (it's a parse error to include it). This is slightly different to what SQL92 and Oracle allow. I beleive I should have been able to write: alter table things add foreign key things2states (state) references states (abbreviation); Postgres responds with: ERROR: parser: parse error at or near "things2states" The proper syntax is add constraint name foreign key column references table(column) ... This is consistent with how Oracle does it and how SQL92 defines it. Brett W. McCoy http://www.chapelperilous.net --- Save the bales!
Re: [GENERAL] Re: R: PostgreSQL book
On Thu, 12 Oct 2000, Travis Bauer wrote: I'll second Bookpool for computer books. I've used them a couple of times and they are good. I'm a big fan of readme.doc -- especially because they have a store only minutes from my house! Brett W. McCoy http://www.chapelperilous.net --- I believe in getting into hot water; it keeps you clean. -- G.K. Chesterton
Re: [GENERAL] Pg.pm question
On Tue, 10 Oct 2000, KMiller wrote: Can anyone explain this in more detail and/or offer suggestions for a fix? How about some code? It's hard to tell just by looking at error messages. Brett W. McCoy http://www.chapelperilous.net --- But since I knew now that I could hope for nothing of greater value than frivolous pleasures, what point was there in denying myself of them? -- M. Proust
Re: [GENERAL] Question
On Thu, 5 Oct 2000, Amy Antle wrote: I have 2 tables in Access. I want one of them to act as an archive table. The first table collects records for a tempoary amount of time, and then drops them into another table that will store them and keep growing and growing each time it receives more and more records. I have tried an insert but it just keeps overwriting itself. Any suggestions??? Is this a question for MS-Access or for PostgreSQL? Brett W. McCoy http://www.chapelperilous.net --- The Kennedy Constant: Don't get mad -- get even.
Re: [GENERAL] Re: VIEW problem
On Fri, 6 Oct 2000, Stephan Szabo wrote: About view rules: Of course, you shouldn't actually be able to get into the situation with a view rule, since dropping the table the view points to should drop the view (or refuse to drop the table) it appears from looking at drop table in the spec. If you specify that the view have this behaviour, yes... but even Oracle has gotten me on several occasions for this same thing, dropping a table, then rebuilding, then fscking up the view. Brett W. McCoy http://www.chapelperilous.net --- Beam me up, Scotty! It ate my phaser!
Re: [GENERAL] Re: URL Type
On Fri, 6 Oct 2000, K Parker wrote: But MS Access is _both_, remember? The question came up when migrating from Access talking to its own local Jet database to Access talking to pgsql via odbc. I'm not sure there is a way to tell Access to consider a particular text field in a remote ODBC data source to be a hyperlink... I don't think there is... unless you create a saved query and have a calculated field that takes the ODBC data and typecasts it to the hypertext datatype, if such a thing is possible. Brett W. McCoy http://www.chapelperilous.net --- Men aren't attracted to me by my mind. They're attracted by what I don't mind... -- Gypsy Rose Lee
Re: [GENERAL] Redhat 7 and PgSQL
On 29 Sep 2000, Trond Eivind Glomsrød wrote: That you can't upgrade postgresql from e.g. 6.5 to 7.0 or from 7.0 to 7.1 Incidentally, you can dump data from a database. You can also insert data into a database. If you do this before and after upgrading, you'll hopefully have the same data in the database. FWIW, that's pretty tame compared to trying to migrate and upgrade an Oracle database. Have you ever seen some of the upgrade path rules for Oracle? If it's this version, first migrate to this version and then upgrade, but if it's this other version, then it can upgrade directly, unless it's the beta version, then you have to migrate blah blah blah... Is it feasible to create a 'universal installer' for PostgreSQL similar to what Oracle has (especially for binary distributions) that will do the data migration behind the scenes? Doing the source compile will probably require migrating the stuff manually (but if you are installing from source, you are doing everything manually *anyway*). Brett W. McCoy http://www.chapelperilous.net --- WHO sees a BEACH BUNNY sobbing on a SHAG RUG?!
Re: [GENERAL] Redhat 7 and PgSQL
On Fri, 29 Sep 2000, Efrain Caro wrote: So we can say that we can upgrade, at least in theory, but that's not the official policy? Well, I don't know about 'policy', but yes, you can upgrade PostgreSQL, you just need to dump your data first (which you should do anyway to backup -- never upgrade without backing up first!), install the upgrade by whatever method, do the initdb, then reload your data. It's a minor PITA, but it's also safe -- if you are doing a direct upgrade and it crashes or something else really bad happens, your database could get severely screwed. And then you're screwed. Brett W. McCoy http://www.chapelperilous.net --- Hoare's Law of Large Problems: Inside every large problem is a small problem struggling to get out.
Re: [GENERAL] Redhat 7 and PgSQL
On 29 Sep 2000, Trond Eivind Glomsrød wrote: But claiming that you can't upgrade is painting over what might rather be a deficiency in the RPM mechanism, ISTM. Why can't you have a spec file like this: %preupgrade pg_dumpall somewhere 1) You don't know that postgresql is running. It probably isn't. 2) You don't know that you have the diskspace to do that. These are things that have to be considered regardless of the upgrade mechanism. Brett W. McCoy http://www.chapelperilous.net --- What no spouse of a writer can ever understand is that a writer is working when he's staring out the window.
Re: [GENERAL] ORDERING alphabetically
On Wed, 9 Aug 2000, abe wrote: Does anyone know how to get results from a query in alphabetical order (for one field such as surname). I skimmed over the documentation and no luck. Use the ORDER BY clause in your query: SELECT surname, firstname FROM names ORDER BY surname; Brett W. McCoy http://www.chapelperilous.net/~bmccoy/ --- But soft you, the fair Ophelia: Ope not thy ponderous and marble jaws, But get thee to a nunnery -- go! -- Mark "The Bard" Twain
RE: [GENERAL] 4 billion record limit?
On Thu, 27 Jul 2000, Dave Burbidge wrote: Also, Bill Gates said something along the lines of nobody will ever need more than 640KB of RAM ... which was the usable limit on the old XT's (remember them :) in the early MS-DOS days :) Actually, I think the quote is an urban legend. Brett W. McCoy http://www.chapelperilous.net/~bmccoy/ --- A girl's conscience doesn't really keep her from doing anything wrong-- it merely keeps her from enjoying it.
Re: [GENERAL] Describe structure.
On Tue, 25 Jul 2000, anuj wrote: My table name is tblpg. I want to see the table structure. Like oracle have Describe table name. What PG have ? or any command. Thank in advance. Anuj pg= \d Database= pg +--+--+--+ | Owner | Relation | Type | +--+--+--+ | postgres | tblpg| table| +--+--+--+ It's all in the online help. The command you want is \d table. Brett W. McCoy http://www.chapelperilous.net/~bmccoy/ --- Yow! Is my fallout shelter termite proof?