Re: [SQL] rowtype and ecpg
My problem is a "rowtype" variable. I don't know how to declare a structure or anything else to pass information to the function, which input parameter has a type of "rowtype" (I have no problem retrieving any output - varchar or refcursor) Thanks Alla ---(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] unique index on function and column
Is there a simple way to do something like the following: create unique index inst_u_app on inst (lower(host), psport); It looks like you can have an index on several columns, but not several functions. ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [SQL] unique index on function and column
Bruno Wolff III <[EMAIL PROTECTED]> writes: > Is there a simple way to do something like the following: > create unique index inst_u_app on inst (lower(host), psport); > It looks like you can have an index on several columns, but not > several functions. The standard answer is to make a custom function that accepts all the columns and produces a result you can index. This is sort of an academic "an existence proof is good enough" answer, but it *is* possible to get the results you want. Making it more convenient hasn't risen to the top of anyone's to-do list. regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [SQL] unique index on function and column
On Tue, Jun 25, 2002 at 14:35:16 -0400, Tom Lane <[EMAIL PROTECTED]> wrote: > Bruno Wolff III <[EMAIL PROTECTED]> writes: > > Is there a simple way to do something like the following: > > create unique index inst_u_app on inst (lower(host), psport); > > > It looks like you can have an index on several columns, but not > > several functions. > > The standard answer is to make a custom function that accepts all the > columns and produces a result you can index. > > This is sort of an academic "an existence proof is good enough" answer, > but it *is* possible to get the results you want. Making it more > convenient hasn't risen to the top of anyone's to-do list. It probably isn't worth the trouble in this case. The number of rows is small and I will use a unique index without forcing a case independpent comparison. For the time being this is good enough. Thanks for confirming that I was reading the manually correctly. ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [SQL] what is the difference between default 0 vs default '0'
Hi Beth, I wouldn't have thought there'd be any difference to you, the user. If you used 0, then that is an integer and that will be the default. If you used '0' then that is a character or string and it will automatically be cast into an integer when used as a default. Chris - Original Message - From: "Beth Gatewood" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, June 26, 2002 8:52 AM Subject: [SQL] what is the difference between default 0 vs default '0' > all- > Could somebody tell me why I would use default 0 vs default '0' in the > following > CREATE TABLE foo (col1 INTEGER default 0) <-- or default '0' > > Thanks- > Beth > > > > > ---(end of broadcast)--- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) > > ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
