[SQL] Returning with the inserted id

2005-09-02 Thread Graf László
Hi all A table was created with: CREATE TABLE test ( id integer, nev varchar(25), datum timestamp ); A sequence to hold the id was defined with: CREATE SEQUENCE "public"."test_azon_seq" INCREMENT 1 MINVALUE

Re: [SQL] Returning with the inserted id

2005-09-02 Thread Richard Huxton
Graf László wrote: A sequence to hold the id was defined with: CREATE SEQUENCE "public"."test_azon_seq" INCREMENT 1 MINVALUE 101 MAXVALUE 9223372036854775807 START 101 CACHE 1; The function wich allocates the id and defines the datum is: CREATE FUNCTION test_ve

[SQL] cursor "" already in use

2005-09-02 Thread Stathis Stergou
Hi, list. I've created a stored function in plpgsql which uses some functions from postgis. CREATE OR REPLACE FUNCTION "public"."bufferfeatures" (integer [], text, text, double precision) RETURNS SETOF "public"."shapedummy" AS $body$ DECLARE source_layer_features ALIAS FOR $1; source_la

Re: [SQL] cursor "" already in use

2005-09-02 Thread Michael Fuhr
On Fri, Sep 02, 2005 at 02:17:52PM +0300, Stathis Stergou wrote: > ERROR: cursor "" already in use > CONTEXT: PL/pgSQL function "bufferfeatures" line 19 at open You're trying to open a cursor that's already open. Close the cursor at the end of the loop in which you opened it, so that it gets cl

[SQL] not sure about constraints

2005-09-02 Thread Jerome Alet
Hello, I've got 4 tables : CREATE TABLE tableA (id SERIAL PRIMARY KEY NOT NULL, blahA TEXT); CREATE TABLE tableB (id SERIAL PRIMARY KEY NOT NULL, blahB TEXT); CREATE TABLE tableC (id SERIAL PRIMARY KEY NOT NULL,

Re: [SQL] not sure about constraints

2005-09-02 Thread Achilleus Mantzios
O Jerome Alet έγραψε στις Sep 2, 2005 : > Hello, > > I've got 4 tables : > > CREATE TABLE tableA (id SERIAL PRIMARY KEY NOT NULL, > blahA TEXT); > > CREATE TABLE tableB (id SERIAL PRIMARY KEY NOT NULL, > blahB TEXT); >

Re: [SQL] not sure about constraints

2005-09-02 Thread Jerome Alet
On Fri, Sep 02, 2005 at 04:43:15PM +0300, Achilleus Mantzios wrote: > O Jerome Alet ?? Sep 2, 2005 : > > > I've got 4 tables : > > > > CREATE TABLE tableA (id SERIAL PRIMARY KEY NOT NULL, > > blahA TEXT); > > > > CREATE TABLE tableB (id SERIAL P

[SQL] Turn off auto-commit

2005-09-02 Thread Joÿffffffffffe3o Carvalho
Im working in postgresql 8.0 in windows XP. How can I turn off auto-commit. I already tried a few things but it didn't worked.Regards João Carvalho Yahoo! Messenger com voz: PROMOÇÃO VOCÊ PODE LEVAR UMA VIAGEM NA CONVERSA. Participe!

Re: [SQL] Turn off auto-commit

2005-09-02 Thread Owen Jacobson
You can turn off autocommit by explicitly starting a transaction (eg. with BEGIN; in psql or by turning off autocommit through ODBC).  Statements inside the transaction will not have their own, automatically-commited transactions.   HTH, Owen -Original Message-From: [EMAIL PROT

[SQL] Recommendation on bytea or blob for binary data like images

2005-09-02 Thread leon
Hi, I'd like to know what the official recommendation is on which binary datatype to use for common small-binary size use. I'm working with the Open For Business (www.ofbiz.org) framework, which by default maps binary data, such as shipping label images, into OID field types. In general, the data

Re: [SQL] Recommendation on bytea or blob for binary data like images

2005-09-02 Thread Tom Lane
[EMAIL PROTECTED] writes: > Hi, I'd like to know what the official recommendation is on which binary > datatype to use for common small-binary size use. If bytea will work for you, it's definitely the thing to use. The only real drawback to bytea is that there's currently no API to read and write

Re: [SQL] insert only if conditions are met?

2005-09-02 Thread Henry Ortega
Thanks for all your answers. Very helpful. What if after adding all those hours in one long transaction, I want to send a query to check the MONTHLY TOTAL HOURS (including those just entered) and if they exceed N number of hours, all those records added should *ROLLBACK*? BEGIN; insert.. i

Re: [SQL] insert only if conditions are met?

2005-09-02 Thread Philip Hallstrom
On Fri, 2 Sep 2005, Henry Ortega wrote: Thanks for all your answers. Very helpful. What if after adding all those hours in one long transaction, I want to send a query to check the MONTHLY TOTAL HOURS (including those just entered) and if they exceed N number of hours, all those records added

[SQL] Searching for results with an unknown amount of data

2005-09-02 Thread Oz
Hi, I've got two tables, A and B, the first one containing columns A_ID | info where A_ID is primary, so that this table stores various information about an object, and the second containing columns A_ID | property where property is an integer referring to a particular property that an object