Re: [SQL] How to encode and decode password in pgsql !!
Thus spake Subhramanya Shiva > i could not find chkpass in pgsql datatypes ... > it is giving error called : > > Unable to locate type name chkpass in catalog. > > what shall i do ?? You need the code that I just committed. You can get the files from http://www.ca.postgresql.org/cgi/cvsweb.cgi/pgsql/contrib/chkpass/. -- D'Arcy J.M. Cain| Democracy is three wolves http://www.druid.net/darcy/| and a sheep voting on +1 416 425 1212 (DoD#0082)(eNTP) | what's for dinner. ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl
[SQL] Re: Dateadd
> "LP" == Ligia Pimentel <[EMAIL PROTECTED]> writes: LP> I need to know if there is a sql function implemented in postgres LP> that gives me a date plus any number of days, months or years (the LP> traditional dateadd function) or how to do it in sql? Here's what I use: select CURRENT_DATE + '4 DAYS'::interval; Just cast your "interval" from a string to an interval type, then add it to your date value. I doubt this is portable. What "tradition" provides for a dateadd() function? -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D.Khera Communications, Inc. Internet: [EMAIL PROTECTED] Rockville, MD +1-240-453-8497 AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [SQL] "correct" sorting.
You're trying to compare apples and oranges. Since the field is of type text, it will sort by text. Therefore, the result will be 1 then 10 then 1a and so forth. It is sorting based on ASCII. The only way to get it to sort in proper numerical order is to make the field a numeric field. But of course you won't be able to use characters in that. Therefore, create a second field called revision or whatever of text. Now you can sort correctly with: select * from foo order by var1,revision; On Thu, 3 May 2001, Jeff MacDonald wrote: > Hi folks, > > say i have a text field with teh values > > 1,2,3,10,20,30,1a,1b,2a,2b > > and i want to sort it so i get, > > 1 > 1a > 1b > 2 > 2a > 2b > 3 > 10 > 20 > 30 > > is there anyway to do that with postgresql ? > below is what actually happens. > > jeff=> select * from foo order by var1; > var1 > -- > 1 > 10 > 1a > 1b > 2 > 20 > 2a > 2b > 3 > 30 > 3a > 3b > (12 rows) > -- Jeff Self Information Specialist Great Bridge, LLC www.greatbridge.com | www.greatbridge.org Norfolk, VA (757)233-5570 [EMAIL PROTECTED] ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
[SQL] Dateadd
I need to know if there is a sql function implemented in postgres that gives me a date plus any number of days, months or years (the traditional dateadd function) or how to do it in sql? Thanks in advance for any help Ligia ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
[SQL] create table
can anybody explain me the syntax of Create Table documentation?? CREATE [ TEMPORARY | TEMP ] TABLE table ( column type [ NULL | NOT NULL ] [ UNIQUE ] [ DEFAULT value ] [ column_constraint_clause | PRIMARY KEY } [ ... ] ] [ , ... ] [ , PRIMARY KEY ( column [, ... ] ) ] [ , CHECK (condition) ] [ , table_constraint_clause ] ) [ INHERITS ( inherited_table [, ... ] ) ] i don't understand what the curly brace means after PRIMARY KEY (where is the other matching brace? ). It must have something to do with the fact that a 'column type' pair ( with options ) can occur more than once, but is this syntax right? i also don't understand what the [ ... ] and [, ... ] means. I do know that brackets denote options and | alternatives. tx ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [SQL] Dateadd
On Wed, 2 May 2001, Ligia Pimentel wrote: > I need to know if there is a sql function implemented in postgres that gives > me a date plus any number of days, months or years (the traditional dateadd > function) or how to do it in sql? Just add a date and an interval. Something like: date + '1 day'::interval ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [SQL] Re: Use of the LIMIT clause ?
[ Charset ISO-8859-1 unsupported, converting... ] > On Mon, Mar 12, 2001 at 09:21:58PM -0500, Tom Lane wrote: > > Spy <[EMAIL PROTECTED]> writes: > > > Tom Lane a ?crit : > > >> Is that actually how MySQL interprets two parameters? We treat them > > >> as count and offset respectively, which definition I thought was the > > >> same as MySQL's. > > > > > But MySQL's syntax is different, as found on > > > http://www.mysql.com/doc/S/E/SELECT.html : > > > "SELECT [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] > > > [SQL_BUFFER_RESULT] > > > [...] > > > [LIMIT [offset,] rows]" > > > > That's annoying; looks like we do it backwards from MySQL. Can anyone > > confirm that this is how MySQL behaves (maybe it's a typo on this > > documentation page)? > > Yes, it does behave as documented. > > > Should we consider changing ours if it is different? > > I don't know that it's worth it... it seems to inconvenience some > people either way. I may soon be moving a moderately complex system > from MySQL to Postgres and it wouldn't be the end of my world if > I had to reverse all the LIMITs. > Added to TODO. If we took the feature from MySQL, seems we should match it. This will require a clear notice in the release notes: * Change LIMIT val,val to be offset,limit to match MySQL -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup.| Drexel Hill, Pennsylvania 19026 ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [SQL] create table
LeoDeBeo <[EMAIL PROTECTED]> writes: > i don't understand what the curly brace means after PRIMARY KEY (where is > the other matching brace? Typo. Try more recent versions of the docs. 7.1 says CREATE [ TEMPORARY | TEMP ] TABLE table_name ( { column_name type [ column_constraint [ ... ] ] | table_constraint } [, ... ] ) [ INHERITS ( inherited_table [, ... ] ) ] where column_constraint can be: [ CONSTRAINT constraint_name ] { NOT NULL | NULL | UNIQUE | PRIMARY KEY | DEFAULT value | CHECK (condition) | REFERENCES table [ ( column ) ] [ MATCH FULL | MATCH PARTIAL ] [ ON DELETE action ] [ ON UPDATE action ] [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] } and table_constraint can be: [ CONSTRAINT constraint_name ] { UNIQUE ( column_name [, ... ] ) | PRIMARY KEY ( column_name [, ... ] ) | CHECK ( condition ) | FOREIGN KEY ( column_name [, ... ] ) REFERENCES table [ ( column [, ... ] ) ] [ MATCH FULL | MATCH PARTIAL ] [ ON DELETE action ] [ ON UPDATE action ] [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] } The curly braces are just for grouping in cases where it'd not be clear how far the alternatives are supposed to extend. regards, tom lane ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
[SQL] Re: create table
On Sun, 29 Apr 2001, LeoDeBeo wrote: > can anybody explain me the syntax of Create Table documentation?? This doc is much improved in the more recent PG create table help. Check out the online 7.1 Reference Manual, and there's a much nicer CREATE TABLE grammar. -- Joel Burton <[EMAIL PROTECTED]> Director of Information Systems, Support Center of Washington ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl
Re: [SQL] create table
On Dom 29 Abr 2001 22:34, LeoDeBeo wrote: > can anybody explain me the syntax of Create Table documentation?? > > CREATE [ TEMPORARY | TEMP ] TABLE table ( > column type > [ NULL | NOT NULL ] [ UNIQUE ] [ DEFAULT value ] > [ column_constraint_clause | PRIMARY KEY } [ ... ] ] > [ , ... ] > [ , PRIMARY KEY ( column [, ... ] ) ] > [ , CHECK (condition) ] > [ , table_constraint_clause ] > ) [ INHERITS ( inherited_table [, ... ] ) ] > > i don't understand what the curly brace means after PRIMARY KEY (where is > the other matching brace? ). It must have something to do with the fact > that a 'column type' pair ( with options ) can occur more than once, but is > this syntax right? > i also don't understand what the [ ... ] and [, ... ] means. I do know that > brackets denote options and | alternatives. My docs (7.1) look like this: CREATE [ TEMPORARY | TEMP ] TABLE table_name ( { column_name type [ column_constraint [ ... ] ] | table_constraint } [, ... ] ) [ INHERITS ( inherited_table [, ... ] ) ] where column_constraint can be: [ CONSTRAINT constraint_name ] { NOT NULL | NULL | UNIQUE | PRIMARY KEY | DEFAULT value | CHECK (condition) | REFERENCES table [ ( column ) ] [ MATCH FULL | MATCH PARTIAL ] [ ON DELETE action ] [ ON UPDATE action ] [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] } and table_constraint can be: [ CONSTRAINT constraint_name ] { UNIQUE ( column_name [, ... ] ) | PRIMARY KEY ( column_name [, ... ] ) | CHECK ( condition ) | FOREIGN KEY ( column_name [, ... ] ) REFERENCES table [ ( column [, ... ] ) ] [ MATCH FULL | MATCH PARTIAL ] [ ON DELETE action ] [ ON UPDATE action ] [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] } Looks clear to me. :-) -- El mejor sistema operativo es aquel que te da de comer. Cuida tu dieta. - Martin Marques |[EMAIL PROTECTED] Programador, Administrador | Centro de Telematica Universidad Nacional del Litoral - ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl
Re: [SQL] Dateadd
* Ligia Pimentel <[EMAIL PROTECTED]> menulis: > I need to know if there is a sql function implemented in postgres that gives > me a date plus any number of days, months or years (the traditional dateadd > function) or how to do it in sql? cepat=# select '01-01-00'::date + '2 months 10 days'::interval; ?column? 2000-03-11 00:00:00-05 (1 row) -- Cliff Crawford http://www.sowrong.org/ birthday party cheesecake jellybean BOOM ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [SQL] '13 months ago'::reltime
On Friday 04 May 2001 06:32, you wrote: > Type reltime is old and deprecated. Don't use it. What should we be using instead? -- Sincerely etc., NAME Christopher Sawtell CELL PHONE 021 257 4451 ICQ UIN45863470 EMAIL csawtell @ xtra . co . nz CNOTES ftp://ftp.funet.fi/pub/languages/C/tutorials/sawtell_C.tar.gz -->> Please refrain from using HTML or WORD attachments in e-mails to me <<-- ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html