Re: [GENERAL] How to get the physical locations of tables, views, functions etc of Postgresql in Windows & Linux?

2012-05-04 Thread Siva Palanisamy
ndra [mailto:raghavendra@enterprisedb.com] Sent: Thursday, May 03, 2012 7:09 PM To: Siva Palanisamy Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] How to get the physical locations of tables, views, functions etc of Postgresql in Windows & Linux? On Thu, May 3, 2012 at 6:52 PM, Siva Palanisamy ma

[GENERAL] How to get the physical locations of tables, views, functions etc of Postgresql in Windows & Linux?

2012-05-03 Thread Siva Palanisamy
Hi there! I'm interested to get the physical locations of tables, views, functions, data/content available in the tables of PostgreSQL in Linux OS. I've a scenario that PostgreSQL could be installed in SD-Card facility and Hard-Disk. If I've tables, views, functions, data in SD, I want to get th

[GENERAL] Sequence Ids are not updating after COPY operation in PostgreSQL

2012-01-31 Thread Siva Palanisamy
Hi there! I'm inserting bulk records using COPY statement in PostgreSQL, and is successful. When I try to insert a record later manually, it throws duplicate sequence id error. What I realize is, the sequence ids are not getting updated in its cache. Should I manually update the sequence number

[GENERAL] Why CASCADE constraint takes more time when table is loaded with huge records?

2011-11-22 Thread Siva Palanisamy
Hi ya, As I had raised a question here at 'Please recommend the best bulk-delete option' (http://stackoverflow.com/questions/8172101/please-recommend-the-best-bulk-delete-option), CASCADE constraint is the

[GENERAL] Please recommend me the best bulk-delete option

2011-11-17 Thread Siva Palanisamy
Hi All, I'm using PostgreSQL 8.1.4. I've 3 tables: one being the core (table1), others are dependents (table2,table3). I inserted 7 records in table1 and appropriate related records in other 2 tables. As I'd used CASCADE, I could able to delete the related records using DELETE FROM table1;

[GENERAL] Please recommend me the best bulk-delete option

2011-11-17 Thread Siva Palanisamy
Hi All, I'm using PostgreSQL 8.1.4. I've 3 tables: one being the core (table1), others are dependents (table2,table3). I inserted 7 records in table1 and appropriate related records in other 2 tables. As I'd used CASCADE, I could able to delete the related records using DELETE FROM table1;

Re: [GENERAL] How to lock and unlock table in postgresql

2011-11-17 Thread Siva Palanisamy
.com] Sent: Thursday, November 17, 2011 1:20 PM To: Siva Palanisamy Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] How to lock and unlock table in postgresql On 17 Nov 2011, at 7:10, Siva Palanisamy wrote: > If there is a better solution, kindly let me know. > > CREATE OR R

Re: [GENERAL] How to lock and unlock table in postgresql

2011-11-16 Thread Siva Palanisamy
Hi John, Thanks for the solution. If I use currval('sqlname') in a loop of 7 records, what will happen if a record is inserted manually? I guess it will alter the sequences, and wrong values/chain might be introduced in foreign tables in the below function. Could you please clarify me on th

[GENERAL] How to lock and unlock table in postgresql

2011-11-16 Thread Siva Palanisamy
Hi ya, I've 2 tables: One being the master (table1) and another being the slave (table2). I want to lock table1 until the below function completes, and it should unlock the same at last. Below is my function. Pls guide me on how to apply locking table1 and unlocking the same finally. The scenar

[GENERAL] Performance issue during multiple insertions

2011-11-03 Thread Siva Palanisamy
Hi All. I basically have 3 tables. One being the core table and the other 2 depend on the 1st. I have the requirement to add upto 7 records in all the tables. I do have constraints (primary & foreign keys, index, unique etc) set for the tables. I can't go for bulk import (using COPY command)

[GENERAL] Help needed in Search

