Re: [SQL] yet pg_toast reindex

2003-06-17 Thread Tom Lane
"Eric Anderson Vianet SAO" <[EMAIL PROTECTED]> writes: > Sorry about this sucks thread but now i´v got following error > ERROR: relation "pg_toast_26474986" is of type "t" You may have to use REINDEX INDEX (on the index not the toast table of course) to get it to work in older versions. REINDEX d

Re: [SQL] [ADMIN] Can the frontend get notifications from the postgres server?

2003-06-17 Thread weigelt
On Tue, Jun 17, 2003 at 01:37:37PM -0700, Jonathan Gardner wrote: > Why in the world would you want to? Think about this for a moment: > The script runs in under a second - why would it want to sit around > and wait for a notification? No, my script runs hours, days, month ... cu -- -

Re: [SQL] Blobs with perl

2003-06-17 Thread Michael A Nachbaur
On Tuesday 17 June 2003 02:00 am, cristi wrote: > I want to insert a picture in a table from an internet browser using a > script made in perl. > Has somebody a code example with this kind a problem (I need only a code > fragment)? I put album covers into a database table, primarily because I want

Re: [SQL] Blobs with perl

2003-06-17 Thread Rudi Starcevic
Hi, For not so big applications you could consider converting the binary image/file into text, using base64, then store the resulting text. For example I have an app. where each member may have one or two images on their account. So when the user upload's their image I base64 it and store the

Re: [SQL] [ADMIN] Notification

2003-06-17 Thread Jonathan Gardner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tuesday 17 June 2003 05:13, Anagha Joshi wrote: > Hi All, > I'm new to Postgres. I'm using Postgres-7.2.4 > Can anybody guide me in detail how 'NOTIFY-LISTEN' can be implemented > progmatically bet'n frontend and backend? > Might want to move this

Re: [SQL] yet pg_toast reindex

2003-06-17 Thread Eric Anderson Vianet SAO
Sorry about this sucks thread but now i´v got following error ERROR: relation "pg_toast_26474986" is of type "t" I looked for "type t" around documentation and don´t find something usefull. tnx Eric Anderson Martins Miranda Net Admin @ Via Net SAO - Original Message - From: "Tom Lane" <

[SQL] join syntax

2003-06-17 Thread Jodi Kanter
Title: One of my colleagues has created a database where he has the same field name in two tables and uses this field to link his tables rather than some arbitrary value. For example, he has used "exp_id" in two tables. When writing his joins he uses a syntax tha

Re: [SQL] Catching DML exceptions in PL/pgSQL

2003-06-17 Thread Radu-Adrian Popescu
At 6/17/2003 08:33, Josh Berkus wrote: Radu, > In any event, like I said, my java code should work with the functions as > they are now, whether db throws an exception or returns some result. > Also, the oracle-like exception handling would be really great and i know > i'm looking forward to it

Re: [SQL] join syntax

2003-06-17 Thread scott.marlowe
On Tue, 17 Jun 2003, Jodi Kanter wrote: > One of my colleagues has created a database where he has the same field > name in two tables and uses this field to link his tables rather than > some arbitrary value. For example, he has used "exp_id" in two tables. > When writing his joins he uses a s

Re: [SQL] disabling triggers

2003-06-17 Thread Josh Berkus
Mallah, > in past we tried creating a plpgsql function that takes relname and schema > and try setting reltriggers=0 on disabling and = (select count(*) from pg_trigger > for that relname and schema) on enabling . > > we got stuck somewhere and abandoned it , do u think above approach > would

Re: [SQL] join syntax

2003-06-17 Thread Josh Berkus
Jodi, > One of my colleagues has created a database where he has the same field > name in two tables and uses this field to link his tables rather than > some arbitrary value. For example, he has used "exp_id" in two tables. > When writing his joins he uses a syntax that says something like JOI

Re: [SQL] disabling triggers

2003-06-17 Thread mallah
> Mallah, > >> >> Is setting reltriggers=0 on pg_class an accepatble way of >> >> disabling triggers on a table temporarily? >> >> Ok , but someone on list was scary few months back. > > I've done it many times without a problem. The trick is re-setting the triggers to > the > correct number wh

Re: [SQL] [HACKERS] Our FLOAT(p) precision does not conform to spec

2003-06-17 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > Considering that the data type float(x) isn't documented anywhere, I'm not > worried. Good point ... I'll fix that while I'm at it ... regards, tom lane ---(end of broadcast)---

Re: [SQL] disabling triggers

2003-06-17 Thread Josh Berkus
Mallah, > >> Is setting reltriggers=0 on pg_class an accepatble way of > >> disabling triggers on a table temporarily? > > Ok , but someone on list was scary few months back. I've done it many times without a problem. The trick is re-setting the triggers to the correct number when you're done

