473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

7.4b4 domain usage and select question


I'm using 7.4b4 with domains, and am having a problem with selecting without
casting.

create domain test_domain as integer check( (value notnull) and (value >= 1) );
create table test_table( field_1 test_domain, field_2 integer );
insert into test_table values( 1, 1 );
insert into test_table values( '2', '2' );
select * from test_table where field_2 = '1';
select * from test_table where field_1 = '1'; -- fails

The last select fails with 'operator is not unique: test_domain = "unknown"'

The insert with quoted values works fine without casting.

The HINT indicates I need to cast, which works find with either '1'::integer or
'1'::test_domain. Is this the correct behavior? Do I have to cast every quoted
value? The values are quoted through the usage of DBD::Pg.

Thanks,
Rob

--
10:32:54 up 78 days, 2:58, 4 users, load average: 2.00, 2.00, 2.00

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iEYEARECAAYFAj+RbW8ACgkQgy51bQc2FFl5vgCgn6afbAnfzx joSTc+jP4CYsAS
pzgAn3so+rDuCWPiWQFaUeMBx3V/iHZo
=dS3J
-----END PGP SIGNATURE-----

Nov 12 '05 #1
5 1716
Robert Creager <Ro************@LogicalChaos.org> writes:
select * from test_table where field_1 = '1'; -- fails
The last select fails with 'operator is not unique: test_domain = "unknown"'


Works as expected in CVS tip ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #2
When grilled further on (Sat, 18 Oct 2003 13:12:41 -0400),
Tom Lane <tg*@sss.pgh.pa.us> confessed:
Robert Creager <Ro************@LogicalChaos.org> writes:
select * from test_table where field_1 = '1'; -- fails
The last select fails with 'operator is not unique: test_domain = "unknown"'


Works as expected in CVS tip ...

regards, tom lane


Per your suggestion, I grabbed the nightly snapshot. It works fine for the
domain problem I was encountering.

But, I cannot turn of logging of the duration! It's set to
log_min_duration_statement = 0, but still logs the duration of every statement.
This didn't happen with 7.4b4... I've set it high to not log most statements.

Cheers,
Rob

--
13:36:33 up 78 days, 6:02, 4 users, load average: 2.00, 2.00, 2.00

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iEYEARECAAYFAj+RlxQACgkQgy51bQc2FFl9qwCgm1UI7A3hsN i3k7oezbjnAB5B
iyQAn3FmM75TRMOQDTbgNqbAcsSuvRGM
=Vg9S
-----END PGP SIGNATURE-----

Nov 12 '05 #3
Robert Creager <Ro************@LogicalChaos.org> writes:
But, I cannot turn of logging of the duration! It's set to
log_min_duration_statement = 0,


-1 turns it off now.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #4
When grilled further on (Sat, 18 Oct 2003 15:46:55 -0400),
Tom Lane <tg*@sss.pgh.pa.us> confessed:
Robert Creager <Ro************@LogicalChaos.org> writes:
But, I cannot turn of logging of the duration! It's set to
log_min_duration_statement = 0,


-1 turns it off now.


Thanks. Didn't even thing of doing another initdb to see if the setting may of
changed...

Cheers,
Rob

--
13:54:49 up 78 days, 6:20, 4 users, load average: 2.00, 2.00, 2.00

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iEYEARECAAYFAj+RmtoACgkQgy51bQc2FFkW3wCcCNk5ofwsHa xLDYSdsL/Y9FIS
1bMAoKJ7OnQeJ60M6g4cNFjk5rxSZ5cX
=YN/f
-----END PGP SIGNATURE-----

Nov 12 '05 #5
On Sat, Oct 18, 2003 at 01:40:04PM -0600, Robert Creager wrote:
But, I cannot turn of logging of the duration! It's set to
log_min_duration_statement = 0, but still logs the duration of every
statement. This didn't happen with 7.4b4... I've set it high to not
log most statements.


The value has a different meaning now. You have to set it to -1 to
disable logging IIRC.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"In a specialized industrial society, it would be a disaster
to have kids running around loose." (Paul Graham)

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: phpfrizzle | last post by:
Hi there, I have a site with products on it. The site has a mysql backend. All products belong to certain series (table series). There can be up to 4 different products (table products)...
7
by: andy vandenberghe | last post by:
Hello everybody, i have the following table (agltransact), in which 2 fields are relevant: ex_inv_ref account 15 1512 15 6040 16 1512 16 1512 16 ...
1
by: alexqa2003 | last post by:
got a table with (class, name, exam, score) fields. To find max(score) for exam that starts with letter 'm' grouped by class and name,did: select max(score) from #temp where exam like 'm%'...
4
by: Rob Panosh | last post by:
Hello, This is probably a stupid question but I am going to ask it anyway because I don't know the answer to it. Both SQL Select Statements, below, execute and retuurn the same results. Why...
0
by: lannsjo | last post by:
I have a "userstuff" table like this: | uid | user_id | typedb | dbid | ----------------------------------- | 1 | 12 | boards | 3 | | 2 | 13 | boards | 3 | | 3 | ...
4
by: DBC User | last post by:
Hi, I feel so stupid to ask this question, but here it goes When I select a column from a table, if the column has a null value I want the select to return me a blank. I have done this before...
3
by: Alex | last post by:
Hi, I need to form a query where i can add some columns based on the result. Table A ColA, ColB ---------- 1 A 2 B
3
by: Tcs | last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't loaded it yet. I'm still using MS Access. And no, I don't believe this is an Access question. (But who knows? I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.