473,668 Members | 2,632 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Where are user-defined types stored/viewed

After I execute a command like

CREATE TYPE employee_wage_j ournal_sum AS (supplier_pk integer,
employee_pk integer,
hourly_dollars double precision,
annual_dollars double precision);

where does this definition get stored, and what query can I run to get
teh definition back as output?

I don't see the new type show up anywhere in pgAdminII.

The new type DOES show up in the result when I run

select * from pg_type order by typname

but I see only the name itself (and a lot of "*id" columns that probably
reference something relevant), but I don't know how to get the actual
definition back so that I can use an existing type definition as the
basis for modification when application design changes are required.

~Berend Tober


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

Nov 12 '05 #1
3 4174
On Monday 29 September 2003 13:35, bt****@seaworth ysys.com wrote:
After I execute a command like

CREATE TYPE employee_wage_j ournal_sum AS (supplier_pk integer,
employee_pk integer,
hourly_dollars double precision,
annual_dollars double precision);

where does this definition get stored, and what query can I run to get
teh definition back as output?

I don't see the new type show up anywhere in pgAdminII.


In psql:
\d emplokee_wage_j ournal_sum

If you start psql with -E it will show you the query it uses to show this too.

--
Richard Huxton
Archonet Ltd

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

Nov 12 '05 #2
<bt****@seawort hysys.com> writes:
After I execute a command like
CREATE TYPE employee_wage_j ournal_sum AS (supplier_pk integer,
employee_pk integer,
hourly_dollars double precision,
annual_dollars double precision); I don't see the new type show up anywhere in pgAdminII.
Probably not. Stand-alone composite types (like the above) are a new
feature in 7.3, and pgAdminII likely doesn't know about them.

You might try pgAdmin III, which just got out of beta I believe.
but I see only the name itself (and a lot of "*id" columns that probably
reference something relevant), but I don't know how to get the actual
definition back so that I can use an existing type definition as the
basis for modification when application design changes are required.


There's always "pg_dump -s" to extract such stuff.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #3
On Monday 29 September 2003 13:35, bt****@seaworth ysys.com wrote:
After I execute a command like

CREATE TYPE employee_wage_j ournal_sum AS (supplier_pk integer,
employee_pk integer,
hourly_dollars double precision,
annual_dollars double precision);

where does this definition get stored, and what query can I run to
get teh definition back as output?

I don't see the new type show up anywhere in pgAdminII.


In psql:
\d emplokee_wage_j ournal_sum

If you start psql with -E it will show you the query it uses to show
this too.

--
Richard Huxton
Archonet Ltd


Based on the output produced using your advice, I came up the the
following query to help me list my type definitions:

CREATE VIEW public.complex_ types AS
SELECT
n.nspname,
c.relname,
a.attname,
pg_catalog.form at_type(a.attty pid, a.atttypmod),
a.attnotnull,
a.atthasdef,
a.attnum,
nspacl
FROM pg_catalog.pg_c lass c
LEFT JOIN pg_catalog.pg_n amespace n ON n.oid = c.relnamespace
LEFT JOIN pg_catalog.pg_a ttribute a ON a.attrelid = c.relfilenode
WHERE pg_catalog.pg_t able_is_visible (c.oid)
AND c.relkind = 'c'
ORDER BY
n.nspname,
c.relname,
a.attnum
~Berend Tober


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

Nov 12 '05 #4

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

Similar topics

3
6498
by: Cowfisher | last post by:
I can write simple MySQL stuff in PHP but I'm having problems putting in WHERE clauses. Everytime I do I get errors like this: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in c:\program files\apache group\apache\htdocs\vod\mineral_action.php on line 10 The code that generated this crap is: $sql = "UPDATE character SET mining = $new_skill WHERE char_name =
20
3534
by: David | last post by:
Hi, I have a field from my recordset called RS("Password"). If I wish to display each character as an asterix '*' how do I go about it. I've seen the replace function, but cannot work out how to do it for how ever many characters there are in the record ? Appreciate your help
7
3038
by: Britney | last post by:
Original code: this.oleDbSelectCommand1.CommandText = "SELECT TOP 100 user_id, password, nick_name, sex, age, has_picture, city, state, " + "country FROM dbo.users WHERE (has_picture = ?) AND (sex = ?) ORDER BY age " this.oleDbSelectCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("has_picture", System.Data.OleDb.OleDbType.Boolean, 1, "has_picture")); this.oleDbSelectCommand1.Parameters.Add(new...
3
2742
by: sean | last post by:
I have a table with fixed row of records SORTED by DATE using ADO pagination method. The user can click a link in one table cell and go to another page to modify the record. Once the updated record is saved the user will be redirect back to the table. This time the record updated will be highlighted so that the user knows where he came from. I basically pass the page number, column and row number via querystring and store the info in a...
3
2180
by: rreitsma | last post by:
I want to create a form that will allow the user to select from a list of available reports and based on a filter limit the records displayed in the report. I have figured out how to access the reports collection to populate a list box containing the report names. The filter I currently have lists some key fields that I think the user may want to filter on. A WHERE string is constructed based on the feilds that the user inputs values into....
6
2044
by: Liming | last post by:
Hi, In a typical 3 tier model (view layer, busines layer and data access layer) where do you handle your exceptions? do you let it buble up all the way to the .aspx pages or do you handle it in your business layer and/or data access layer? suppose in my data access layer, I provide try and catch, log the exception and re-throw it back to business layer, then in yoru business layer, what do you do? throw it back to the code behind or...
3
2247
markmcgookin
by: markmcgookin | last post by:
Hi Folks, I have a VB app, and I have been working at it for a while, and I am now at the stage where I want to create a search function. Now don't be scared! It is in the .Net compact framework, and uses SQL Server CE as the database (This seems to scare off people trying to help! lol) but the connection and reading of data etc is all handled, and I think it is going to be a "relatively" simple function. My database has a number of fields...
3
3139
by: ckauvar | last post by:
I've got a SQL statement that has me stumped. Consider the following scenario: A donor gives the following gifts: in 2006 they give $250 in 2007 they give $550 in 2008 they give $50 My report needs to select this individual because any one of their gifts exceeded $500 and then it needs to print all of their gifts in
7
1172
by: microgolf | last post by:
Hey, i have a question. i'm about to run an multilangual (if that even is a word) site and i would like to adjust the language of the site depending on what region the user lives... is there a way to know? thanks in advance, microgolf
7
2176
by: K Viltersten | last post by:
I've changed the declaration of the connection string in my application from String conStr = "the string"; to an external one, behaving as a property of my class (supposedly, a nicer approach, i've been told). private string _ConStr;
0
8459
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8367
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8790
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8570
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8650
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2781
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2017
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1779
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.