[SQL] How to create Function which retruns username and password
Dear All, I want to create function which returns username and password from the database.I have users table in the database.in that i have username and password columns.I need return username and password using functions.it is urgent. I am waiting for your great response, Thanks, Regards, Ven
[SQL] Postgresql PostGIS installation on Widows Server 2003
Dear All, I am using Windows Server 2003 for installing Postgresql 8.1. I got error called "Filed to set permissions on installed files".And i have uninsulated 8.1 and i try to install 8.2. Here also I am getting same error.When try to install Postgresql 8.3, It is installed but i am not able to enable Spatial extensions .Means I am not able to run "lwpostgis.sql" and "spatial_ref_sys.sql" . i am getting error.Please any one can guide me .It is very urgent.I am waiting for your great response. Regards, Ven
[SQL] How to Insert and retrieve multilingual (Hindi "an Indian language") into PostgreSQL
Dear All, I want to insert and retrieve multilingual (Hindi) into database.is PostgreSQL supports that ?if it is ... please guide me how to enable multilingual in the table. I am waiting for your great response. Thanks and Regards, Venkat
[SQL] How to Get Column Names from the Table
Dear All, How to get Column Names from Table in PostgreSQL. Thanks and Regards, Venkat
Re: [SQL] How to Get Column Names from the Table
Thanks alot Andreas...It is working fine... Thanks again. Venkat On Wed, Jul 7, 2010 at 2:44 PM, A. Kretschmer < andreas.kretsch...@schollglas.com> wrote: > In response to venkat : > > Dear All, > > > >How to get Column Names from Table in PostgreSQL. > > select column_name from information_schema.columns where table_name = > 'your_table'; > > > Regards, Andreas > -- > Andreas Kretschmer > Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) > GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431 2EB0 389D 1DC2 3172 0C99 > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql >
Re: [GENERAL] [SQL] How to Get Column Names from the Table
Dear Sreelatha. It is working fine. Thanks alot. Thanks and Regards, Venkat On Wed, Jul 7, 2010 at 3:42 PM, Sreelatha G wrote: > Hi, > > To get column names only > > select column_name from information_schema.columns where > table_name='captor_prime_aggregates'; > > Thanks > Sreelatha > On Wed, Jul 7, 2010 at 2:44 PM, Viktor Bojović > wrote: > >> \d tableName >> >> >> On Wed, Jul 7, 2010 at 11:08 AM, venkat wrote: >> >>> Dear All, >>> >>>How to get Column Names from Table in PostgreSQL. >>> >>> Thanks and Regards, >>> >>> Venkat >>> >> >> >> >> -- >> --- >> Viktor Bojović >> --- >> Wherever I go, Murphy goes with me >> > >
[SQL] How to get geometry enabled Tables form Postgresql/postgis
Dear All, How can i retrieve only spatial enabled tables form the database(Postgresql/PostGIS).Please let me know. I am waiting for your great response. Thanks and Regards, Venkat
Re: [SQL] How to get geometry enabled Tables form Postgresql/postgis
Dear Lee, Perfect Its working fine Thanks alot.. Thanks and Regards, Venkat On Fri, Jul 30, 2010 at 1:43 AM, Lee Hachadoorian < lee.hachadoor...@gmail.com> wrote: > All geometric columns in all spatially enabled tables appear in the table > public.geometry_columns, defined as: > > CREATE TABLE public.geometry_columns > > ( > > f_table_catalog character varying(256) NOT NULL, > > f_table_schema character varying(256) NOT NULL, > > f_table_name character varying(256) NOT NULL, > > f_geometry_column character varying(256) NOT NULL, > > coord_dimension integer NOT NULL, > > srid integer NOT NULL, > > "type" character varying(30) NOT NULL, > > CONSTRAINT geometry_columns_pk PRIMARY KEY (f_table_catalog, > f_table_schema, f_table_name, f_geometry_column) > > ) > > WITH ( > > OIDS=TRUE > > ); > > > For tables only, a simple > > SELECT DISTINCT f_table_schema, f_table_name FROM geometry_columns; > > should do the trick. > > --Lee > > > On 07/29/2010 08:58 AM, venkat wrote: > > Dear All, > > > How can i retrieve only spatial enabled tables form the > database(Postgresql/PostGIS).Please let me know. > > I am waiting for your great response. > > Thanks and Regards, > > Venkat > > > -- > Lee Hachadoorian > PhD Student, Geography > Program in Earth & Environmental Sciences > CUNY Graduate Center > >
Re: [SQL] insert into help
HI, Please go through http://www.java2s.com/Tutorial/Oracle/0080__Insert-Update-Delete/CopyingRowsfromOneTabletoAnotherINSERTINTOselect.htm <http://www.java2s.com/Tutorial/Oracle/0080__Insert-Update-Delete/CopyingRowsfromOneTabletoAnotherINSERTINTOselect.htm>Thanks and Regards, Venkat On Wed, Sep 22, 2010 at 1:02 PM, Nicholas I wrote: > Hi, > > i have two tables, > --- > *table1 > > id type serial, name varchar;* > *-- > table 2 > > name varchar;* > --- > > i want to insert the values of table 2 into table 1, with automatic id's. > > insert into table1(select * from table2); > > is not working, how can i append the data to table 1 with auto incremented > or nextval. > > -Nicholas I >
[SQL] How to update multiple rows
Dear All, I want to update multiple row in single query.I am trying for below query.I am getting error as "ERROR: more than one row returned by a subquery used as an expression SQL state: 21000" Here is my Query. update parcelsdata set gid=(select random() * 10), kasarano=(select kasarano from parcelsdata), murabano=(select murabano from parcelsdata), the_geom = (select (st_dump(st_polygonize(st_union(st_boundary(the_geom), the_line.geom as the_geom from (select gid,kasarano,murabano,st_linefromtext('LINESTRING(' ||(st_xmin(the_geom)-1)::text||' '||(st_ymax(the_geom)-the_length)||', '||st_xmax(the_geom)+1||' '||st_ymax(the_geom)-the_length||')',24047) as the_line, the_geom from (select 100 as the_length, * from parcelsdata) a) b where gid = 113 GROUP BY gid,kasarano,murabano) where kasarano='1' and murabano='119' Please let me know.I am waiting for your great response. Thanks and Regards, Venkat
Re: [SQL] [GENERAL] How to update multiple rows
Dear Alban, Thanks for your great response.I am not able to compile the query which you have given..I am not able to understand.Please alter my code. (select kasarano from parcelsdata), murabano=(select murabano from parcelsdata), the_geom = (select (st_dump(st_polygonize(st_union(st_boundary(the_geom), the_line.geom as the_geom from (select gid,kasarano,murabano,st_linefromtext('LINESTRING(' ||(st_xmin(the_geom)-1)::text||' '||(st_ymax(the_geom)-the_length)||', '||st_xmax(the_geom)+1||' '||st_ymax(the_geom)-the_length||')',24047) as the_line, the_geom from (select 100 as the_length, * from parcelsdata) a) b where gid = 113 GROUP BY gid,kasarano,murabano) if i compile above code , its giving me 2 records.. and when i try to update the table i am getting using below code... update parcelsdata set gid=(select random() * 10), kasarano=(select kasarano from parcelsdata), murabano=(select murabano from parcelsdata), the_geom = (select (st_dump(st_polygonize(st_union(st_boundary(the_geom), the_line.geom as the_geom from (select gid,kasarano,murabano,st_linefromtext('LINESTRING(' ||(st_xmin(the_geom)-1)::text||' '||(st_ymax(the_geom)-the_length)||', '||st_xmax(the_geom)+1||' '||st_ymax(the_geom)-the_length||')',24047) as the_line, the_geom from (select 100 as the_length, * from parcelsdata) a) b where gid = 113 GROUP BY gid,kasarano,murabano) I am getting below error.. "ERROR: more than one row returned by a subquery used as an expression SQL state: 21000" Please let me know where I am doing wrong.. guide me how to update those multiple records..I am waiting for your great response. Thanks and Regards, Venkat On Tue, Oct 26, 2010 at 1:32 PM, Alban Hertroys < dal...@solfertje.student.utwente.nl> wrote: > On 26 Oct 2010, at 9:07, venkat wrote: > > > Dear All, > > > > I want to update multiple row in single query.I am trying for below > query.I am getting error as > > > > "ERROR: more than one row returned by a subquery used as an expression > > SQL state: 21000" > > You're probably looking for UPDATE table FROM other_table. > > That said, I think your subqueries are rather under-constrained - you don't > correlate the records in your subqueries to the records you're updating at > all! The result will be that all your rows will be based on the last row > selected by each subquery. I can't imagine why you'd want that, so I assume > you don't. > > > Here is my Query. > > > > update parcelsdata set gid=(select random() * 10), > > kasarano=(select kasarano from parcelsdata), > > murabano=(select murabano from parcelsdata), > > the_geom = (select > (st_dump(st_polygonize(st_union(st_boundary(the_geom), the_line.geom as > the_geom from > > (select gid,kasarano,murabano,st_linefromtext('LINESTRING(' > > ||(st_xmin(the_geom)-1)::text||' > > '||(st_ymax(the_geom)-the_length)||', > > '||st_xmax(the_geom)+1||' > > '||st_ymax(the_geom)-the_length||')',24047) as the_line, > the_geom from > > (select 100 as the_length, * from parcelsdata) a) b > > where gid = 113 GROUP BY gid,kasarano,murabano) > > > > where kasarano='1' and murabano='119' > > You would rewrite that to, for example: > > update parcelsdata > set gid = random() * 10, >kasarano = pd2.kasarano, >murabano = pd2.murabano > > from parcelsdata pd2 > where id = pd2.id -- substitute for whatever your primary key/condition is > > and kasarano = '1' > and murabano = '119' > > Yeah, I left out the geometry thing as I'm too lazy to figure out where > your brackets start and end ;) > > Alban Hertroys > > -- > Screwing up is an excellent way to attach something to the ceiling. > > > !DSPAM:1184,4cc68b1610291250718568! > > >
[SQL] How to Convert Integer to Serial
Dear All, I want to convert integer datatype to serial datatype.. is that possible.Please let me know. Thanks and Regards, Ven
Re: [SQL] How to Convert Integer to Serial
Dear All, I got the solution... Here is my query ALTER TABLE DemoTable ALTER gid TYPE INT2; Thanks again On Fri, Oct 29, 2010 at 10:18 AM, venkat wrote: > Dear All, > > I want to convert integer datatype to serial datatype.. is that > possible.Please let me know. > > Thanks and Regards, > > Ven >
Re: [SQL] How to Convert Integer to Serial
ohhh,, sorry... It was wrong post..sorry again... On Fri, Oct 29, 2010 at 10:30 AM, Shoaib Mir wrote: > On Fri, Oct 29, 2010 at 3:48 PM, venkat wrote: > >> Dear All, >> >> I want to convert integer datatype to serial datatype.. is that >> possible.Please let me know. >> >> > I don't think ALTER TABLE will let you do that... so the best way to > achieve the same is: > > - Create a sequence for the column (set the start of sequence according to > the values you got already in the column) > - Now set this sequence as the default value for that specific column which > you need to ALTER like this: > > ALTER TABLE tablename ALTER COLUMN columnname > SET DEFAULT nextval('newsequence'::regclass); > > -- > Shoaib Mir > http://shoaibmir.wordpress.com/ >
[SQL] How to convert string to integer
Dear All, How do i convert string to int select SUM(pan_1) from customers1 where name='101' When i run the above query i m getting "function sum(character varying) does not exist".. Please anyone can guide me.. Thanks
[SQL] Reg:-How to make relationship more one table in PgSQL
Dear All, I am new to PqSQL. I have one problem.that is i want to make relation 4 tables.How to do in postgresql.Please any can help me. I am waiting for your great response. Advanced Thanks, Regards Venkat
[SQL] How to insert Images(bnp,png,etc) into Postgresql and how to retrive the inserted Imaged using C#.net
Dear All, I want to insert Images(bnp,png,etc) into Postgresql and how to retrieve the inserted Imaged using C#.net.I do not know where to start? Any one can help me. I am waiting for your great response. Advanced Thanks, Venkat.
Re: [SQL] Re: How to insert Images(bnp,png,etc) into Postgresql and how to retrive the inserted Imaged using C#.net
HI Milen, Thanks for your great response,I do not find anything like insert images.. I have seen the whole tutorial..Please can you give me some example to insert images into postgresql. I am waiting for your great response. Thanks, Venkat. On Thu, Dec 18, 2008 at 8:02 PM, Milen A. Radev wrote: > venkat написа: > > Dear All, > > > > I want to insert Images(bnp,png,etc) into Postgresql and how to > retrieve > > the inserted Imaged using C#.net.I do not know where to start? Any one > can > > help me. > [...] > > Start here - > http://npgsql.projects.postgresql.org/docs/manual/UserManual.html and > look for "Working with binary data and bytea datatype". > > > -- > Milen A. Radev > > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql > -- Thanks And Regards, VENKATRAO TAMMINENI
[SQL] How much the max image size can be inserted into Postgresql
Dear All, I want to insert image which is more than 1 GB.is it possible to store that same size or we can store more than that.Please let me know . I am waiting for your great response. Advanced Thanks, Regards Venkat.
[SQL] How to Import Excel Into PostgreSQL database
Dear All, I using PosgreSql8.1.I want to import Excel into PostgreSQL database. Is there any way to import ? . Please anyone can guide me. I am waiting for your great response. Thanks Venkat.
Re: [SQL] How to Import Excel Into PostgreSQL database
Hi , Thanks a lot. Regards Venkat. -Original Message- From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] On Behalf Of A. Kretschmer Sent: Wednesday, December 24, 2008 2:54 PM To: pgsql-sql@postgresql.org Subject: Re: [SQL] How to Import Excel Into PostgreSQL database In response to Venkat Rao Tammineni : > Dear All, > > > > I using PosgreSql8.1.I want to import Excel into PostgreSQL database. Is > there any way to import ? . Create a CSV-File and import that with COPY. Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql
[SQL] How to improve PgSql Performance using npgsql
Dear All, I am using npgsql.dll to connect postgresql database. Everything is working fine.but sometimes database is getting slow and even sometimes I am not getting data .I have written one function which access the data . Below is my code .. public NpgsqlConnection PgSqlDataConnection() { if (pgSqlConnection != null) { if (pgSqlConnection.State == ConnectionState.Open) { pgSqlConnection.Close(); //pgSqlConnection.Dispose(); } } pgConnectionString = ConfigurationSettings.AppSettings["ConnectionString"].ToString(); pgSqlConnection = new NpgsqlConnection(pgConnectionString); try { pgSqlConnection.Open(); } catch (Exception exp) {} return pgSqlConnection; } Please let me where I am doing wrong. I am waiting for your great response. Advanced thanks. Reagrds, Venkat.