[SQL] record type

2008-07-11 Thread Marcin Krawczyk
Or maybe anyone knows how to work with record types ? How to insert something like ('1','2','3') into a table, or split it ? Anything ? regards mk

Re: [SQL] record type

2008-07-11 Thread Pawel Socha
2008/7/10 Marcin Krawczyk [EMAIL PROTECTED]: Hi. I need to know whether it's possible for a plpgsql function to accept record type parameters ? Is there a way to accomplish that ? I need to use something like ('1','2','3') as a parameter. regards mk All about record type

Re: [SQL] record type

2008-07-11 Thread Marcin Krawczyk
Nice thanks a lot. Niezłe, dzieki. regards pozdrowienia mk 2008/7/11 Pawel Socha [EMAIL PROTECTED]: 2008/7/10 Marcin Krawczyk [EMAIL PROTECTED]: Hi. I need to know whether it's possible for a plpgsql function to accept record type parameters ? Is there a way to accomplish that ? I need

[SQL] ESQL CREATE DATABASE

2008-07-11 Thread Krejci, Pavel
Hello, I am using embedded SQL command for creating the database: EXEC SQL BEGIN DECLARE SECTION; char dbase[32]; EXEC SQL END DECLARE SECTION; ... EXEC SQL CONNECT TO postgres; //the create database cannot be run in transaction block EXEC SQL SET AUTOCOMMIT TO ON; EXEC SQL CREATE

[SQL] Rollback in Postgres

2008-07-11 Thread samantha mahindrakar
Hi all This is a very basic question.can we roll back data after we run a query. I know that a delete within a transaction can be rolled back. But how about independent delete queries??? If i ran a delete statement and lost data...how do i recover. I know that oracle has this provision of

Re: [SQL] Rollback in Postgres

2008-07-11 Thread Mark Roberts
On Fri, 2008-07-11 at 11:43 -0400, samantha mahindrakar wrote: Hi all This is a very basic question.can we roll back data after we run a query. I know that a delete within a transaction can be rolled back. But how about independent delete queries??? If i ran a delete statement and

[SQL] Unnecessary repeat condition for a self inner join

2008-07-11 Thread Robins Tharakan
Hi, I am not sure if this is a simple (... stupid) question but I just wasted two hours optimizing a query, so I thought I should drop in to ask. The only difference between query1 and query2 (below) is that despite an explicit INNER JOIN, I have repeated the same condition for n2 (as given for

[SQL] When was my database created

2008-07-11 Thread Matthew T. O'Connor
Hopefully this is an easy one and sorry if I should have found this in the docs somewhere but a cursory glance didn't turn anything up. How do I tell how old my database is, that is, when was create db for this database done? Thank you, Matthew O'Connor -- Sent via pgsql-sql mailing list

Re: [SQL] Rollback in Postgres

2008-07-11 Thread Scott Marlowe
On Fri, Jul 11, 2008 at 9:43 AM, samantha mahindrakar [EMAIL PROTECTED] wrote: Hi all This is a very basic question.can we roll back data after we run a query. I know that a delete within a transaction can be rolled back. But how about independent delete queries??? If i ran a delete

[SQL] function that returns a set of records and integer(both of them)‏

2008-07-11 Thread daniel blanco
Hi Everyone I would like to know if i can create a function that returns a set of record with the sql statement: select and a integer, i mean both of them, because i remenber that in sql server (transact sql) i can do that in a stored procedure doing a select statement and a return of a

Re: [SQL] Rollback in Postgres

2008-07-11 Thread Simon Riggs
On Fri, 2008-07-11 at 11:21 -0600, Scott Marlowe wrote: rollback after commit Are you sure? Personally I don't think its viable. If it really does that it will would also need to rollback all transactions whose changes depend upon the earlier transaction. It would also need to track

Re: [SQL] When was my database created

2008-07-11 Thread Steve Crawford
Matthew T. O'Connor wrote: How do I tell how old my database is, that is, when was create db for this database done? Short answer: you can't - at least not reliably and directly. You can look in the data directory associated with the database in which you are interested and check the

Re: [SQL] Unnecessary repeat condition for a self inner join

2008-07-11 Thread Tom Lane
Robins Tharakan [EMAIL PROTECTED] writes: In case of an INNER JOIN, shouldn't the second condition (in Query2) be unnecessary ? Or am I being unreasonable in this expectation ? SELECT n1.scheme_code FROM nav n1 INNER JOIN nav n2 ON n1.scheme_code = n2.scheme_code WHERE n1.scheme_code

[SQL] PERSISTANT PREPARE (another point of view)

2008-07-11 Thread Milan Oparnica
Hi, We are new to Postgre, actually we are migrating from MICROSOFT DBMS technologies to...hopefully Postgre. Our company is involved in ERP business software in Serbia and region, currently counting over 200 clients. Some of them have DB's over 4GB in size. Reason for posting is

Re: [SQL] PERSISTANT PREPARE (another point of view)

2008-07-11 Thread Tom Lane
Milan Oparnica [EMAIL PROTECTED] writes: [ much snipped ] What could we gain by introducing a kind of global prepared statement area, is SIMPLICITY of DB DEVELOPMENT AND MAINTENANCE. The idea is: LETS SEPARATE SQL STATEMENTS FROM APPLICATION CODE. Most people around this project think that

Re: [SQL] PERSISTANT PREPARE (another point of view)

2008-07-11 Thread Steve Midgley
At 04:31 PM 7/11/2008, [EMAIL PROTECTED] wrote: Date: Fri, 11 Jul 2008 23:31:03 + From: Milan Oparnica [EMAIL PROTECTED] To: pgsql-sql@postgresql.org Subject: PERSISTANT PREPARE (another point of view) Message-ID: [EMAIL PROTECTED] [snip] What could we gain by introducing a kind of global

Re: [SQL] Rollback in Postgres

2008-07-11 Thread Lewis Cunningham
In addition to allowing you to read old data, Flashback will allow you to rollback to a point in time, including returning a single table to a specific state. Flashback database is like PITR without the log files. It started in 9i and improved dramatically in 10g. 11g has made additional