2011-09-28 Thread Siva Palanisamy
Hi All, I am trying to retrieve the contact names based on the keyed search string. It performs good for the English alphabets and behaves strangely for special chars such as _,/,\,% My query in the function is similar to SELECT contact_name FROM contacts WHERE LOWER(contact_name) LIKE LOWER(

[GENERAL] Help needed in Search

2011-09-28 Thread Siva Palanisamy
Hi All, I am trying to retrieve the contact names based on the keyed search string. It performs good for the English alphabets and behaves strangely for special chars such as _,/,\,% My query in the function is similar to SELECT contact_name FROM contacts WHERE LOWER(contact_name) LIKE LOWER(

[GENERAL] How to pass array from .pgc to sql function

2011-09-19 Thread Siva Palanisamy
Hi All, I am using embedded Postgres 'C' file to make function calls to the sql. I have a .pgc (a 'C' file with sql statements) and .sql file. I have a pointer array that looks like this: typedef struct { char* displayName; } DisplayName; DisplayName* displayName_list = calloc(5

[GENERAL] How to return an array of values from a function?

2011-09-14 Thread Siva Palanisamy
Hi All, I wish to return an array of values. Assume, I have a table called contacts. I want to display all the names available from a column in the UI. Hence I need to return that column as an array of values. Please correct me if there is any other solution exist. Here is the code, I'm trying

Re: [GENERAL] How to access tables using a superuser

2011-08-18 Thread Siva Palanisamy
superuser On 08/17/11 11:58 PM, Siva Palanisamy wrote: > > Hi All, > > I have few tables being created using an ordinary user account. When I > login into the postgresql using the super-user, I can't access my tables! > > It says, ERROR: relation "tablename" d

[GENERAL] How to access tables using a superuser

2011-08-18 Thread Siva Palanisamy
Hi All, I have few tables being created using an ordinary user account. When I login into the postgresql using the super-user, I can't access my tables! It says, ERROR: relation "tablename" does not exist. As I need to perform some operations using super-user, I want the tables to be accessed/

Re: [GENERAL] How to write a psql command inside a function?

2011-08-17 Thread Siva Palanisamy
.trav...@gmail.com] Sent: Wednesday, August 17, 2011 11:12 AM To: Siva Palanisamy Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] How to write a psql command inside a function? On Tue, Aug 16, 2011 at 10:33 PM, Siva Palanisamy wrote: > Hi All, > > > > I want to have a psql comm

[GENERAL] Any idea about using \COPY in ECPG statement

2011-08-16 Thread Siva Palanisamy
Hi All, Does anybody have an idea about how to write \COPY command as an ECPG statement? EXEC SQL \COPY tablename to 'sample.csv' DELIMITERS ',' CSV HEADER I want to perform the above psql command using an ECPG statement. No way of using COPY due to not availability of a super-user account. Cou

[GENERAL] How to write a psql command inside a function?

2011-08-16 Thread Siva Palanisamy
Hi All, I want to have a psql command '\COPY' inside a function. By default, this command works as such. But, not inside a function. Please guide me. Thanks and Regards, Siva. ::DISCLAIMER:: --

Re: [GENERAL] How to give \COPY inside a function

2011-08-16 Thread Siva Palanisamy
gards, Siva. -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Siva Palanisamy Sent: Wednesday, August 17, 2011 10:25 AM To: John R Pierce; pgsql-general@postgresql.org Subject: Re: [GENERAL] How to give \COPY inside a fun

Re: [GENERAL] How to give \COPY inside a function

2011-08-16 Thread Siva Palanisamy
pgsql-general-ow...@postgresql.org] On Behalf Of John R Pierce Sent: Tuesday, August 16, 2011 8:44 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] How to give \COPY inside a function On 08/16/11 8:07 AM, Siva Palanisamy wrote: > > I want to \COPY over COPY command as I am not running

[GENERAL] How to give \COPY inside a function

2011-08-16 Thread Siva Palanisamy
Hi All, I want to \COPY over COPY command as I am not running as a super/admin user. How to add \COPY command inside a function. The following statement inside a function throws error. \COPY xsa.export_table TO 'export.csv' DELIMITERS ',' CSV HEADER Errors are throwing at "\COPY" and no semi-co

[GENERAL] How to convert integer to string in functions

2011-08-12 Thread Siva Palanisamy
Hi All, In my table, some of the columns are in text datatype. Few data will come down from UI layer as integers. I want to convert that to string/text before saving it into the table. Please help me on this. Thanks and Regards, Siva. ::DISCLAIMER:: --

