Re: [GENERAL] Smallint - Integer Casting Problems in Plpgsql functions

2004-03-17 Thread Denis Gasparin
Hi Richard. Thank you for your reply. I rewrote the store procedure to accept integer instead of smallint. What i don't understand is why the casting is working in 7.2.3. What has been changed from that? Thank you, -- Doct. Eng. Denis Gasparin: [EMAIL PROTECTED] --- Pr

Re: [GENERAL] LWP::Simple in Postgresql 7.3.4 - SOLUTION

2004-03-17 Thread Siew Hui, Wong
Dear list, THe location of Simple.pm in my server is /usr/local/lib/perl5/site_perl/5.8.1/LWP/. The problem is solved by adding a code that points to LWP/Simple.pm before the "use LWP::Simple". use lib "/usr/local/lib/perl5/site_perl/5.8.1/; use LWP::Simple; It worked like a charm, but othe

Re: [GENERAL] Triggers After INSERT

2004-03-17 Thread Gregory Wood
Stephane Tessier wrote: Hi, I have a problem with triggers in postgresql 7.3.4 and PHP... I have a lot of insert to do from a table x to table y ( average of 1 rows each time). I use a trigger AFTER INSERT but it seems that PHP wait for the result of the trigger to ending the script... Is it p

[GENERAL] any sql for doing radix conversion?

2004-03-17 Thread Mark Harrison
I would like to give out the results of select nextval('foo_seq') as a base-36 number. Are there any built-ins to perform this? Many TIA, Mark ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org

Re: [GENERAL] pg_class table problem

