Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 100 lines (68 sloc) 3.502 kB
9769dcc @theory Increment to v1.1.0.
authored
1 colnames 1.1.0
1dd6e30 @theory Add README.
authored
2 ==============
3
4 This extension contains a single SQL function, `colnames()`, that takes a
5 record value as its argument and returns an array of the names of the columns
6 in that record. This can be useful for example in trigger functions, where one
7 might need to get the column names in order to generate a query string.
8
81116ae @theory Add .travis.yml.
authored
9 [![Build Status](https://travis-ci.org/theory/colnames.png)](https://travis-ci.org/theory/sqitch)
10
1dd6e30 @theory Add README.
authored
11 To build colnames, just do this:
12
13 make
14 make install
e2b0240 @theory Document support back to 8.2.
authored
15 make installcheck
1dd6e30 @theory Add README.
authored
16
17 If you encounter an error such as:
18
19 "Makefile", line 8: Need an operator
20
21 You need to use GNU make, which may well be installed on your system as
22 `gmake`:
23
24 gmake
25 gmake installcheck
e2b0240 @theory Document support back to 8.2.
authored
26 gmake install
1dd6e30 @theory Add README.
authored
27
28 If you encounter an error such as:
29
30 make: pg_config: Command not found
31
32 Be sure that you have `pg_config` installed and in your path. If you used a
33 package management system such as RPM to install PostgreSQL, be sure that the
34 `-devel` package is also installed. If necessary tell the build process where
35 to find it:
36
e2b0240 @theory Document support back to 8.2.
authored
37 make PG_CONFIG=/path/to/pg_config
38 make install PG_CONFIG=/path/to/pg_config
39 make installcheck PG_CONFIG=/path/to/pg_config
1dd6e30 @theory Add README.
authored
40
41 If you encounter an error such as:
42
43 ERROR: must be owner of database regression
44
45 You need to run the test suite using a super user, such as the default
46 "postgres" super user:
47
48 make installcheck PGUSER=postgres
49
50 Once colnames is installed, you can add it to a database. If you're running
51 PostgreSQL 9.1.0 or greater, it's a simple as connecting to a database as a
52 super user and running:
53
54 CREATE EXTENSION colnames;
55
56 If you've upgraded your cluster to PostgreSQL 9.1 and already had colnames
57 installed, you can upgrade it to a properly packaged extension with:
58
59 CREATE EXTENSION colnames FROM unpackaged;
60
61 For versions of PostgreSQL less than 9.1.0, you'll need to run the
62 installation script:
63
64 psql -d mydb -f /path/to/pgsql/share/contrib/colnames.sql
65
66 If you want to install colnames into a specific schema, use the `PGOPTIONS`
67 environment variable to specify the schema, like so:
68
69 PGOPTIONS=--search_path=extensions psql -d mydb -f colnames.sql
70
71 Dependencies
72 ------------
e2b0240 @theory Document support back to 8.2.
authored
73 The `colnames` data type has no dependencies other than PostgreSQL 8.2.0
74 or higher.
1dd6e30 @theory Add README.
authored
75
76 Copyright and License
77 ---------------------
78
79 Copyright (c) 2011 Andrew Gierth and David E. Wheeler.
80
81 This module is free software; you can redistribute it and/or modify it under
82 the [PostgreSQL License](http://www.opensource.org/licenses/postgresql).
83
84 Permission to use, copy, modify, and distribute this software and its
85 documentation for any purpose, without fee, and without a written agreement is
86 hereby granted, provided that the above copyright notice and this paragraph
87 and the following two paragraphs appear in all copies.
88
89 In no event shall Andrew Gierth or David E. Wheeler be liable to any party for
90 direct, indirect, special, incidental, or consequential damages, including
91 lost profits, arising out of the use of this software and its documentation,
92 even if Andrew Gierth or David E. Wheeler has been advised of the possibility
93 of such damage.
94
95 Andrew Gierth and David E. Wheeler specifically disclaim any warranties,
96 including, but not limited to, the implied warranties of merchantability and
97 fitness for a particular purpose. The software provided hereunder is on an "as
98 is" basis, and Andrew Gierth and David E. Wheeler have no obligations to
99 provide maintenance, support, updates, enhancements, or modifications.
Something went wrong with that request. Please try again.