[SQL] disabling triggers

2003-06-17 Thread mallah
Hi, Is setting reltriggers=0 on pg_class an accepatble way of disabling triggers on a table temporarily? secondly is it worth having commands like alter trigger inactive; alter trigger active ; i feel such commands exists on Oracle. sometime we need to bulk update tables from backdoor and we

Re: [SQL] date question

2003-06-17 Thread Peter Eisentraut
javier garcia - CEBAS writes: > Is there a way to create a table from this table, directly in Postgres in > which a date field is created based in the values of "year", "month", "day" > in this table? year * interval '1 year' + month * interval '1 month' + day * interval '1 day' This results in

Re: [SQL] disabling triggers

2003-06-17 Thread Josh Berkus
Mallah, > Is setting reltriggers=0 on pg_class an accepatble way of > disabling triggers on a table temporarily? Yes. pg_dump does this. > secondly is it worth having commands like > alter trigger inactive; > alter trigger active ; > i feel such commands exists on Oracle. No, since DROP TRI

Re: [SQL] disabling triggers

2003-06-17 Thread mallah
> Mallah, > >> Is setting reltriggers=0 on pg_class an accepatble way of >> disabling triggers on a table temporarily? Ok , but someone on list was scary few months back. > > Yes. pg_dump does this. > >> secondly is it worth having commands like >> alter trigger inactive; >> alter trigger act

Re: [SQL] [HACKERS] Our FLOAT(p) precision does not conform to spec

2003-06-17 Thread Peter Eisentraut
Tom Lane writes: > This is a straightforward change and would not break pg_dump files, > since fortunately pg_dump always references the underlying types and > never refers to anything as FLOAT(p). But I wonder whether it is > likely to break many existing applications. There is a hazard of some

Re: [SQL] CREATE table1 FROM table2

