[GENERAL] ADD_Months Function in Postgres
Title: ADD_Months Function in Postgres Hi, I would like to know if there is a Function in Postgres Like the add_months Function in Oracle?? Thanxx Schoeib 4Tek Gesellschaft für angewandte Informationstechnologien mbH Schoeib Amin Tel. +49 (0) 69 697688-132 Fax. +49 (0) 69 697688-111 http://www.4tek.de
[GENERAL] Problems with GRANTING SELECT to a table
Title: Problems with GRANTING SELECT to a table Hi, I have a problem with permissions for SELECT. Here is what I did: test=> GRANT SELECT ON "poi"."fondsstamm" TO "flex"; GRANT test=> \dp fondsstamm; Access privileges for database "test" Schema | Table | Access privileges ++--- poi | fondsstamm | {=arwdRxt,poi=arwdRxt,flex=r} (1 row) Now when I try to select from the table poi.fondsstamm I become always the error: Permission denied, > psql test flex Welcome to psql 7.3.2, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help on internal slash commands \g or terminate with semicolon to execute query \q to quit test=> select * from poi.fondsstamm; ERROR: poi: permission denied What am I doing wrong?? Thanxx Schoeib 4Tek Gesellschaft für angewandte Informationstechnologien mbH Schoeib Amin Tel. +49 (0) 69 697688-132 Fax. +49 (0) 69 697688-111 http://www.4tek.de
[GENERAL] LAST_DAY Function in Postgres
Title: LAST_DAY Function in Postgres Hi, I would like to know if there is a Function in Postgres Like the LAST_DAY Function in Oracle?? In Oracle you can use the function the get the last day of a month. Thanxx Schoeib 4Tek Gesellschaft für angewandte Informationstechnologien mbH Schoeib Amin Tel. +49 (0) 69 697688-132 Fax. +49 (0) 69 697688-111 http://www.4tek.de
Re: [GENERAL] Trunc in Postgres
Your solution works in this example, but when I take a columnname which type is char(30) I beome the following error: ERROR: Cannot cast type character to integer -Ursprüngliche Nachricht- Von: Pavel Stehule [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 3. September 2003 15:56 An: Amin Schoeib Cc: [EMAIL PROTECTED] Betreff: Re: [GENERAL] Trunc in Postgres You can try select CAST(cast('4' as NUMERIC(20)) AS varchar); Pavel > > Hi, > Is there an equivalent for the trunc function of Oracle in Postgres??? > I need to trunc(the zeros) a number which is stored as a char with a > lot of zeros Like that : 004 > > In oracle you can make that by trunc(YOUR_COLUMNNAME,0) > > Thanxx > > Schoeib > > 4Tek Gesellschaft für angewandte Informationstechnologien mbH Schoeib > Amin Tel. +49 (0) 69 697688-132 > Fax. +49 (0) 69 697688-111 > http://www.4tek.de > > ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [GENERAL] Localization (for dates) Oracle vs. Postgresql
First of all I want to thank you for your quick response. That would be very nice if it is possible. But using to_char I can only set the format or is it in Postgres Other? When I would execute this: select to_char(now(),'DD.Month,') I would get the monthname in english but how can I perform with to_char That I become the monthname in german?? -Ursprüngliche Nachricht- Von: Tom Lane [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 3. September 2003 16:21 An: Amin Schoeib Cc: [EMAIL PROTECTED] Betreff: Re: AW: [GENERAL] Localization (for dates) Oracle vs. Postgresql "Amin Schoeib" <[EMAIL PROTECTED]> writes: > I want to change for example for one session the date-format from > english to german, so that The month names for example march will be > März in German. I only need that for the monthnames. I think you can do this if you are willing to use to_char() to format the dates for display. There's no provision for such localization in the basic date or timestamp datatypes, though. regards, tom lane ---(end of broadcast)--- TIP 8: explain analyze is your friend
Re: [GENERAL] Localization (for dates) Oracle vs. Postgresql
Is there maybe any other??? -Ursprüngliche Nachricht- Von: Karel Zak [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 3. September 2003 16:53 An: Tom Lane Cc: Amin Schoeib; [EMAIL PROTECTED] Betreff: Re: AW: AW: [GENERAL] Localization (for dates) Oracle vs. Postgresql On Wed, Sep 03, 2003 at 10:36:29AM -0400, Tom Lane wrote: > "Amin Schoeib" <[EMAIL PROTECTED]> writes: > > When I would execute this: > > select to_char(now(),'DD.Month,') > > I would get the monthname in english but how can I perform with > > to_char That I become the monthname in german?? > > Karel, isn't there a way to get localized month names using to_char() > ? I thought there was, but I don't see anything about it in the > manual. No way:-( But I think it's good point to TODO of the 7.5 release. Karel -- Karel Zak <[EMAIL PROTECTED]> http://home.zf.jcu.cz/~zakkr/ ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings
Re: [GENERAL] German special characters Problem
So what can I do that I don't get wrong characters??? -Ursprüngliche Nachricht- Von: Dennis Gearon [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 9. September 2003 16:11 An: Amin Schoeib Cc: [EMAIL PROTECTED] Betreff: Re: [GENERAL] German special characters Problem Amin Schoeib wrote: > Hi, > Can somebody tell me why german special characters like 'ü' or 'ä' > will be changed > To '?' when retrieving data from postgres with Java (JDBC). When I > select the data under > Postgres everything is ok. The problem occurs when I select the data > with Java. > > ??? > > Hope somebody can helps. > > Thanxx > > Schoeib > > 4Tek Gesellschaft für angewandte Informationstechnologien mbH Schoeib > Amin Tel. +49 (0) 69 697688-132 > Fax. +49 (0) 69 697688-111 > _http://www.4tek.de_ > It can be anywhere in the datastream where the encodings don' tmatch. Usually it's how the database was 'initdb' ---(end of broadcast)--- TIP 8: explain analyze is your friend
Re: [GENERAL] German special characters Problem
Is it possible to change the encoding on a existing Database? I mda this: psql -l List of databases Name| Owner | Encoding ---+---+--- test | pgsql | SQL_ASCII (1 rows) I think for german and other european languages I must use UNICODE But how can I change the encoding on the existing database 'test' -Ursprüngliche Nachricht- Von: Amin Schoeib Gesendet: Dienstag, 9. September 2003 16:13 An: Dennis Gearon Cc: [EMAIL PROTECTED] Betreff: Re: [GENERAL] German special characters Problem So what can I do that I don't get wrong characters??? -Ursprüngliche Nachricht- Von: Dennis Gearon [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 9. September 2003 16:11 An: Amin Schoeib Cc: [EMAIL PROTECTED] Betreff: Re: [GENERAL] German special characters Problem Amin Schoeib wrote: > Hi, > Can somebody tell me why german special characters like 'ü' or 'ä' > will be changed To '?' when retrieving data from postgres with Java > (JDBC). When I select the data under > Postgres everything is ok. The problem occurs when I select the data > with Java. > > ??? > > Hope somebody can helps. > > Thanxx > > Schoeib > > 4Tek Gesellschaft für angewandte Informationstechnologien mbH Schoeib > Amin Tel. +49 (0) 69 697688-132 > Fax. +49 (0) 69 697688-111 > _http://www.4tek.de_ > It can be anywhere in the datastream where the encodings don' tmatch. Usually it's how the database was 'initdb' ---(end of broadcast)--- TIP 8: explain analyze is your friend ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
[GENERAL] Converting database-encoding from SQL_ASCII to UNICODE?????
Title: Converting database-encoding from SQL_ASCII to UNICODE? Hi, I have a database with encoding SQL_ASCII. Now I need to convert the encoding to UNICODE. Can somebody tell me how I can do that Thanxx Schoeib 4Tek Gesellschaft für angewandte Informationstechnologien mbH Schoeib Amin Tel. +49 (0) 69 697688-132 Fax. +49 (0) 69 697688-111 http://www.4tek.de
[GENERAL] Between(Interval of two dates) in Postgres
Title: Between(Interval of two dates) in Postgres Hi, can somebody tell me How I can use the Oracle between function in Postgres? Like this: Select name from test Where date_f between '31.01.2000' And '31.01.2003' Thanxx Schoeib 4Tek Gesellschaft für angewandte Informationstechnologien mbH Schoeib Amin Tel. +49 (0) 69 697688-132 Fax. +49 (0) 69 697688-111 http://www.4tek.de