Re: [GENERAL] no value fetch

2004-07-28 Thread Jim Seymour
Stephan Szabo [EMAIL PROTECTED] wrote: On Tue, 27 Jul 2004, BRINER Cedric wrote: hi, Imagine that I have the following table where ts_sent is a timestamp(0) select * from notification; to_used| ts_sent | from

Re: [GENERAL] Discussion wanted: 'Trigger on Delete' cascade.

2004-07-28 Thread Pierre-Frdric Caillaud
Display all headersTo: R.Welz [EMAIL PROTECTED] Subject: Re: [GENERAL] Discussion wanted: 'Trigger on Delete' cascade. Date: Wed, 28 Jul 2004 13:24:26 +0200 From: Pierre-Frédéric Caillaud [EMAIL PROTECTED] Organization: La Boutique Numérique From what you say, your do not need a link table. A

Re: [GENERAL] Sql injection attacks

2004-07-28 Thread Pierre-Frdric Caillaud
update tablea set a=10-$inputstring where key=1; Add parenthesis: update tablea set a=10-($inputstring) where key=1; Thus you get : update tablea set a=10-(-1) where key=1; instead of : update tablea set a=10--1 where key=1; You'd have a problem because -- is the

[GENERAL] Indexes on Character Types

2004-07-28 Thread val
In the 7.3 documentation about character data types (http://www.postgresql.org/docs/7.3/static/datatype- character.html), it states: Tip: There are no performance differences between these* three types, apart from the increased storage size when using the blank-padded type. *referencing

[GENERAL] EXPLAIN on DELETE statements

2004-07-28 Thread Janning Vygen
Hi, EXPLAIN on delete stamements works, but doesn't show me all the subsequent deletes or checks which has to be done because of foreign keys cascading/restricting. Is there a solution to show up which tables are checked and which scans the planner is going to use to check these related

Re: [GENERAL] altering a table to set serial function

2004-07-28 Thread Prabu Subroto
Dear Scott... My God so I can not use alter table to define a column with int data type? Here is the detail condition: I have created a table sales. And I forgot to define auto_increment for primary key salesid (int4). the table has already contented the data. I built an application with

Re: [GENERAL] Discussion wanted: 'Trigger on Delete' cascade.

2004-07-28 Thread R.Welz
Yes. A magazine can have several e-mail addresses, and one e-mail address can belong to several magazines. Well, the e-mail addresses belongs to the publisher but for simplification the e-mail address is linked with the magazine. So what is really more important is that I don't know, is there

Re: [GENERAL] Sql injection attacks

2004-07-28 Thread Geoff Caplan
Hi folks Very instructive thread. Thanks to everyone for the input, and especial thanks to Lincoln Yeoh for his detailed explanation of his approach: a standout post! Sorry for the silence - it's not that I'm unappreciative, just that I've been away from my desk. Tom Lane wrote: I think you

Re: [GENERAL] altering a table to set serial function

2004-07-28 Thread Doug McNaught
Prabu Subroto [EMAIL PROTECTED] writes: If I read your suggestion, that means...I have drop the column salesid and re-create the column salesid. and it means, I will the data in the current salesid column. Do you have further suggestion? You can do it by hand without dropping the column:

Re: [GENERAL] altering a starting value of serial macro

2004-07-28 Thread Prabu Subroto
OK I did it : create sequence sales_salesid_seq; alter table sales alter column salesid set default nextval('sales_salesid_seq'); but a new problem comes, because the table sales is not empty. if the sequence counter reach a value that already exists in the table sales than of course comes this

Re: [GENERAL] altering a table to set serial function

2004-07-28 Thread Prabu Subroto
This is exactly what I need.. Thank you very much for your kindness, Doug. Thank you...thank you...veryvery,,, much. --- Doug McNaught [EMAIL PROTECTED] wrote: Prabu Subroto [EMAIL PROTECTED] writes: If I read your suggestion, that means...I have drop the column salesid and re-create

[GENERAL] Cascade Order

2004-07-28 Thread Marty Alchin
Fir of all, hello to all of you. I'm new to this list, and I apologize if this has already been asked, but the mailing list archives don't seem to be responding at the moment for me to search through. In my uses of PostgreSQL, I'm developing a revision control system for some of my data, and

[GENERAL] Strange constraint violation when applying rules to a view.

2004-07-28 Thread Peter Gebauer
Hello. This section works fine: CREATE TABLE torder ( id INT8 NOT NULL PRIMARY KEY ); CREATE TABLE torder_row ( idINT8 NOT NULL PRIMARY KEY, torder_id INT8 NOT NULL REFERENCES torder (id) ON DELETE RESTRICT ); CREATE VIEW vorder(orderID, rowID) AS SELECT

Re: [GENERAL] altering a starting value of serial macro

2004-07-28 Thread John Sidney-Woollett
You missed the command: SELECT setval('salesid_seq', (SELECT max(salesid) FROM sales) + 1); John Sidney-Woollett Prabu Subroto wrote: OK I did it : create sequence sales_salesid_seq; alter table sales alter column salesid set default nextval('sales_salesid_seq'); but a new problem comes, because

Re: [GENERAL] Before/After trigger sequencing questiont

2004-07-28 Thread Tom Lane
Mike Nolan [EMAIL PROTECTED] writes: 3. The 'after insert' trigger on the first table calls another procedure using plperlu which in turn executes an external PHP program that does a lookup on the 2nd table (using one of the updated values as a key) then sends some e-mail. It

Re: [GENERAL] altering a starting value of serial macro

2004-07-28 Thread Prabu Subroto
It's solved. Thank you very much for your kindness. --- John Sidney-Woollett [EMAIL PROTECTED] wrote: You missed the command: SELECT setval('salesid_seq', (SELECT max(salesid) FROM sales) + 1); John Sidney-Woollett Prabu Subroto wrote: OK I did it : create sequence

Re: [GENERAL] Before/After trigger sequencing questiont

2004-07-28 Thread Mike Nolan
Yeah, that would be my interpretation: the after trigger runs just before the transaction commits, and your external PHP program can't see the results since they haven't been committed yet. Your description makes it sound like the trigger invokes the PHP code synchronously, in which case

Re: [GENERAL] Loading/Retrieving bytea fields?

2004-07-28 Thread Daniel Verite
Jerry LeVan writes Has anyone found some C code that shows how to load/extract data from a bytea column? This works for me: int size; const char* contents; PGresult* res; res = PQexecParams(pgconn, SELECT contents FROM tblob WHERE pkey=value, 0, NULL,NULL,NULL,NULL,

Re: [GENERAL] tablename type?

2004-07-28 Thread Tom Lane
[EMAIL PROTECTED] (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) writes: Typing this at the psql prompt, however, simply results in the following message: ERROR: type tablename does not exist The example is just an example. Create an actual table and use its name.

Re: [GENERAL] Sql injection attacks

2004-07-28 Thread Harald Fuchs
In article [EMAIL PROTECTED], Lincoln Yeoh [EMAIL PROTECTED] writes: Just curious on what are the correct/official ways for dealing with the following scenarios: 1) Input string contains % and _ and would be used in a LIKE query that should not have user controllable wildcards. Perhaps you

Re: [GENERAL] tablename type?

2004-07-28 Thread Dag-Erling Smørgrav
Tom Lane [EMAIL PROTECTED] writes: [EMAIL PROTECTED] (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) writes: ERROR: type tablename does not exist The example is just an example. Create an actual table and use its name. If you read the example, you will see that the function is clearly intended to

Re: [GENERAL] NNTP server

2004-07-28 Thread Chris Browne
[EMAIL PROTECTED] (Marc G. Fournier) writes: mail server was down for a few others today with a 'page fault panic' ... should start flowing again now ... Message from the Guild Navigator on Tupile to the Imperial Postmaster on Arrakis... ... The Mail must flow... :-) (With due apologies to

Re: [GENERAL] altering a table to set serial function

2004-07-28 Thread Scott Marlowe
On Wed, 2004-07-28 at 06:09, Prabu Subroto wrote: Dear Scott... My God so I can not use alter table to define a column with int data type? Not define, REdefine. Right now, the version going into beta will let you redefine columns from one type to another. Til then, you have to make a

Re: [GENERAL] tablename type?

2004-07-28 Thread Tom Lane
[EMAIL PROTECTED] (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) writes: Tom Lane [EMAIL PROTECTED] writes: [EMAIL PROTECTED] (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) writes: ERROR: type tablename does not exist The example is just an example. Create an actual table and use its name. If you