2003-06-17 Thread Guillaume LELARGE
Hi, Le Mardi 17 Juin 2003 20:46, Achilleus Mantzios a écrit : > On 17 Jun 2003, Rado Petrik wrote: > > How I create table1 from other table2 . > > > > "cp table1 table2" > > create table table2 as select * from table1; > Another way would be: select * into table2 from table1; (See http://www.p

Re: [SQL] Object-Relational table design question

2003-06-17 Thread Josh Berkus
Michael, > (BTW, if this isn't the correct forum to post this in, please let me know.) This is the right forum. > I thought of defining the different services in their tables, all inherited > from the base "Service" table, and then insert rows for the different > services of each (for instance "

[SQL] Object-Relational table design question

2003-06-17 Thread Michael A Nachbaur
Hello everyone. I'm re-designing an ISP billing / customer tracking system, and I am confused a bit about object-relational tables. PostgreSQL is the first ORDBMS I've used and, though I've been using it for about two years now, I have never taken advantage of it's inheritance functionality.

Re: [SQL] Catching DML exceptions in PL/pgSQL

2003-06-17 Thread Josh Berkus
Radu, > In any event, like I said, my java code should work with the functions as > they are now, whether db throws an exception or returns some result. > Also, the oracle-like exception handling would be really great and i know > i'm looking forward to it ! > Maybe in 7.5 ? Unfortunately, we see

Re: [SQL] CREATE table1 FROM table2

2003-06-17 Thread Tomasz Myrta
Dnia 2003-06-17 17:20, Użytkownik Rado Petrik napisał: Hi, How I create table1 from other table2 . "cp table1 table2" create table2 as select * from table1; It is described in Postgresql documentation SQL Commands -> "create table as" Regards, Tomasz Myrta ---(end of br

Re: [SQL] CREATE table1 FROM table2

2003-06-17 Thread Nicolas JOUANIN
Hi, Documentation says: CREATE [ [ LOCAL ] { TEMPORARY | TEMP } ] TABLE table_name [ (column_name [, ...] ) ] AS query example : create table table1 as select * from table2; > -Message d'origine- > De : [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] la part de Rado Petrik > Envoyé

Re: [SQL] CREATE table1 FROM table2

2003-06-17 Thread Achilleus Mantzios
On 17 Jun 2003, Rado Petrik wrote: > Hi, > > How I create table1 from other table2 . > > "cp table1 table2" create table table2 as select * from table1; > > Thanks. > > -- == Achilleus Mantzios S/W Engineer IT dept Dynaco

Re: [SQL] CREATE table1 FROM table2

2003-06-17 Thread Devrim GUNDUZ
Hi, On 17 Jun 2003, Rado Petrik wrote: > How I create table1 from other table2 . CREATE TABLE table1 AS SELECT * FROM table2; will work. Regards, -- Devrim GUNDUZ [EMAIL PROTECTED] [EMAIL PROTECTED] http://www.tdmsoft.com

[SQL] CREATE table1 FROM table2

2003-06-17 Thread Rado Petrik
Hi, How I create table1 from other table2 . "cp table1 table2" Thanks. -- Rado Petrik <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] yet pg_toast reindex

2003-06-17 Thread Tom Lane
"Eric Anderson Vianet SAO" <[EMAIL PROTECTED]> writes: > When I try to reindex a toast table with command ´REINDEX TABLE > pg_toast_16557' I receive following error message: > ERROR: "pg_toast_16557" is a system table. call REINDEX under standalone > postgres with -O -P options > So I restart postm

Re: [SQL] Blobs with perl

2003-06-17 Thread Jonathan Gardner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tuesday 17 June 2003 02:00, cristi wrote: > I want to insert a picture in a table from an internet browser using a > script made in perl. > Has somebody a code example with this kind a problem (I need only a code > fragment)? > Despite PostgreSQL's

Re: [SQL] [HACKERS] Our FLOAT(p) precision does not conform to spec

2003-06-17 Thread Tom Lane
"Shridhar Daithankar" <[EMAIL PROTECTED]> writes: > On 16 Jun 2003 at 18:15, Tom Lane wrote: >> This is a straightforward change and would not break pg_dump files, >> since fortunately pg_dump always references the underlying types and >> never refers to anything as FLOAT(p). But I wonder whether

[SQL] yet pg_toast reindex

2003-06-17 Thread Eric Anderson Vianet SAO
When I try to reindex a toast table with command ´REINDEX TABLE pg_toast_16557' I receive following error message: ERROR: "pg_toast_16557" is a system table. call REINDEX under standalone postgres with -O -P options So I restart postmaster standalone (no -i option) and I receive same error. how

Re: [SQL] select date range?

2003-06-17 Thread scott.marlowe
On Tue, 17 Jun 2003, ko wrote: > Hi, > > When I use sql statement to select the date range from $_POST value,It doesn't work. > > --- > "select * from mydatabase where mydate between '$_POST[start_date]' and > '$_POST[end_date]' " > > There is no error,b

Re: [SQL] help

2003-06-17 Thread Tony Simbine
Josh, thanks for your help. Josh Berkus wrote: Tony, I've a query which needs too many time ca. 12-15 sec. how can i get a better perfomance? First of all, please take this to the PGSQL-PERFORMANCE list. Second, see this web page: http://techdocs.postgresql.org/guides/SlowQueryPostingGuideli

Re: [SQL] Catching DML exceptions in PL/pgSQL

2003-06-17 Thread Radu-Adrian Popescu
Joe, Tomasz, Thanks for the reply. In any event, like I said, my java code should work with the functions as they are now, whether db throws an exception or returns some result. Also, the oracle-like exception handling would be really great and i know i'm looking forward to it ! Maybe in 7.5 ?

Re: [SQL] Catching DML exceptions in PL/pgSQL

2003-06-17 Thread Joe Conway
Radu-Adrian Popescu wrote: . begin _res.code:=1; select id into iid from log where id=_id; if not found then begin _res.msg:=''insert''; *insert into log (log, data) values (_log, _data); if not found* then begin _res.msg:=_res.msg

Re: [SQL] Catching DML exceptions in PL/pgSQL

2003-06-17 Thread Radu-Adrian Popescu
At 6/17/2003 11:44, Tomasz Myrta wrote: Dnia 2003-06-17 11:25, U¿ytkownik Radu-Adrian Popescu napisa³: Hello all, (and sorry if this has been aswered before) Take this piece of code for example: . begin _res.code:=1; select id into iid from log where id=_id; if no

Re: [SQL] Catching DML exceptions in PL/pgSQL

2003-06-17 Thread Tomasz Myrta
Dnia 2003-06-17 11:25, Użytkownik Radu-Adrian Popescu napisał: Hello all, (and sorry if this has been aswered before) Take this piece of code for example: . begin _res.code:=1; select id into iid from log where id=_id; if not found then begin _res.msg:=''ins

[SQL] Catching DML exceptions in PL/pgSQL

2003-06-17 Thread Radu-Adrian Popescu
Hello all, (and sorry if this has been aswered before) Take this piece of code for example: . begin     _res.code:=1;     select id into iid from log where id=_id;     if not found then begin     _res.msg:=''insert'';     insert into log (log, data) values (_log, _data

[SQL] Blobs with perl

2003-06-17 Thread cristi
I want to insert a picture in a table from an internet browser using a script made in perl. Has somebody a code example with this kind a problem (I need only a code fragment)? Thanks! ---(end of broadcast)--- TIP 9: the planner will ignore your des