[SQL] Is it possible to get DISTINCT rows from RETURNING clause?

2011-02-16 Thread Gnanakumar
Hi, Is it possible to get DISTINCT rows from an UPDATE statement using RETURNING clause? "MYTABLE" columns are: APRIMARYKEYCOLUMN ABOOLEANCOLUMN EMAIL COLUMN1 COLUMN2 COLUMN3 UPDATE using RETURNING clause query: UPDATE MYTABLE SET ABOOLEANCOLUMN =

Re: [SQL] After insert trigger and select

2011-02-16 Thread Rok Jaklič
On 02/16/2011 08:46 PM, pasman pasmański wrote: If I have after insert trigger on some table which updates some data in that same table, will be the select statement from some other client executed after all statements in that trigger? select statement is fired before commit ? pas

Re: [SQL] After insert trigger and select

2011-02-16 Thread pasman pasmański
> If I have after insert trigger on some table which updates some data in > that same table, will be the select statement from some other client > executed after all statements in that trigger? > select statement is fired before commit ? pasman -- Sent via pgsql-sql mailing list (pg

Re: [SQL] Oracle Equivalent queries in Postgres

2011-02-16 Thread bricklen
On Wed, Feb 16, 2011 at 2:42 AM, Sivannarayanreddy < sivannarayanre...@subexworld.com> wrote: > Hello, > I am checking the compatibility of my product with Postgres database and i > stucked in forming the below oracle equivalent queries in Postgres database, > Could some one help me pleaseee > >

[SQL] After insert trigger and select

2011-02-16 Thread Rok Jaklič
Hi. If I have after insert trigger on some table which updates some data in that same table, will be the select statement from some other client executed after all statements in that trigger? Thank you and kind regards, Rok -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To ma

Re: [SQL] Function compile error

2011-02-16 Thread Igor Neyman
> -Original Message- > From: Sivannarayanreddy [mailto:sivannarayanre...@subexworld.com] > Sent: Wednesday, February 16, 2011 7:36 AM > To: pgsql-sql@postgresql.org > Subject: Function compile error > > Hello, > I am trying to create the function as below but it is > throwing error 'E

[SQL] Retrieve the column values of a record without knowing the names

2011-02-16 Thread arthur_info
Hello, I've got the following function and I want to access the fields values of my record by index. The problem is that my select is retrieving each record line with all values and not each one of each row on my view... How can I solve this problem? Thanks in advance. CREATE FUNCTION fc_test

Re: [SQL] Oracle Equivalent queries in Postgres

2011-02-16 Thread Tom Lane
Thomas Kellerer writes: > Pavel Stehule, 16.02.2011 12:20: >>> Unfortunately they are not the same: Oracle does not support >>> INFORMATION_SCHEMA >> sorry, I expected so all mature databases support it. > Yes, this is really hard to understand. > I would assume creating the INFORMATION_SCHEMA

Re: [SQL] Function compile error

2011-02-16 Thread Pavel Stehule
Hello please, look to page http://www.postgresql.org/docs/9.0/interactive/plpgsql-porting.html It can be faster, if you try to read PL/pgSQL documentation first. PL/pgSQL is near PL/SQL, but it is a different language and environment still. http://www.postgresql.org/docs/9.0/interactive/plpgsql.

[SQL] Function compile error

2011-02-16 Thread Sivannarayanreddy
Title: Hello, I am trying to create the function as below but it is throwing error 'ERROR:  syntax error at or near "DECLARE"', Could some one help me please CREATE FUNCTION check_password(databasename text, tablename text, indexname text)RETURNS V

Re: [SQL] Oracle Equivalent queries in Postgres

2011-02-16 Thread Thomas Kellerer
Pavel Stehule, 16.02.2011 12:20: Unfortunately they are not the same: Oracle does not support INFORMATION_SCHEMA sorry, I expected so all mature databases support it. Yes, this is really hard to understand. I would assume creating the INFORMATION_SCHEMA views based on the existing Oracle v

Re: [SQL] Oracle Equivalent queries in Postgres

2011-02-16 Thread Pavel Stehule
2011/2/16 Thomas Kellerer : > Pavel Stehule, 16.02.2011 11:50: >> >> Try to use a standardized information_schema instead - these views are >> same on PostgreSQL and Oracle. > > Unfortunately they are not the same: Oracle does not support > INFORMATION_SCHEMA > sorry, I expected so all mature data

Re: [SQL] Oracle Equivalent queries in Postgres

2011-02-16 Thread Pavel Stehule
hello list of tables http://www.postgresql.org/docs/current/static/infoschema-tables.html information about column http://www.postgresql.org/docs/current/static/infoschema-columns.html information about indexes - it's not part of ANSI/SQL so you have to look to pg_index or pg_indexes. Regards P

Re: [SQL] Oracle Equivalent queries in Postgres

2011-02-16 Thread Thomas Kellerer
Pavel Stehule, 16.02.2011 11:50: Try to use a standardized information_schema instead - these views are same on PostgreSQL and Oracle. Unfortunately they are not the same: Oracle does not support INFORMATION_SCHEMA Regards Thomas -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)

Re: [SQL] Oracle Equivalent queries in Postgres

2011-02-16 Thread Pavel Stehule
Hello PostgreSQL uses a different system tables than Oracle. Try to use a standardized information_schema instead - these views are same on PostgreSQL and Oracle. http://www.postgresql.org/docs/current/static/information-schema.html Regards Pavel Stehule 2011/2/16 Sivannarayanreddy > Hel

[SQL] Oracle Equivalent queries in Postgres

2011-02-16 Thread Sivannarayanreddy
Title: Hello, I am checking the compatibility of my product with Postgres database and i stucked in forming the below oracle equivalent queries in Postgres database, Could some one help me pleaseee 1) Trying to get index and corresponding columns  information of a

Re: [SQL] PL/SQL block error

2011-02-16 Thread Pavel Stehule
Hello you should to wrap code to function or inline function everywhere. psql doesn't support PL/SQL and doesn't support inlined PL/SQL blocks. Regards Pavel Stehule 2011/2/16 Sivannarayanreddy > Hello, > I am very new to the postgres sql, i am trying to execute below pl/sql > block in post

[SQL] PL/SQL block error

2011-02-16 Thread Sivannarayanreddy
Title: Hello, I am very new to the postgres sql, i am trying to execute below pl/sql block in postgres but i am getting error 'ERROR:  syntax error at or near "integer" ', Could some one help me in this regard declare v_count integer; begin selec