Re: [GENERAL] How to create a stored procedure in PostgreSQL

2011-08-12 Thread Siva Palanisamy
Hi Craig, Thanks a lot for your detailed response. Regards, Siva. -Original Message- From: Craig Ringer [mailto:ring...@ringerc.id.au] Sent: Friday, August 12, 2011 2:14 PM To: Siva Palanisamy Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] How to create a stored procedure in

[GENERAL] How to create a stored procedure in PostgreSQL

2011-08-12 Thread Siva Palanisamy
Hi All, I have worked in MS SQL Server where we can create a stored procedure that performs some set of queries in tandem. I wish to see a similar feature in PostgreSQL. Please guide me. I searched and found only functions as replacement to stored procedure in PostgreSQL! Is that so? How functi

Re: [GENERAL] Copy command to handle view for my export requirement

2011-08-11 Thread Siva Palanisamy
ERAL] Copy command to handle view for my export requirement Hi, COPY (SELECT ...) appeared in 8.2.x so you need to upgrade. Best regards, Zoltán Böszörményi 2011-08-11 13:21 keltezéssel, Siva Palanisamy írta: > Hi Andreas, > > FYI, I am using PostgreSQL 8.1.4. > > Thanks and Regards

Re: [GENERAL] Copy command to handle view for my export requirement

2011-08-11 Thread Siva Palanisamy
Hi Andreas, FYI, I am using PostgreSQL 8.1.4. Thanks and Regards, Siva. -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Siva Palanisamy Sent: Thursday, August 11, 2011 4:48 PM To: Andreas Kretschmer; pgsql-general

Re: [GENERAL] Copy command to handle view for my export requirement

2011-08-11 Thread Siva Palanisamy
@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Andreas Kretschmer Sent: Thursday, August 11, 2011 2:23 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] Copy command to handle view for my export requirement Siva Palanisamy wrote: > Hi All, > > > >

[GENERAL] Copy command to handle view for my export requirement

2011-08-11 Thread Siva Palanisamy
Hi All, I understand that copy and \copy commands in PostgreSQL work only for tables. I want it to export the data from varies tables. Instead, I can create a view for the list of tables. Can the copy or \copy commands be utilized to operate on views directly? Please let me know on this. Thank

Re: [GENERAL] How to get to know the current user account is superuser or not?

2011-08-08 Thread Siva Palanisamy
Behalf Of Achilleas Mantzios Sent: Monday, August 08, 2011 4:01 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] How to get to know the current user account is superuser or not? Στις Monday 08 August 2011 12:36:44 ο/η Siva Palanisamy έγραψε: > Hi All, > > I was provided with a use

[GENERAL] How to get to know the current user account is superuser or not?

2011-08-08 Thread Siva Palanisamy
Hi All, I was provided with a user account to access postgresql. I want to process some high-level operations that might need a superuser/admin privileged access. How to get to know the user account I was provided having what kind of privileges? It looks like I don't have super user account! An

Re: [GENERAL] Backup & Restore a database in PostgreSQL

2011-08-08 Thread Siva Palanisamy
o:amitabhk...@gmail.com] Sent: Monday, August 08, 2011 2:42 PM To: Siva Palanisamy Cc: John R Pierce; pgsql-general@postgresql.org Subject: Re: [GENERAL] Backup & Restore a database in PostgreSQL Hi Siva Not sure if it would help, but try passing -O in your pg_restore command. Amitabh On Mon, Aug 8, 2

Re: [GENERAL] Backup & Restore a database in PostgreSQL

2011-08-08 Thread Siva Palanisamy
stgresql.org] On Behalf Of John R Pierce Sent: Monday, August 08, 2011 1:45 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] Backup & Restore a database in PostgreSQL On 08/08/11 1:01 AM, Siva Palanisamy wrote: > > Hi All, > > I am also a newbie here! I need to backup a

[GENERAL] Backup & Restore a database in PostgreSQL

2011-08-08 Thread Siva Palanisamy
Hi All, I am also a newbie here! I need to backup a database and restore it into the target machine where the database may already present or might not. If it exists, I want the "restore" command to overwrite, otherwise, just create a new one. I tried using the commands: (1) BACKUP: pg_dump -h