2004-03-17 Thread Shilong Stanley Yao
Marc Durham wrote: The relpages value is an estimated value I believe. Try using VACUUM to update it: VACUUM mytable; SELECT relname, relpages from pg_class; -Marc- Thank you all for your help. "vacuum" does help! Now I got the accurate numbers. -Stan ---(end

Re: [GENERAL] pg_class table problem

2004-03-17 Thread Martijn van Oosterhout
On Wed, Mar 17, 2004 at 03:29:33PM -0700, Shilong Stanley Yao wrote: > Hi, > I inserted thousands of records in a table, but when using "select > relname, relpages from pg_class;", the number of pages of the table in > which I am inserting records is always 10, which is the same as an empty > ta

[GENERAL] pg_class table problem

2004-03-17 Thread Shilong Stanley Yao
Hi, I inserted thousands of records in a table, but when using "select relname, relpages from pg_class;", the number of pages of the table in which I am inserting records is always 10, which is the same as an empty table. Am I doing anything wrong? Thanks, -Stan ---(end

[GENERAL] Triggers After INSERT

2004-03-17 Thread Stephane Tessier
Hi, I have a problem with triggers in postgresql 7.3.4 and PHP... I have a lot of insert to do from a table x to table y ( average of 1 rows each time). I use a trigger AFTER INSERT but it seems that PHP wait for the result of the trigger to ending the script... Is it possible to avoid waiting

Re: [GENERAL] Newbie timestamp question

2004-03-17 Thread Robin 'Sparky' Kopetzky
Thank you for all your help. I built two simple functions (extract_timestamp, build_timestamp) to tear apart a timestamp and put it back together to make the job easier. Thanks again! 'Sparky' ---(end of broadcast)--- TIP 8: explain analyze is

Re: [GENERAL] Data Corruption in case of abrupt failure

2004-03-17 Thread Andrew Sullivan
On Tue, Mar 16, 2004 at 01:16:56PM +0530, Shridhar Daithankar wrote: > I believe using hdparm on linux, one can see whether or not write caching > is enabled and also set the caching. > > I don't think any IDE disk would lie about write caching status. (If one > does then it is really hard to f

Re: [GENERAL] Newbie timestamp question

2004-03-17 Thread Bruno Wolff III
On Wed, Mar 17, 2004 at 11:52:19 -0700, Robin 'Sparky' Kopetzky <[EMAIL PROTECTED]> wrote: > Good Morning!! > > I'm repairing a series of scripts in PHP that use the 'datetime' of MySQL > and converting them to Postgres. Question is this: The datetime format used > in the script is 'MM

Re: [GENERAL] Newbie timestamp question

2004-03-17 Thread Richard Huxton
On Wednesday 17 March 2004 18:52, Robin 'Sparky' Kopetzky wrote: > Good Morning!! > > I'm repairing a series of scripts in PHP that use the 'datetime' of MySQL > and converting them to Postgres. Question is this: The datetime format used > in the script is 'MMDDHHMMSS' as a text string. D

Re: [GENERAL] Newbie timestamp question

2004-03-17 Thread scott.marlowe
On Wed, 17 Mar 2004, Robin 'Sparky' Kopetzky wrote: > Good Morning!! > > I'm repairing a series of scripts in PHP that use the 'datetime' of MySQL > and converting them to Postgres. Question is this: The datetime format used > in the script is 'MMDDHHMMSS' as a text string. Do I have to

Re: [GENERAL] Relation "xxxxx" does not exist - more info

2004-03-17 Thread Valter
Bill, I found in docs that identifier names in Postgre behave inconsistenly from another servers. In postgre FOO,Foo, foo are equals to "foo" while in others database they are equals to "FOO". This behavior prevents the use of DTS to direct transfer tables from SQL Server to Postgre. First it is

[GENERAL] Newbie timestamp question

2004-03-17 Thread Robin 'Sparky' Kopetzky
Good Morning!! I'm repairing a series of scripts in PHP that use the 'datetime' of MySQL and converting them to Postgres. Question is this: The datetime format used in the script is 'MMDDHHMMSS' as a text string. Do I have to convert this to the format shown in the Postgres manual: '19

Re: [GENERAL] Relation "xxxxx" does not exist - more info

2004-03-17 Thread Bill Moran
Valter wrote: What I didn't perceived before is DTS and pgAdmin create tables using quoted names like: CREATE TABLE "XYZ" while I create tables using non-quoted names like CREATE TABLE ABC. It happens that altough invisible to \dt am I unable to use these tables either in psql or DTS.

Re: [GENERAL] Data Corruption in case of abrupt failure

2004-03-17 Thread Bruce Momjian
Rod K wrote: > Does anyone know the equivalent to hdparm on FreeBSD? Yes, something like: In FreeBSD, add "hw.ata.wc=0" to /boot/loader.conf. -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a h

[GENERAL] Relation "xxxxx" does not exist - more info

2004-03-17 Thread Valter
What I didn't perceived before is DTS and pgAdmin create tables using quoted names like:   CREATE TABLE "XYZ"   while I create tables using non-quoted names like CREATE TABLE ABC.   It happens that altough invisible to \dt am I unable to use these tables either in psql or DTS.   In sum,

Re: [GENERAL] Data Corruption in case of abrupt failure

2004-03-17 Thread Rod K
Does anyone know the equivalent to hdparm on FreeBSD? > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of scott.marlowe > Sent: Wednesday, March 17, 2004 11:27 AM > To: Tom Lane > Cc: Keith C. Perry; Stephen Robert Norris; satish satish; > [EMAIL PROTECTED]

Re: [GENERAL] Check constraint

2004-03-17 Thread Stephan Szabo
On Wed, 17 Mar 2004, Richard Huxton wrote: > On Wednesday 17 March 2004 12:03, Francisco Reyes wrote: > > I have a "comment" field in a table that I want populated if another field > > has a certain value. Is it possible to set a check constraint for this? > > > > Example: > > Let's say we have fi

Re: [GENERAL] Check constraint

2004-03-17 Thread Francisco Reyes
On Wed, 17 Mar 2004, Stephan Szabo wrote: > Actually, shouldn't a table level check constraint be able to do this with > something like: > check (purchase_type!=3 or comment is not null) That worked Stephan. Gregory. I think yours would work too. Saw Stephans answer and tested before I saw your

[GENERAL] Relation "xxxxx" does not exist

2004-03-17 Thread Valter
When I create tables thru DTS (mssqlserver) or pgAdmin, I get the following message when I try select/insert row from/into this tables:Relation "table-name" does not exist   Command \dt lists all the tables, but \dt PATTERN doesn't.   Could it be charset/sort order or something like that?  

Re: [GENERAL] Check constraint

2004-03-17 Thread Bruno Wolff III
On Wed, Mar 17, 2004 at 12:03:04 +, Francisco Reyes <[EMAIL PROTECTED]> wrote: > I have a "comment" field in a table that I want populated if another field > has a certain value. Is it possible to set a check constraint for this? > > Example: > Let's say we have fields > Purchase_type smalli

Re: [GENERAL] Check constraint

2004-03-17 Thread Gregory Wood
I have a "comment" field in a table that I want populated if another field has a certain value. Is it possible to set a check constraint for this? Example: Let's say we have fields Purchase_type smallint check(purchase_type <4) comment varchar I need a check rule to something like (pseudo cod

Re: [GENERAL] Smallint - Integer Casting Problems in Plpgsql functions

2004-03-17 Thread Richard Huxton
On Wednesday 17 March 2004 15:54, Denis Gasparin wrote: > Hi, i'm upgrading our database from postgresql 7.2.3 to 7.4.2. > The import went fine but i have some casting problems with plpgsql > functions. > > I've create a test function with this code: > > create function test(varchar,smallint,intege

Re: [GENERAL] Converting Data From MS-Sql Server

2004-03-17 Thread Richard Huxton
On Wednesday 17 March 2004 14:55, Valter wrote: > I need some hints about converting my ms-sql server database to Postgre. > > Are there any tools for this convertion? There are a couple of items on techdocs about this: http://techdocs.postgresql.org/ -- Richard Huxton Archonet Ltd --

Re: [GENERAL] Check constraint

2004-03-17 Thread Richard Huxton
On Wednesday 17 March 2004 12:03, Francisco Reyes wrote: > I have a "comment" field in a table that I want populated if another field > has a certain value. Is it possible to set a check constraint for this? > > Example: > Let's say we have fields > Purchase_type smallint check(purchase_type <4) >

[GENERAL] Check constraint

2004-03-17 Thread Francisco Reyes
I have a "comment" field in a table that I want populated if another field has a certain value. Is it possible to set a check constraint for this? Example: Let's say we have fields Purchase_type smallint check(purchase_type <4) comment varchar I need a check rule to something like (pseudo c

Re: [GENERAL] Data Corruption in case of abrupt failure

2004-03-17 Thread Tom Lane
"scott.marlowe" <[EMAIL PROTECTED]> writes: > On Tue, 16 Mar 2004, Tom Lane wrote: >> What I'd suggest is to set up a simple test involving a long string of >> very small transactions (a bunch of separate INSERTs into a table with >> no indexes works fine). Time it twice, once with "fsync" enabled

Re: [GENERAL] Data Corruption in case of abrupt failure

2004-03-17 Thread scott.marlowe
On Tue, 16 Mar 2004, Tom Lane wrote: > "Keith C. Perry" <[EMAIL PROTECTED]> writes: > > I've read threads like this before and because I've never lost data on > > servers with IDE drives after doing some basic torture tests > > (e.g. pulling the plug in the middle of an update et al), I don't > >

Re: [GENERAL] Newbie question: OT

2004-03-17 Thread Tom Lane
"Robin 'Sparky' Kopetzky" <[EMAIL PROTECTED]> writes: > How do you pronounce PostgreSQl?? "post-gres" or "post-gres-cue-ell". See item 1.1 of the FAQ ;-) There used to be a .wav file on the website, but I can't find it at the moment. regards, tom lane