[GENERAL] EXCEPTION in pl/pgsql

2005-07-19 Thread Craig Bryden
Hi All What is the syntax if I want to use the exception clause in a pl/pgsql function, but am not looking for a particular error. Kind of like a "any error" type thing. some thing like: CREATE OR REPLACE FUNCTION func1(p_Param1 int4) RETURNS int4 AS $$ DECLARE v_Var1 int4; BEGIN [Sta

[GENERAL] Help needed with PGOleDB driver and ADO

2005-07-14 Thread Craig Bryden
Hi   We have a numeric field in our table. When setting the value of this field to 1.00, we experience the following problem when using ADO (with the PgOleDB driver) to query the table.   the field comes back correctly identified as a NUMERIC field, but the actual value of of the field is

Re: [GENERAL] Transaction Handling in pl/pgsql

2005-07-12 Thread Craig Bryden
Thanks a stack. That has answered by question. Craig - Original Message - From: "Douglas McNaught" <[EMAIL PROTECTED]> To: "Craig Bryden" <[EMAIL PROTECTED]> Cc: "pgsql" Sent: Tuesday, July 12, 2005 8:46 PM Subject: Re: [GENERAL] Transact

Re: [GENERAL] Transaction Handling in pl/pgsql

2005-07-12 Thread Craig Bryden
What if the select calling my function is not in it's own explicit transaction block? Thanks Craig - Original Message - From: "Jaime Casanova" <[EMAIL PROTECTED]> To: "Craig Bryden" <[EMAIL PROTECTED]> Cc: "pgsql" Sent: Tuesday, July 12,

Re: [GENERAL] Transaction Handling in pl/pgsql

2005-07-12 Thread Craig Bryden
se will all the statements still be rolled back if an error occurs? Thanks Craig - Original Message - From: "Douglas McNaught" <[EMAIL PROTECTED]> To: "Craig Bryden" <[EMAIL PROTECTED]> Cc: "pgsql" Sent: Tuesday, July 12, 2005 7:43 PM Subject: Re: [GE

[GENERAL] Transaction Handling in pl/pgsql

2005-07-12 Thread Craig Bryden
Hi I am trying to get a better understanding of how transactions work in pl/pgsql functions. I found the following text in the help: "It is important not to confuse the use of BEGIN/END for grouping statements in PL/pgSQL with the database commands for transaction control. PL/pgSQL's BEGIN/END are

[GENERAL] Debugging PL/pgSQL

2005-06-21 Thread Craig Bryden
Hi Does anyone know of a free SQL Editor that allows you to debug PL/pgSQL functions? Thanks Craig ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

[GENERAL] Dynamic SQL

2005-06-16 Thread Craig Bryden
Hi I am trying to get information on how to do "Dynamic SQL" in PostgreSQL (preferably pg/plsql). Please can someone give an exaple of how this is done or direct me to the relevant documentation. Thanks Craig ---(end of broadcast)--- TIP 5: Have y

[GENERAL] Getting the Type Definition in the information schema

2005-06-05 Thread Craig Bryden
Hi I am trying to figure out which view in the information schema or the system catalogs will give me the members/columns of a user defined data type. Any help with this would be great. Thanks Craig ---(end of broadcast)--- TIP 6: Have you searche

[GENERAL] Clustering Database Servers

2005-05-09 Thread Craig Bryden
Hi In MS SQL there is a concept of Clustering database servers. This allows for load balancing. Does PostgreSQL have a similar concept? Thanks Craig ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate

[GENERAL] Date addition/subtraction

2005-05-03 Thread Craig Bryden
Hi How in postgres can I do date/time subtraction or addition. e.g. If I want to get today's date - 30 days? or current_timestamp - 1 hour? Thanks Craig ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate

Re: [GENERAL] scripts in Postgres

2005-05-02 Thread Craig Bryden
ssage - From: "Sean Davis" <[EMAIL PROTECTED]> To: "Craig Bryden" <[EMAIL PROTECTED]>; "pgsql" Sent: Monday, May 02, 2005 2:11 PM Subject: Re: [GENERAL] scripts in Postgres > DROP TABLE tb_messages; > CREATE TABLE tb_messages ( > > ); &g

Re: [GENERAL] scripts in Postgres

2005-05-02 Thread Craig Bryden
ssage - From: "Sean Davis" <[EMAIL PROTECTED]> To: "Craig Bryden" <[EMAIL PROTECTED]>; "pgsql" Sent: Monday, May 02, 2005 1:57 PM Subject: Re: [GENERAL] scripts in Postgres > Yes, pl/pgsql needs to be written as a function. If you want to "

[GENERAL] scripts in Postgres

2005-05-02 Thread Craig Bryden
Hi I am fairly new to Postgres and am struggling to understand one concept. If I wish to use pl/pgsql, must it be in a function? An example of where I would not want it to be in a function is: I have a CREATE TABLE statement that I want to execute. But the script must first check for the existenc

[GENERAL] PRIMARY KEY and indexes

2005-04-23 Thread Craig Bryden
Hi I come from a MS-SQL background and I'm trying to get some clarity on indexes in Postgres. If anyone can help with the following questions it would be much appreciated: 1. When creating a primary key contraint on a table, is an equivalent index automatically created for you, or would I have to

Re: [GENERAL] Division by zero

2005-04-16 Thread Craig Bryden
Hi Costin I am very experienced with MS-SQL and have had very basic training on Oracle and both of these raise an exception as well. I would suggest that a RDBMS that automatically converts to null is way off the standards. Craig - Original Message - From: "Costin Manda" <[EMAIL PROTEC

Re: [GENERAL] ADO and timestamp/date errors

2005-02-24 Thread Craig Bryden
ROTECTED]> To: "Craig Bryden" <[EMAIL PROTECTED]> Cc: "Shachar Shemesh" <[EMAIL PROTECTED]>; "pgsql" Sent: Wednesday, February 23, 2005 11:09 PM Subject: Re: [GENERAL] ADO and timestamp/date errors > Hi Craig, > > Out of curiosity, beside port

Re: [GENERAL] ADO and timestamp/date errors

2005-02-23 Thread Craig Bryden
the function is: CREATE TYPE pr_getplayerbyid_returntype AS (playerid int4, firstname varchar(100), lastname varchar(100), initials varchar(15), email varchar(255), datecreated timestamp); Thanks Craig - Original Message ----- From: "Shachar Shemesh" <[E

Re: [GENERAL] ADO and timestamp/date errors

2005-02-22 Thread Craig Bryden
king fine.   Thanks Craig     - Original Message - From: "Shachar Shemesh" <[EMAIL PROTECTED]> To: "Craig Bryden" <[EMAIL PROTECTED]> Cc: "pgsql" <pgsql-general@postgresql.org> Sent: Tuesday, February 22, 2005 6:13 AM Subject: Re: [GE

[GENERAL] ADO and timestamp/date errors

2005-02-21 Thread Craig Bryden
Hi I am trying to read a data set in ADO. If I exclude a timestamp field that I have in the return type, all works wonderfully. The moment I include the timestamp (i've even tried casting it as date) it bombs out with an OLEDB Exception of some type. Has anyone got any ideas? Thanks Craig

[GENERAL] OLEDB and the port number

2005-02-16 Thread Craig Bryden
Hi Can anyone help me with the oledb driver. I have RC1 of Postgres 8 installed on the default(5432) port. I have the full release version installed on port 5433. I am trying to get the OLEDB connection to look at port 5433. Below is my connection string. It works for the RC1 installation (on port

[GENERAL] PL/pgSQL functions and RETURN NEXT

2005-01-30 Thread Craig Bryden
Hi Firstly, let me say that I am a newbie to PostgreSQL. I have written a PL/pgSQL function that will return a set of results. I have included the code below *** CREATE TYPE pr_SomeFunction_Re

[GENERAL] Functions that return RECORD type

2005-01-13 Thread Craig Bryden
Hi I come from a MS-SQL background and am trying to figure out what is wrong with the function below: * CREATE OR REPLACE FUNCTION GetAccountInfo (p_AccID int) RETURNS record AS $$ DECLARE r_Return record; BE

[GENERAL] Functions returning RECORD

2005-01-13 Thread Craig Bryden
Hi   I come from a MS-SQL background and am trying to figure out what is wrong with the function below: * CREATE OR REPLACE FUNCTION GetAccountInfo (p_AccID int)RETURNS record AS$$DECLARE r_Return record;

[GENERAL] MS-SQL to PostgreSQL

2005-01-07 Thread Craig Bryden
Hi Below is a snippet of MS-SQL code. Please can someone translate this to plpgsql for me. ** DECLARE @MaxVal int, @MinVal int SELECT @MaxVal = MAX(Value), @MinVal = MIN(Value) FROM ABC ***

Re: [GENERAL] Books for experienced DB developer

2005-01-07 Thread Craig Bryden
too much time explaining RDBMS basics. Thanks Craig From: Michael Fuhr <[EMAIL PROTECTED]> To: Craig Bryden <[EMAIL PROTECTED]> CC: pgsql-general@postgresql.org Subject: Re: [GENERAL] Books for experienced DB developer Date: Fri, 7 Jan 2005 02:58:29 -0700 On Fri, Jan 07, 2005 at 11:3

[GENERAL] Books for experienced developers

2005-01-07 Thread Craig Bryden
Hi I have vast experience working with MS-SQL. Which books would be good for me to use in order to teach myself PostgreSQL? I need to migrate a MS-SQL Db to PostgreSQL. It contains tablers,views,stored procs, and user defined functions. Thanks Craig _

[GENERAL] Books for experienced DB developer

2005-01-07 Thread Craig Bryden
Hi I am a very experienced MS-SQL developer. I am looking to port a database to PostgreSQL. Which books that are available would be ideal for someone who is already an experienced DB developer? Thanks Craig _ Pop-up ads giving you a